mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 18:13:29 +02:00
oops, need to update angularVelocity after damping
This commit is contained in:
parent
bf6b8f9ca7
commit
6fb4e1f622
1 changed files with 2 additions and 1 deletions
|
@ -662,13 +662,14 @@ void EntityItem::simulate(const quint64& now) {
|
|||
|
||||
const float EPSILON_ANGULAR_VELOCITY_LENGTH = 0.0017453f; // ~0.1 degree/sec
|
||||
if (angularSpeed < EPSILON_ANGULAR_VELOCITY_LENGTH) {
|
||||
setAngularVelocity(NO_ANGULAR_VELOCITY);
|
||||
angularVelocity = NO_ANGULAR_VELOCITY;
|
||||
} else {
|
||||
float angle = timeElapsed * angularSpeed;
|
||||
glm::quat dQ = glm::angleAxis(angle, glm::normalize(angularVelocity));
|
||||
rotation = glm::normalize(dQ * rotation);
|
||||
setRotation(rotation);
|
||||
}
|
||||
setAngularVelocity(angularVelocity);
|
||||
}
|
||||
|
||||
#ifdef USE_BULLET_PHYSICS
|
||||
|
|
Loading…
Reference in a new issue