1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-26 15:12:48 +00:00

ads-game:: fixed history view

This commit is contained in:
Zeno Rogue 2022-09-29 14:24:57 +02:00
parent 25997dc6c1
commit 80c02c7e38
3 changed files with 8 additions and 6 deletions

View File

@ -186,6 +186,7 @@ bool ads_turn(int idelta) {
shipstate ss; shipstate ss;
ss.at = ads_inverse(current * vctrV) * spin((ang+90)*degree); ss.at = ads_inverse(current * vctrV) * spin((ang+90)*degree);
ss.ang = ang; ss.ang = ang;
ss.current = current;
ss.start = ship_pt; ss.start = ship_pt;
ss.duration = pt; ss.duration = pt;
ss.vctrV = vctrV; ss.vctrV = vctrV;

View File

@ -377,6 +377,7 @@ bool ds_turn(int idelta) {
ss.at.T = inverse(current.T) * spin(ang*degree); ss.at.T = inverse(current.T) * spin(ang*degree);
ss.at.shift = current.shift; ss.at.shift = current.shift;
ss.start = ship_pt; ss.start = ship_pt;
ss.current = current;
ss.duration = pt; ss.duration = pt;
ss.ang = ang; ss.ang = ang;
history.emplace_back(ss); history.emplace_back(ss);
@ -619,16 +620,15 @@ void ds_record() {
view_pt = (ticks / full) * DS_(simspeed); view_pt = (ticks / full) * DS_(simspeed);
for(auto& ss: history) for(auto& ss: history)
if(ss.start + ss.duration > view_pt) { if(ss.start + ss.duration > view_pt) {
current = ss.current;
if(sphere) { if(sphere) {
dynamicval<eGeometry> g(geometry, gSpace435); dynamicval<eGeometry> g(geometry, gSpace435);
current.shift = ss.at.shift; current.T = inverse(ss.at.T * spin(-(ss.ang+90)*degree));
current.T = inverse(ss.at.T * spin(-ss.ang*degree));
current.T = lorentz(3, 2, view_pt - ss.start) * current.T; current.T = lorentz(3, 2, view_pt - ss.start) * current.T;
} }
else PIA({ else PIA({
current = ads_inverse(ss.at * spin(-ss.ang*degree)); vctr = new_vctr = ss.vctr;
vctr = ss.vctr; vctrV = new_vctrV = ss.vctrV;
vctrV = ss.vctrV;
current.T = cspin(3, 2, view_pt - ss.start) * current.T; current.T = cspin(3, 2, view_pt - ss.start) * current.T;
if(auto_rotate) if(auto_rotate)
current.T = cspin(1, 0, view_pt - ss.start) * current.T; current.T = cspin(1, 0, view_pt - ss.start) * current.T;

View File

@ -33,6 +33,7 @@ int gen_expire() {
struct shipstate { struct shipstate {
ads_matrix at; ads_matrix at;
ads_matrix current;
ld start; ld start;
ld duration; ld duration;
ld ang; ld ang;