1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-18 06:30:41 +00:00

rogueviz:: smoothcam:: nicer rotation in twisted/product geometries

This commit is contained in:
Zeno Rogue 2024-08-21 19:28:54 +02:00
parent facac688a0
commit f0146d2308

View File

@ -630,6 +630,37 @@ void handle_animation(ld t) {
rotate_view(inverse(Rot));
}
else if(mtwisted || mproduct) {
hyperpoint h;
for(int j=0; j<4; j++) {
vector<ld> values;
for(auto& f: anim.frames) {
hyperpoint v = f.V*C0;
prepare_for_interpolation(v);
values.push_back(v[j]);
}
h[j] = interpolate(values, times, t);
}
after_interpolation(h);
View = gpushxto0(h); NLP = Id;
transmatrix Rot = Id;
for(int j=0; j<3; j++) for(int k=0; k<3; k++) {
vector<ld> values;
for(auto& f: anim.frames) {
transmatrix Rot1 = gpushxto0(f.V*C0) * f.V;
auto t = Rot1;
if(mproduct) Rot1 = Rot1 * f.ori;
println(hlog, kz(t), " -> ", kz(Rot1), " LPU ", nisot::local_perspective_used);
values.push_back(Rot1[j][k]);
}
Rot[j][k] = interpolate(values, times, t);
}
fix_rotation(Rot);
rotate_view(inverse(Rot));
}
else {
hyperpoint pts[3];