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