summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2001-01-04 05:37:23 +0000
committerTim Angus <tim@ngus.net>2001-01-04 05:37:23 +0000
commitae51d659752ca314460b1e7f1bd4d4d58f2f7afc (patch)
treed8d77acaa42bbf428565a4c83abf72da88cea82e /src/game
parent7cc6c9cbe613b7022ad3b5ae1a8a9bd7811e5e6a (diff)
YAY! wall walking inversion bug fix
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_pmove.c28
1 files changed, 6 insertions, 22 deletions
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 );