Fix incorrect tilts

This commit is contained in:
Sally Coolatta 2020-10-28 21:05:58 -04:00
parent ae233b000f
commit 5c23fdda24
3 changed files with 6 additions and 16 deletions

View file

@ -1642,18 +1642,8 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
p.rollflip *= -1;
}
p.anglez = 0.0f;
p.anglex = 0.0f;
if (spr->mobj->pitch)
{
p.anglez = FIXED_TO_FLOAT(-AngleFixed(spr->mobj->pitch));
}
if (spr->mobj->roll)
{
p.anglex = FIXED_TO_FLOAT(AngleFixed(spr->mobj->roll));
}
p.anglez = FIXED_TO_FLOAT(AngleFixed(spr->mobj->pitch));
p.anglex = FIXED_TO_FLOAT(AngleFixed(spr->mobj->roll));
// SRB2CBTODO: MD2 scaling support
finalscale *= FIXED_TO_FLOAT(interp.scale);

View file

@ -2815,9 +2815,9 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, float duration, float
if (hflipped)
scalez = -scalez;
pglRotatef(pos->anglez, 0.0f, 0.0f, -1.0f); // rotate by slope from Kart
pglRotatef(pos->angley, 0.0f, -1.0f, 0.0f);
pglRotatef(pos->anglez, 0.0f, 0.0f, -1.0f);
pglRotatef(pos->anglex, 1.0f, 0.0f, 0.0f);
pglRotatef(pos->angley, 0.0f, -1.0f, 0.0f);
if (pos->roll)
{

View file

@ -1562,8 +1562,8 @@ void P_SetPitchRollFromSlope(mobj_t *mo, pslope_t *slope)
fixed_t tempy = slope->normal.y;
fixed_t tempx = slope->normal.x;
mo->pitch = -R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx);
mo->roll = -R_PointToAngle2(0, 0, tempz, tempy);
mo->pitch = R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx);
mo->roll = R_PointToAngle2(0, 0, tempz, tempy);
}
else
{