From ae51d659752ca314460b1e7f1bd4d4d58f2f7afc Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Thu, 4 Jan 2001 05:37:23 +0000 Subject: YAY! wall walking inversion bug fix --- src/game/bg_pmove.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index e7be5798..5d17b0be 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2471,11 +2471,6 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) { tempang[i] = SHORT2ANGLE( temp[i] ); } - /*Com_Printf( "%1.2f ", ps->grapplePoint[ 0 ] ); - Com_Printf( "%1.2f ", ps->grapplePoint[ 1 ] ); - Com_Printf( "%1.2f ", ps->grapplePoint[ 2 ] ); - Com_Printf( "\n" );*/ - //convert viewangles -> axis AnglesToAxis( tempang, axis ); @@ -2489,15 +2484,7 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) { { //cross the reference normal and the surface normal to get the rotation axis VectorCopy( ps->grapplePoint, surfNormal ); - if( surfNormal[2] <= 0 ) - { - CrossProduct( refNormal, surfNormal, xNormal ); - } - else - { - CrossProduct( surfNormal, refNormal, xNormal ); - } - + CrossProduct( surfNormal, refNormal, xNormal ); VectorNormalize( xNormal ); } @@ -2509,15 +2496,12 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) { //if the normal pointing straight down then the rotAngle will always be 180deg if( surfNormal[2] == -1 ) rotAngle = 180; - /*else if( abs( RAD2DEG( arccos( DotProduct( ps->grapplePoint, surfNormal ) ) ) ) <= 90 ) - { - //WEIRD-BUG_WORKAROUND: - //for some reason surface normals on curves in a specfic quadrant are inverted.. dunno why - VectorInverse( surfNormal ); - rotAngle = -RAD2DEG( arccos( DotProduct( surfNormal, refNormal ) ) ); - }*/ else - rotAngle = -RAD2DEG( arccos( DotProduct( surfNormal, refNormal ) ) ); + rotAngle = RAD2DEG( arccos( DotProduct( surfNormal, refNormal ) ) ); + + //-abs( rotAngle ).. sorta + if( rotAngle > 0 ) + rotAngle -= rotAngle*2; //hmmm could get away with only one rotation and some clever stuff later... but i'm lazy RotatePointAroundVector( rotaxis[0], xNormal, axis[0], rotAngle ); -- cgit