mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-25 12:05:53 +00:00
GRIM: Fix angles handling in keyframe animations.
This commit is contained in:
parent
ba10e07422
commit
3e08fb915b
@ -1074,6 +1074,7 @@ void Actor::update(float frameTime) {
|
||||
if (_turning) {
|
||||
float turnAmt = g_grim->getPerSecond(_turnRate) * 5.f;
|
||||
Math::Angle dyaw = _destYaw - _yaw;
|
||||
dyaw.normalize(-180);
|
||||
// If the actor won't turn because the rate is set to zero then
|
||||
// have the actor turn all the way to the destination yaw.
|
||||
// Without this some actors will lock the interface on changing
|
||||
|
@ -69,7 +69,7 @@ void Animation::play(RepeatMode repeatMode) {
|
||||
void Animation::fade(FadeMode fadeMode, int fadeLength) {
|
||||
if (!_active) {
|
||||
if (fadeMode == FadeIn) {
|
||||
_repeatMode = Once;
|
||||
_repeatMode = Once;//FadeAtEnd;
|
||||
_time = -1;
|
||||
_fade = 0.f;
|
||||
_paused = false;
|
||||
|
@ -273,13 +273,13 @@ bool KeyframeAnim::KeyframeNode::animate(ModelNode &node, float frame, float fad
|
||||
node._animPos += (pos - node._pos) * fade;
|
||||
|
||||
Math::Angle dpitch = pitch - node._pitch;
|
||||
node._animPitch += dpitch * fade;
|
||||
node._animPitch += dpitch.normalize(-180) * fade;
|
||||
|
||||
Math::Angle dyaw = yaw - node._yaw;
|
||||
node._animYaw += dyaw * fade;
|
||||
node._animYaw += dyaw.normalize(-180) * fade;
|
||||
|
||||
Math::Angle droll = roll - node._roll;
|
||||
node._animRoll += droll * fade;
|
||||
node._animRoll += droll.normalize(-180) * fade;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user