mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Merge pull request #275 from plasmacel/master
add explicit matrix conversion operators to quat #275
This commit is contained in:
commit
3c0b3c4009
@ -103,6 +103,10 @@ namespace glm
|
||||
GLM_FUNC_DECL tquat(tquat<U, Q> const & q);
|
||||
# endif
|
||||
|
||||
// explicit conversion operators
|
||||
GLM_FUNC_DECL explicit operator tmat3x3<T, P>();
|
||||
GLM_FUNC_DECL explicit operator tmat4x4<T, P>();
|
||||
|
||||
/// Create a quaternion from two normalized axis
|
||||
///
|
||||
/// @param u A first normalized axis
|
||||
|
@ -173,6 +173,18 @@ namespace detail
|
||||
*this = quat_cast(m);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat3x3<T, P>()
|
||||
{
|
||||
return mat3_cast(*this);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P>::operator tmat4x4<T, P>()
|
||||
{
|
||||
return mat4_cast(*this);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const & q)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user