Fix rotation when vectors are in the same direction #690
This commit is contained in:
parent
7733266417
commit
6f61bb4d2e
@ -184,8 +184,10 @@ namespace glm
|
|||||||
T cosTheta = dot(orig, dest);
|
T cosTheta = dot(orig, dest);
|
||||||
vec<3, T, Q> rotationAxis;
|
vec<3, T, Q> rotationAxis;
|
||||||
|
|
||||||
if(cosTheta >= static_cast<T>(1) - epsilon<T>())
|
if(cosTheta >= static_cast<T>(1) - epsilon<T>()) {
|
||||||
return quat();
|
// orig and dest point in the same direction : return identity quaternion.
|
||||||
|
return quat(1, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if(cosTheta < static_cast<T>(-1) + epsilon<T>())
|
if(cosTheta < static_cast<T>(-1) + epsilon<T>())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user