mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
premature optimization: remove another branch
This commit is contained in:
parent
a85afb5280
commit
4cb2249cda
1 changed files with 2 additions and 6 deletions
|
@ -12,12 +12,8 @@
|
||||||
#include <glm/gtx/quaternion.hpp>
|
#include <glm/gtx/quaternion.hpp>
|
||||||
|
|
||||||
void RotationAccumulator::add(glm::quat rotation) {
|
void RotationAccumulator::add(glm::quat rotation) {
|
||||||
// make sure both quaternions are on the same hyper-hemisphere before we add them
|
// make sure both quaternions are on the same hyper-hemisphere before we add them linearly (lerp)
|
||||||
if (glm::dot(_rotationSum, rotation) < 0.0f) {
|
_rotationSum += copysignf(1.0f, glm::dot(_rotationSum, rotation)) * rotation;
|
||||||
rotation = -rotation;
|
|
||||||
}
|
|
||||||
// sum the rotation linearly (lerp)
|
|
||||||
_rotationSum += rotation;
|
|
||||||
++_numRotations;
|
++_numRotations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue