X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_physics.h;h=b6283bf3c6353fa1c4f31000e201a6fc88371556;hb=1142fd5c27cf6d5bef073969b55e20b160646164;hp=f395953932e19003e93cac528d76c538cb99531e;hpb=403726131f9b460c3264e4f64c46f8aaa82978fe;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_physics.h b/player_physics.h index f395953..b6283bf 100644 --- a/player_physics.h +++ b/player_physics.h @@ -1092,6 +1092,15 @@ VG_STATIC void player_do_motion(void) m3x3_mulv( gate->transport, phys->m, phys->m ); m3x3_mulv( gate->transport, phys->bob, phys->bob ); + /* Pre-emptively edit the camera matrices so that the motion vectors + * are correct */ + m4x3f transport_i; + m4x4f transport_4; + m4x3_invert_affine( gate->transport, transport_i ); + m4x3_expand( transport_i, transport_4 ); + m4x4_mul( main_camera.mtx.pv, transport_4, main_camera.mtx.pv ); + m4x4_mul( main_camera.mtx.v, transport_4, main_camera.mtx.v ); + v4f transport_rotation; m3x3_q( gate->transport, transport_rotation ); q_mul( transport_rotation, phys->rb.q, phys->rb.q );