Fixed lack of consistency of quat and dualquat constructors

master
Christophe Riccio ago%!(EXTRA string=11 years)
parent 284ba46dae
commit e6a890454d
  1. 19
      glm/gtx/dual_quaternion.hpp
  2. 38
      glm/gtx/dual_quaternion.inl
  3. 1
      readme.txt

@ -57,7 +57,7 @@ namespace glm
template <typename T, precision P>
struct tdualquat
{
enum ctor{null};
enum ctor{_null};
typedef T value_type;
typedef glm::tquat<T, P> part_type;
@ -72,14 +72,25 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
#endif//GLM_FORCE_SIZE_FUNC
// Constructors
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_DECL tdualquat();
GLM_FUNC_DECL tdualquat(tdualquat<T, P> const & d);
template <precision Q>
GLM_FUNC_DECL tdualquat(tdualquat<T, Q> const & d);
//////////////////////////////////////
// Explicit basic constructors
GLM_FUNC_DECL explicit tdualquat(ctor);
GLM_FUNC_DECL explicit tdualquat(tquat<T, P> const & real);
GLM_FUNC_DECL tdualquat(tquat<T, P> const & real,tquat<T, P> const & dual);
GLM_FUNC_DECL tdualquat(tquat<T, P> const & orientation,tvec3<T, P> const& translation);
GLM_FUNC_DECL tdualquat(tquat<T, P> const & orientation, tvec3<T, P> const & translation);
GLM_FUNC_DECL tdualquat(tquat<T, P> const & real, tquat<T, P> const & dual);
//////////////////////////////////////////////////////////////
// tdualquat conversions
GLM_FUNC_DECL explicit tdualquat(tmat2x4<T, P> const & holder_mat);
GLM_FUNC_DECL explicit tdualquat(tmat3x4<T, P> const & aug_mat);

@ -54,20 +54,36 @@ namespace glm
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat
(
tquat<T, P> const & r
tdualquat<T, P> const & d,
) :
real(r),
dual(tquat<T, P>(T(0), T(0), T(0), T(0)))
real(d.r),
dual(d.d)
{}
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat
(
tquat<T, P> const & r,
tquat<T, P> const & d
tdualquat<T, Q> const & d,
) :
real(d.r),
dual(d.d)
{}
//////////////////////////////////////
// Explicit basic constructors
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat
(
tquat<T, P> const & r
) :
real(r),
dual(d)
dual(tquat<T, P>(T(0), T(0), T(0), T(0)))
{}
template <typename T, precision P>
@ -84,6 +100,16 @@ namespace glm
T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w))
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P>::tdualquat
(
tquat<T, P> const & r,
tquat<T, P> const & d
) :
real(r),
dual(d)
{}
//////////////////////////////////////////////////////////////
// tdualquat conversions
template <typename T, precision P>

@ -64,6 +64,7 @@ GLM 0.9.6.0: 2014-XX-XX
- Fixed GTX_string_cast to support for integer types #249
- Removed GLM_FORCE_CUDA, Cuda is implicitly detected
- Updated GTX_associated_min_max with vec1 support
- Fixed lack of consistency of quat and dualquat constructors
================================================================================
GLM 0.9.5.4: 2014-06-21

Loading…
Cancel
Save