Do not factor roll and pitch into model rollangle

Those transformations are applied separately so the model
tilts in 3d space.
This commit is contained in:
James R 2021-12-10 00:32:46 -08:00 committed by Sally Coolatta
parent c065029b01
commit 6d9512d290
3 changed files with 8 additions and 7 deletions

View file

@ -1611,7 +1611,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
}
{
fixed_t anglef = AngleFixed(R_SpriteRotationAngle(&interp));
fixed_t anglef = AngleFixed(R_ModelRotationAngle(&interp));
p.rollangle = 0.0f;

View file

@ -39,6 +39,7 @@ patch_t *Patch_GetRotatedSprite(
size_t frame, size_t spriteangle,
boolean flip, boolean adjustfeet,
void *info, INT32 rotationangle);
angle_t R_ModelRotationAngle(interpmobjstate_t *interp);
angle_t R_SpriteRotationAngle(interpmobjstate_t *interp);
INT32 R_GetRollAngle(angle_t rollangle);
#endif

View file

@ -19,11 +19,11 @@
fixed_t rollcosang[ROTANGLES];
fixed_t rollsinang[ROTANGLES];
//
// R_SpriteRotationAngle
//
// Gets the rollangle for the input object.
//
angle_t R_ModelRotationAngle(interpmobjstate_t *interp)
{
return interp->spriteroll;
}
angle_t R_SpriteRotationAngle(interpmobjstate_t *interp)
{
angle_t viewingAngle = R_PointToAngle(interp->x, interp->y);
@ -33,7 +33,7 @@ angle_t R_SpriteRotationAngle(interpmobjstate_t *interp)
angle_t rollOrPitch = FixedMul(interp->pitch, pitchMul) + FixedMul(interp->roll, rollMul);
return (rollOrPitch + interp->spriteroll);
return (rollOrPitch + R_ModelRotationAngle(interp));
}
INT32 R_GetRollAngle(angle_t rollangle)