mirror of
https://github.com/JulianGro/overte.git
synced 2025-06-02 11:20:21 +02:00
Merge pull request #13548 from luiscuenca/slantedAvatarFix
Fix avatar become more and more slanted over time while in HMD mode
This commit is contained in:
commit
a97d4f655a
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