Avoid rotating by zero in CharacterController

pull/141/head
scrawl 8 years ago
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…
Cancel
Save