mobile:: rotating rug via orientation works again, and using rotate_view

This commit is contained in:
Zeno Rogue 2021-06-01 18:01:08 +02:00
parent 6e4b2c281f
commit b37ad3d8a8
1 changed files with 7 additions and 2 deletions

View File

@ -185,14 +185,14 @@ void apply_orientation() {
main_last_orientation = T;
else {
transmatrix next_orientation = T;
View = main_last_orientation * View;
rotate_view(main_last_orientation);
if(WDIM == 2 && vid.fixed_yz) {
if(View[0][2] || View[1][2] || View[2][2]) {
View = cspin(0, 2, -atan2(View[0][2], View[2][2])) * View;
View = cspin(1, 2, -atan2(View[1][2], View[2][2])) * View;
}
}
View = inverse(next_orientation) * View;
rotate_view(inverse(next_orientation));
main_last_orientation = next_orientation;
}
}
@ -212,6 +212,11 @@ EX void mobile_draw(MOBPAR_FORMAL) {
if(GDIM == 3 && !shmup::on && !rug::rugged)
apply_orientation();
if(rug::rugged) {
rug::using_rugview urv;
apply_orientation();
}
if(playermoved && vid.sspeed > -4.99)
centerpc(tdiff / 1000.0 * exp(vid.sspeed));