From a3c2f77236d3c10faf7f82190e9c63876b550bd3 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 18 May 2014 20:37:43 -0500 Subject: [PATCH] Fix Gauntlet barrel axis in UI UI's PositionRotatedEntityOnTag is different than CGame's and UI has switched pitch/roll for Gauntlet/BFG axis to get it to look like /close to/ how it looks in CGame. Making UI use the same *PositionRotatedEntityOnTag and axis as CGame fixes the Gauntlet blade being wobbly in controls menu. --- code/q3_ui/ui_players.c | 8 ++------ code/ui/ui_players.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/code/q3_ui/ui_players.c b/code/q3_ui/ui_players.c index ad15fe78..b91073a9 100644 --- a/code/q3_ui/ui_players.c +++ b/code/q3_ui/ui_players.c @@ -332,8 +332,8 @@ static void UI_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_ } // cast away const because of compiler problems - MatrixMultiply( entity->axis, ((refEntity_t *)parent)->axis, tempAxis ); - MatrixMultiply( lerped.axis, tempAxis, entity->axis ); + MatrixMultiply( entity->axis, lerped.axis, tempAxis ); + MatrixMultiply( tempAxis, ((refEntity_t *)parent)->axis, entity->axis ); } @@ -845,10 +845,6 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti angles[YAW] = 0; angles[PITCH] = 0; angles[ROLL] = UI_MachinegunSpinAngle( pi ); - if( pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) { - angles[PITCH] = angles[ROLL]; - angles[ROLL] = 0; - } AnglesToAxis( angles, barrel.axis ); UI_PositionRotatedEntityOnTag( &barrel, &gun, pi->weaponModel, "tag_barrel"); diff --git a/code/ui/ui_players.c b/code/ui/ui_players.c index ee30febc..e6355690 100644 --- a/code/ui/ui_players.c +++ b/code/ui/ui_players.c @@ -333,8 +333,8 @@ static void UI_PositionRotatedEntityOnTag( refEntity_t *entity, const refEntity_ } // cast away const because of compiler problems - MatrixMultiply( entity->axis, ((refEntity_t *)parent)->axis, tempAxis ); - MatrixMultiply( lerped.axis, tempAxis, entity->axis ); + MatrixMultiply( entity->axis, lerped.axis, tempAxis ); + MatrixMultiply( tempAxis, ((refEntity_t *)parent)->axis, entity->axis ); } @@ -845,10 +845,6 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti angles[YAW] = 0; angles[PITCH] = 0; angles[ROLL] = UI_MachinegunSpinAngle( pi ); - if( pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) { - angles[PITCH] = angles[ROLL]; - angles[ROLL] = 0; - } AnglesToAxis( angles, barrel.axis ); UI_PositionRotatedEntityOnTag( &barrel, &gun, pi->weaponModel, "tag_barrel");