mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +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>
|
||||
|
||||
void RotationAccumulator::add(glm::quat rotation) {
|
||||
// make sure both quaternions are on the same hyper-hemisphere before we add them
|
||||
if (glm::dot(_rotationSum, rotation) < 0.0f) {
|
||||
rotation = -rotation;
|
||||
}
|
||||
// sum the rotation linearly (lerp)
|
||||
_rotationSum += rotation;
|
||||
// make sure both quaternions are on the same hyper-hemisphere before we add them linearly (lerp)
|
||||
_rotationSum += copysignf(1.0f, glm::dot(_rotationSum, rotation)) * rotation;
|
||||
++_numRotations;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue