mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 19:23:28 +02:00
Merge pull request #6700 from AndrewMeadows/angular-velocity-is-a-vector
protect against NaN in measure of hydra angularVelocity
This commit is contained in:
commit
bfa0652100
1 changed files with 2 additions and 1 deletions
|
@ -466,9 +466,10 @@ void SixenseManager::InputDevice::handlePoseEvent(float deltaTime, glm::vec3 pos
|
|||
samples.first.addSample(velocity);
|
||||
velocity = samples.first.average;
|
||||
|
||||
auto deltaRot = rotation * glm::conjugate(prevPose.getRotation());
|
||||
auto deltaRot = glm::normalize(rotation * glm::conjugate(prevPose.getRotation()));
|
||||
auto axis = glm::axis(deltaRot);
|
||||
auto speed = glm::angle(deltaRot) / deltaTime;
|
||||
assert(!glm::isnan(speed));
|
||||
angularVelocity = speed * axis;
|
||||
samples.second.addSample(angularVelocity);
|
||||
angularVelocity = samples.second.average;
|
||||
|
|
Loading…
Reference in a new issue