mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Merge branch '0.9.2' into 0.9.3
This commit is contained in:
commit
b71547aeb8
@ -21,12 +21,11 @@
|
||||
# pragma message("GLM: GLM_GTX_rotate_vector extension included")
|
||||
#endif
|
||||
|
||||
namespace glm
|
||||
namespace glm{
|
||||
namespace gtx{
|
||||
//! GLM_GTX_rotate_vector extension: Function to directly rotate a vector
|
||||
namespace rotate_vector
|
||||
{
|
||||
namespace gtx{
|
||||
//! GLM_GTX_rotate_vector extension: Function to directly rotate a vector
|
||||
namespace rotate_vector
|
||||
{
|
||||
using namespace transform;
|
||||
|
||||
/// \addtogroup gtx_rotate_vector
|
||||
@ -73,41 +72,41 @@ namespace glm
|
||||
//! From GLM_GTX_rotate_vector extension.
|
||||
template <typename T>
|
||||
detail::tvec3<T> rotateZ(
|
||||
const detail::tvec3<T>& v,
|
||||
T angle);
|
||||
detail::tvec3<T> const & v,
|
||||
T const & angle);
|
||||
|
||||
//! Rotate a four dimentionnals vector around the X axis.
|
||||
//! From GLM_GTX_rotate_vector extension.
|
||||
template <typename T>
|
||||
detail::tvec4<T> rotateX(
|
||||
const detail::tvec4<T>& v,
|
||||
T angle);
|
||||
detail::tvec4<T> const & v,
|
||||
T const & angle);
|
||||
|
||||
//! Rotate a four dimensional vector around the X axis.
|
||||
//! From GLM_GTX_rotate_vector extension.
|
||||
template <typename T>
|
||||
detail::tvec4<T> rotateY(
|
||||
const detail::tvec4<T>& v,
|
||||
T angle);
|
||||
detail::tvec4<T> const & v,
|
||||
T const & angle);
|
||||
|
||||
//! Rotate a four dimensional vector around the X axis.
|
||||
//! From GLM_GTX_rotate_vector extension.
|
||||
template <typename T>
|
||||
detail::tvec4<T> rotateZ(
|
||||
const detail::tvec4<T>& v,
|
||||
T angle);
|
||||
detail::tvec4<T> const & v,
|
||||
T const & angle);
|
||||
|
||||
//! Build a rotation matrix from a normal and a up vector.
|
||||
//! From GLM_GTX_rotate_vector extension.
|
||||
template <typename T>
|
||||
detail::tmat4x4<T> orientation(
|
||||
const detail::tvec3<T>& Normal,
|
||||
const detail::tvec3<T>& Up);
|
||||
detail::tvec3<T> const & Normal,
|
||||
detail::tvec3<T> const & Up);
|
||||
|
||||
///@}
|
||||
|
||||
}//namespace rotate_vector
|
||||
}//namespace gtx
|
||||
}//namespace rotate_vector
|
||||
}//namespace gtx
|
||||
}//namespace glm
|
||||
|
||||
#include "rotate_vector.inl"
|
||||
|
@ -13,8 +13,8 @@ namespace rotate_vector
|
||||
{
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<T> rotate(
|
||||
const detail::tvec2<T>& v,
|
||||
T angle)
|
||||
detail::tvec2<T> const & v,
|
||||
T const & angle)
|
||||
{
|
||||
detail::tvec2<T> Result;
|
||||
const T Cos = cos(radians(angle));
|
||||
@ -26,14 +26,18 @@ namespace rotate_vector
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> rotate(
|
||||
const detail::tvec3<T>& v, T angle,
|
||||
const detail::tvec3<T>& normal)
|
||||
const detail::tvec3<T> & v,
|
||||
T const & angle,
|
||||
const detail::tvec3<T> & normal)
|
||||
{
|
||||
return detail::tmat3x3<T>(transform::rotate(angle, normal)) * v;
|
||||
return detail::tmat3x3<T>(glm::gtx::transform::rotate(angle, normal)) * v;
|
||||
}
|
||||
/*
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> rotateGTX(const detail::tvec3<T>& x, T angle, const detail::tvec3<T>& normal)
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> rotateGTX(
|
||||
const detail::tvec3<T>& x,
|
||||
T angle,
|
||||
const detail::tvec3<T>& normal)
|
||||
{
|
||||
const T Cos = cos(radians(angle));
|
||||
const T Sin = sin(radians(angle));
|
||||
@ -42,17 +46,17 @@ namespace rotate_vector
|
||||
*/
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T> rotate(
|
||||
const detail::tvec4<T>& v,
|
||||
T angle,
|
||||
const detail::tvec3<T>& normal)
|
||||
detail::tvec4<T> const & v,
|
||||
T const & angle,
|
||||
detail::tvec3<T> const & normal)
|
||||
{
|
||||
return transform::rotate(angle, normal) * v;
|
||||
return glm::gtx::transform::::rotate(angle, normal) * v;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> rotateX(
|
||||
const detail::tvec3<T>& v,
|
||||
T angle)
|
||||
detail::tvec3<T> const & v,
|
||||
T const & angle)
|
||||
{
|
||||
detail::tvec3<T> Result = v;
|
||||
const T Cos = cos(radians(angle));
|
||||
@ -64,8 +68,8 @@ namespace rotate_vector
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> rotateY(
|
||||
const detail::tvec3<T>& v,
|
||||
T angle)
|
||||
detail::tvec3<T> const & v,
|
||||
T const & angle)
|
||||
{
|
||||
detail::tvec3<T> Result = v;
|
||||
const T Cos = cos(radians(angle));
|
||||
@ -77,8 +81,8 @@ namespace rotate_vector
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<T> rotateZ(
|
||||
const detail::tvec3<T>& v,
|
||||
T angle)
|
||||
detail::tvec3<T> const & v,
|
||||
T const & angle)
|
||||
{
|
||||
detail::tvec3<T> Result = v;
|
||||
const T Cos = cos(radians(angle));
|
||||
@ -90,8 +94,8 @@ namespace rotate_vector
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T> rotateX(
|
||||
const detail::tvec4<T>& v,
|
||||
T angle)
|
||||
detail::tvec4<T> const & v,
|
||||
T const & angle)
|
||||
{
|
||||
detail::tvec4<T> Result = v;
|
||||
const T Cos = cos(radians(angle));
|
||||
@ -103,8 +107,8 @@ namespace rotate_vector
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T> rotateY(
|
||||
const detail::tvec4<T>& v,
|
||||
T angle)
|
||||
detail::tvec4<T> const & v,
|
||||
T const & angle)
|
||||
{
|
||||
detail::tvec4<T> Result = v;
|
||||
const T Cos = cos(radians(angle));
|
||||
@ -116,8 +120,8 @@ namespace rotate_vector
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<T> rotateZ(
|
||||
const detail::tvec4<T>& v,
|
||||
T angle)
|
||||
detail::tvec4<T> const & v,
|
||||
T const & angle)
|
||||
{
|
||||
detail::tvec4<T> Result = v;
|
||||
const T Cos = cos(radians(angle));
|
||||
@ -129,8 +133,8 @@ namespace rotate_vector
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER detail::tmat4x4<T> orientation(
|
||||
const detail::tvec3<T>& Normal,
|
||||
const detail::tvec3<T>& Up)
|
||||
detail::tvec3<T> const & Normal,
|
||||
detail::tvec3<T> const & Up)
|
||||
{
|
||||
if(all(equal(Normal, Up)))
|
||||
return detail::tmat4x4<T>(T(1));
|
||||
|
Loading…
Reference in New Issue
Block a user