mirror of
https://github.com/g-truc/glm.git
synced 2025-04-07 14:29:16 +00:00
Merge pull request #691 from OlivierSohn/master
Fix rotation when vectors are in the same direction #691
This commit is contained in:
commit
9d7e79de6e
1 changed files with 4 additions and 2 deletions
|
@ -184,8 +184,10 @@ namespace glm
|
|||
T cosTheta = dot(orig, dest);
|
||||
vec<3, T, Q> rotationAxis;
|
||||
|
||||
if(cosTheta >= static_cast<T>(1) - epsilon<T>())
|
||||
return quat();
|
||||
if(cosTheta >= static_cast<T>(1) - epsilon<T>()) {
|
||||
// orig and dest point in the same direction
|
||||
return quat_identity<T,Q>();
|
||||
}
|
||||
|
||||
if(cosTheta < static_cast<T>(-1) + epsilon<T>())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue