diff --git a/rogueviz/ads/display.cpp b/rogueviz/ads/display.cpp index 14875d13..32d33fe6 100644 --- a/rogueviz/ads/display.cpp +++ b/rogueviz/ads/display.cpp @@ -135,11 +135,17 @@ void draw_game_cell(const cell_to_draw& cd) { rock.pts.push_back(f); }); } - + if(hv) { - ads_point M = current * (V * rock.at) * ads_matrix(Id, rock.pt_main.shift) * C0; + ld t = rock.life_start; + if(t < -100) t = 0; + ld shift = floor((rock.pt_main.shift - t) / spacetime_step) * spacetime_step + t; + ads_point M = current * (V * rock.at) * ads_matrix(Id, shift) * C0; optimize_shift(M); - for(ld z=-5; z<=5; z+=0.2) { + for(int z0=-spacetime_qty; z0<=spacetime_qty; z0++) { + ld z = z0 * spacetime_step; + if((shift+z) < rock.life_start) continue; + if((shift+z) > rock.life_end) continue; for(int i=0; i rock.life_end) continue; + transmatrix at1 = at * lorentz(2, 3, z); if((at1 * pov) [2] < 0) continue; auto& sh = *rock.shape; diff --git a/rogueviz/ads/globals.cpp b/rogueviz/ads/globals.cpp index e015a03d..99aa833b 100644 --- a/rogueviz/ads/globals.cpp +++ b/rogueviz/ads/globals.cpp @@ -136,4 +136,6 @@ bool ads_draw_cell(cell *c, const shiftmatrix& V); extern transmatrix Duality; extern int use_duality; +ld spacetime_step = 0.1; +int spacetime_qty = 30; }}