third person better camera
[carveJwlIkooP6JGAAIwe30JlM.git] / player_interface.h
index a4be40ed5177fe1a0fde9048a7c18d25740c9490..54173455e9be62569a9b68cb23037761a41bc2ae 100644 (file)
@@ -180,9 +180,24 @@ VG_STATIC void player_update( player_interface *player )
       player->dev.device->update( player, &player->dev );
 }
 
-VG_STATIC void player_post_update( player_interface *player, 
-                                   camera *main_camera )
+VG_STATIC void player_apply_transport_to_cam( m4x3f transport )
 {
+   /* FIXME: Applies to main_camera directly! */
+
+   /* Pre-emptively edit the camera matrices so that the motion vectors 
+    * are correct */
+   m4x3f transport_i;
+   m4x4f transport_4;
+   m4x3_invert_affine( 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 );
+}
+
+VG_STATIC void player_post_update( player_interface *player )
+{
+   /* FIXME: Applies to main_camera directly! */
+   
    assert( player->dev.device );
 
    if( player->dev.device->post_update )
@@ -200,15 +215,6 @@ VG_STATIC void player_post_update( player_interface *player,
       {
          player->dev.device->gate_transport( player, &player->dev, gate );
          v3_copy( player->rb.co, player->prev_position );
-
-         /* 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 );
       }
    }