now fall in immobile mode
[carveJwlIkooP6JGAAIwe30JlM.git] / player_common.c
index 270f40e5140174179b956f41a515e3cebc3d9ecd..87d90560e2d2ab8fda5ff7ea0cbc98dda82ab0f7 100644 (file)
@@ -40,8 +40,10 @@ VG_STATIC void player_camera_portal_correction( player_instance *player )
       q_mulv( player->gate_waiting->q[1], (v3f){0.0f,0.0f,1.0f}, plane );
       plane[3] = v3_dot( plane, player->gate_waiting->co[1] );
 
+      f32 pol = v3_dot( player->cam.pos, plane ) - plane[3];
+
       /* check camera polarity */
-      if( v3_dot( player->cam.pos, plane ) < plane[3] ) {
+      if( (pol < 0.0f) || (pol > 5.0f) ) {
          vg_success( "Plane cleared\n" );
          player_apply_transport_to_cam( player->gate_waiting->transport );
          player->gate_waiting = NULL;
@@ -201,11 +203,13 @@ VG_STATIC void player__cam_iterate( player_instance *player ){
    v3_muladds( tpv_offset, cc->cam_velocity_smooth, -0.025f, tpv_offset );
 
    v3_add( tpv_origin, tpv_offset, tpv_pos );
+#if 0
    f32 t; v3f n;
    if( spherecast_world( world_current_instance(), tpv_origin, tpv_pos, 
                          0.2f, &t, n ) != -1 ){
       v3_lerp( tpv_origin, tpv_pos, t, tpv_pos );
    }
+#endif
 
    /* 
     * Blend cameras