mirror of
https://github.com/g-truc/glm.git
synced 2024-11-25 18:04:34 +00:00
Back ported to GLM 0.9.4 of glm::oriented[angle] not supporting GLM_FORCE_RADIANS #143
This commit is contained in:
parent
15b19a10be
commit
e95993407c
@ -16,7 +16,11 @@ namespace glm
|
|||||||
genType const & y
|
genType const & y
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
#ifdef GLM_FORCE_RADIANS
|
||||||
|
return acos(dot(x, y));
|
||||||
|
#else
|
||||||
return degrees(acos(dot(x, y)));
|
return degrees(acos(dot(x, y)));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \todo epsilon is hard coded to 0.01
|
//! \todo epsilon is hard coded to 0.01
|
||||||
@ -47,7 +51,11 @@ namespace glm
|
|||||||
detail::tvec3<valType> const & ref
|
detail::tvec3<valType> const & ref
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
valType const Angle(glm::degrees(glm::acos(glm::dot(x, y))));
|
#ifdef GLM_FORCE_RADIANS
|
||||||
|
valType const Angle(acos(dot(x, y)));
|
||||||
|
#else
|
||||||
|
valType const Angle(glm::degrees(acos(dot(x, y))));
|
||||||
|
#endif
|
||||||
|
|
||||||
if(glm::dot(ref, glm::cross(x, y)) < valType(0))
|
if(glm::dot(ref, glm::cross(x, y)) < valType(0))
|
||||||
return -Angle;
|
return -Angle;
|
||||||
|
Loading…
Reference in New Issue
Block a user