- addressed: MDL_INHERITACTORPITCH got the direction of the rotation wrong. Fixed by deprecating this flag (and also MDL_INHERITACTORROLL) and introducing proper flags, named MDL_USE*. This not only resolves the issue but also elimintates the nonsensical INHERIT part of the names.

This commit is contained in:
Christoph Oelckers 2016-07-16 09:10:18 +02:00
parent f4b80a451e
commit bc7b439dd0
2 changed files with 21 additions and 7 deletions

View file

@ -616,11 +616,19 @@ void gl_InitModels()
} }
else if (sc.Compare("inheritactorpitch")) else if (sc.Compare("inheritactorpitch"))
{ {
smf.flags |= MDL_INHERITACTORPITCH; smf.flags |= MDL_USEACTORPITCH | MDL_BADROTATION;
} }
else if (sc.Compare("inheritactorroll")) else if (sc.Compare("inheritactorroll"))
{ {
smf.flags |= MDL_INHERITACTORROLL; smf.flags |= MDL_USEACTORROLL;
}
else if (sc.Compare("useactorpitch"))
{
smf.flags |= MDL_USEACTORPITCH;
}
else if (sc.Compare("useactorroll"))
{
smf.flags |= MDL_USEACTORROLL;
} }
else if (sc.Compare("rotating")) else if (sc.Compare("rotating"))
{ {
@ -961,10 +969,15 @@ void gl_RenderModel(GLSprite * spr)
rotateOffset = float((time - xs_FloorToInt(time)) *360.f ); rotateOffset = float((time - xs_FloorToInt(time)) *360.f );
} }
// Added MDL_INHERITACTORPITCH and MDL_INHERITACTORROLL flags processing. // Added MDL_USEACTORPITCH and MDL_USEACTORROLL flags processing.
// If both flags MDL_INHERITACTORPITCH and MDL_PITCHFROMMOMENTUM are set, the pitch sums up the actor pitch and the momentum vector pitch. // If both flags MDL_USEACTORPITCH and MDL_PITCHFROMMOMENTUM are set, the pitch sums up the actor pitch and the momentum vector pitch.
if(smf->flags & MDL_INHERITACTORPITCH) pitch -= spr->actor->Angles.Pitch.Degrees; if (smf->flags & MDL_USEACTORPITCH)
if(smf->flags & MDL_INHERITACTORROLL) roll += spr->actor->Angles.Roll.Degrees; {
double d = spr->actor->Angles.Pitch.Degrees;
if (smf->flags & MDL_BADROTATION) pitch -= d;
else pitch += d;
}
if(smf->flags & MDL_USEACTORROLL) roll += spr->actor->Angles.Roll.Degrees;
gl_RenderState.mModelMatrix.loadIdentity(); gl_RenderState.mModelMatrix.loadIdentity();

View file

@ -339,7 +339,8 @@ enum
MDL_INTERPOLATEDOUBLEDFRAMES = 8, MDL_INTERPOLATEDOUBLEDFRAMES = 8,
MDL_NOINTERPOLATION = 16, MDL_NOINTERPOLATION = 16,
MDL_INHERITACTORPITCH = 32, MDL_INHERITACTORPITCH = 32,
MDL_INHERITACTORROLL = 64, // useless for now MDL_INHERITACTORROLL = 64,
MDL_BADROTATION = 128,
}; };
struct FSpriteModelFrame struct FSpriteModelFrame