mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-27 16:18:46 +02:00
Fix inaccurate delta rotation axis
This commit is contained in:
parent
01c4b57d11
commit
b2e02e20cc
1 changed files with 2 additions and 1 deletions
|
@ -269,7 +269,8 @@ void CharacterController::playerStep(btCollisionWorld* collisionWorld, btScalar
|
||||||
}
|
}
|
||||||
btQuaternion deltaRot = desiredRot * startRot.inverse();
|
btQuaternion deltaRot = desiredRot * startRot.inverse();
|
||||||
float angularSpeed = deltaRot.getAngle() / _followTimeRemaining;
|
float angularSpeed = deltaRot.getAngle() / _followTimeRemaining;
|
||||||
btQuaternion angularDisplacement = btQuaternion(deltaRot.getAxis(), angularSpeed * dt);
|
glm::vec3 rotationAxis = glm::normalize(glm::axis(bulletToGLM(deltaRot))); // deltaRot.getAxis() is inaccurate
|
||||||
|
btQuaternion angularDisplacement = btQuaternion(glmToBullet(rotationAxis), angularSpeed * dt);
|
||||||
btQuaternion endRot = angularDisplacement * startRot;
|
btQuaternion endRot = angularDisplacement * startRot;
|
||||||
|
|
||||||
// in order to accumulate displacement of avatar position, we need to take _shapeLocalOffset into account.
|
// in order to accumulate displacement of avatar position, we need to take _shapeLocalOffset into account.
|
||||||
|
|
Loading…
Reference in a new issue