1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-03-12 22:48:16 +00:00

ads-game:: show the (approximate) future

This commit is contained in:
Zeno Rogue 2022-09-18 11:24:43 +02:00
parent d76b2156f2
commit eefb91501e
3 changed files with 22 additions and 0 deletions

@ -118,6 +118,7 @@ bool ads_turn(int idelta) {
current_ship = current;
vctr_ship = vctr;
vctrV_ship = vctrV;
vctr_ship_base = hybrid::get_where(vctr_ship).first;
view_pt = 0;
}
else {

@ -152,6 +152,24 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) {
queuecurve(shiftless(Id), 0xFF, shipcolor, PPR::LINE);
}
if(paused && c == vctr_ship_base && !game_over) {
vector<hyperpoint> pts;
vector<ld> times;
int ok = 0, bad = 0;
for(int i=0; i<=360; i++) {
hybrid::in_actual([&]{
auto h = ads_inverse(current_ship * vctrV_ship) * spin(i*degree) * lorentz(0, 2, 6);
auto cr = cross0(current * V * h);
pts.push_back(cr.h);
times.push_back(cr.shift);
if(cr.shift > 0 && cr.shift < 90*degree) ok++; else bad++;
});
}
if(bad == 0) {
for(auto h: pts) curvepoint(h);
queuecurve(shiftless(Id), 0x000000C0, 0x00000060, PPR::SUPERLINE);
}
}
}
void view_ads_game() {

@ -23,6 +23,9 @@ ads_matrix current_ship;
/** SL cell closest to the current view/ship */
cell *vctr, *new_vctr, *vctr_ship;
/** hyperbolic cell closest to the current view/ship */
cell *vctr_ship_base;
/** world coordinates of vctr -- technically, this is a shiftmatrix */
ads_matrix vctrV, new_vctrV, vctrV_ship;