29#ifndef __DualQuaternion_H__
30#define __DualQuaternion_H__
59 :
w(fW),
x(fX),
y(fY),
z(fZ),
dw(fdW),
dx(fdX),
dy(fdY),
dz(fdZ)
78 memcpy(&
w, valptr,
sizeof(
Real)*8);
82 inline Real operator [] (
const size_t i )
const
90 inline Real& operator [] (
const size_t i )
113 return (rhs.
w ==
w) && (rhs.
x ==
x) && (rhs.
y ==
y) && (rhs.
z ==
z) &&
175 o <<
"DualQuaternion(" << q.w <<
", " << q.x <<
", " << q.y <<
", " << q.z <<
", " << q.dw <<
", " << q.dx <<
", " << q.dy <<
", " << q.dz <<
")";
bool operator==(const DualQuaternion &rhs) const
DualQuaternion(const Quaternion &q, const Vector3 &trans)
Construct a dual quaternion from a unit quaternion and a translation vector.
DualQuaternion(Real *valptr)
Construct a dual quaternion from 8 manual w/x/y/z/dw/dx/dy/dz values.
DualQuaternion(const Matrix4 &rot)
Construct a dual quaternion from a transformation matrix.
void fromTransformationMatrix(const Matrix4 &kTrans)
Construct a dual quaternion from a 4x4 transformation matrix.
void swap(DualQuaternion &other)
Exchange the contents of this dual quaternion with another.
DualQuaternion()
Default constructor, initializes to identity rotation (aka 0°), and zero translation (0,...
bool isNaN() const
Check whether this dual quaternion contains valid values.
DualQuaternion(Real fW, Real fX, Real fY, Real fZ, Real fdW, Real fdX, Real fdY, Real fdZ)
Construct from an explicit list of values.
void toRotationTranslation(Quaternion &q, Vector3 &translation) const
Convert a dual quaternion into its two components, a Quaternion representing the rotation and a Vecto...
Real * ptr()
Pointer accessor for direct copying.
const Real * ptr() const
Pointer accessor for direct copying.
void toTransformationMatrix(Matrix4 &kTrans) const
Convert a dual quaternion to a 4x4 transformation matrix.
void fromRotationTranslation(const Quaternion &q, const Vector3 &trans)
Construct a dual quaternion from a rotation described by a Quaternion and a translation described by ...
static bool isNaN(Real f)
Class encapsulating a standard 4x4 homogeneous matrix.
Implementation of a Quaternion, i.e.
Standard 3-dimensional vector.
float Real
Software floating point type.
void swap(Ogre::SmallVectorImpl< T > &LHS, Ogre::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.