X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_common.c;h=87d90560e2d2ab8fda5ff7ea0cbc98dda82ab0f7;hb=6190deb68aa1c9e92ede62ea05c2a755bf5516de;hp=270f40e5140174179b956f41a515e3cebc3d9ecd;hpb=f48c3935c01da796b7ecb011a42d6576788b7648;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_common.c b/player_common.c index 270f40e..87d9056 100644 --- a/player_common.c +++ b/player_common.c @@ -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