mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 17:05:07 +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
|
const float EPSILON_ANGULAR_VELOCITY_LENGTH = 0.0017453f; // ~0.1 degree/sec
|
||||||
if (angularSpeed < EPSILON_ANGULAR_VELOCITY_LENGTH) {
|
if (angularSpeed < EPSILON_ANGULAR_VELOCITY_LENGTH) {
|
||||||
setAngularVelocity(NO_ANGULAR_VELOCITY);
|
angularVelocity = NO_ANGULAR_VELOCITY;
|
||||||
} else {
|
} else {
|
||||||
float angle = timeElapsed * angularSpeed;
|
float angle = timeElapsed * angularSpeed;
|
||||||
glm::quat dQ = glm::angleAxis(angle, glm::normalize(angularVelocity));
|
glm::quat dQ = glm::angleAxis(angle, glm::normalize(angularVelocity));
|
||||||
rotation = glm::normalize(dQ * rotation);
|
rotation = glm::normalize(dQ * rotation);
|
||||||
setRotation(rotation);
|
setRotation(rotation);
|
||||||
}
|
}
|
||||||
|
setAngularVelocity(angularVelocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_BULLET_PHYSICS
|
#ifdef USE_BULLET_PHYSICS
|
||||||
|
|
Loading…
Reference in a new issue