Skip to content

Commit

Permalink
Fix Gauntlet barrel axis in UI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zturtleman committed May 19, 2014
1 parent daa570c commit a3c2f77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions code/q3_ui/ui_players.c
Expand Up @@ -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 );
}


Expand Down Expand Up @@ -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");
Expand Down
8 changes: 2 additions & 6 deletions code/ui/ui_players.c
Expand Up @@ -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 );
}


Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit a3c2f77

Please sign in to comment.