Merge branch '0.9.2' into 0.9.3

This commit is contained in:
Christophe Riccio 2011-05-17 01:29:19 +01:00
commit cda930bb7a
3 changed files with 2 additions and 39 deletions

View File

@ -50,7 +50,7 @@ namespace rotate_vector
T const & angle,
detail::tvec3<T> const & normal)
{
return glm::gtx::transform::::rotate(angle, normal) * v;
return glm::gtx::transform::rotate(angle, normal) * v;
}
template <typename T>
@ -141,7 +141,7 @@ namespace rotate_vector
detail::tvec3<T> RotationAxis = cross(Up, Normal);
T Angle = degrees(acos(dot(Normal, Up)));
return rotate(Angle, RotationAxis);
return glm::gtx::transform::rotate(Angle, RotationAxis);
}
}//namespace rotate_vector

View File

@ -55,22 +55,6 @@ GLM_FUNC_QUALIFIER valType orientedAngle
return Angle;
}
//! \todo epsilon is hard coded to 0.01
template <typename valType>
GLM_FUNC_QUALIFIER valType orientedAngle
(
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y
)
{
valType Angle = degrees(acos(dot(x, y)));
detail::tvec4<valType> TransformedVector = glm::gtx::rotate_vector::rotate(y, Angle, glm::core::function::geometric::cross(x, y));
if(all(equalEpsilon(x, TransformedVector, valType(0.01))))
return -Angle;
else
return Angle;
}
template <typename valType>
GLM_FUNC_QUALIFIER valType orientedAngleFromRef
(
@ -103,22 +87,6 @@ GLM_FUNC_QUALIFIER valType orientedAngleFromRef
return glm::degrees(Angle);
}
template <typename valType>
GLM_FUNC_QUALIFIER valType orientedAngleFromRef
(
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y,
detail::tvec3<valType> const & ref
)
{
valType Angle = glm::acos(glm::dot(x, y));
if(glm::dot(ref, glm::cross(detail::tvec3<valType>(x), detail::tvec3<valType>(y))) < valType(0))
return -glm::degrees(Angle);
else
return glm::degrees(Angle);
}
}//namespace vector_angle
}//namespace gtx
}//namespace glm

View File

@ -38,11 +38,6 @@ int test_vector_angle_orientedAngle()
float AngleD = glm::orientedAngle(glm::vec3(0, 1, 0), glm::normalize(glm::vec3(1, 1, 0)));
Error += AngleD == -45.f ? 0 : 1;
float AngleE = glm::orientedAngle(glm::vec4(1, 0, 0, 0), glm::normalize(glm::vec4(1, 1, 0, 0)));
Error += AngleE == 45.f ? 0 : 1;
float AngleF = glm::orientedAngle(glm::vec4(0, 1, 0, 0), glm::normalize(glm::vec4(1, 1, 0, 0)));
Error += AngleF == -45.f ? 0 : 1;
return Error;
}