mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Avoid rotating by zero in CharacterController
This commit is contained in:
parent
7201cf5fe2
commit
1eb3384043
@ -1872,10 +1872,14 @@ void CharacterController::update(float duration)
|
||||
{
|
||||
if(mHitState != CharState_KnockDown && mHitState != CharState_KnockOut)
|
||||
{
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), rot.z(), true);
|
||||
if (rot != osg::Vec3f())
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), rot.z(), true);
|
||||
}
|
||||
else //avoid z-rotating for knockdown
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), 0.0f, true);
|
||||
{
|
||||
if (rot.x() != 0 && rot.y() != 0)
|
||||
world->rotateObject(mPtr, rot.x(), rot.y(), 0.0f, true);
|
||||
}
|
||||
|
||||
if (!mMovementAnimationControlled)
|
||||
world->queueMovement(mPtr, vec);
|
||||
|
Loading…
x
Reference in New Issue
Block a user