PxQuatT
Defined in include/foundation/PxQuat.h
-
template<class Type>
class PxQuatT This is a quaternion class.
For more information on quaternion mathematics consult a mathematics source on complex numbers.
Public Functions
-
inline PxQuatT()
Default constructor, does not do any initialization.
-
inline PxQuatT(PxIDENTITY)
identity constructor
-
inline explicit PxQuatT(Type r)
Constructor from a scalar: sets the real part w to the scalar value, and the imaginary parts (x,y,z) to zero.
-
inline PxQuatT(Type nx, Type ny, Type nz, Type nw)
Constructor.
Take note of the order of the elements!
-
inline PxQuatT(Type angleRadians, const PxVec3T<Type> &unitAxis)
Creates from angle-axis representation.
Axis must be normalized!
Angle is in radians!
Unit: Radians
-
inline explicit PxQuatT(const PxMat33T<Type> &m)
Creates from orientation matrix.
- Parameters
m – [in] Rotation matrix to extract quaternion from.
-
inline bool isIdentity() const
returns true if quat is identity
-
inline bool isFinite() const
returns true if all elements are finite (not NAN or INF, etc.)
-
inline bool isUnit() const
returns true if finite and magnitude is close to unit
-
inline bool isSane() const
returns true if finite and magnitude is reasonably close to unit to allow for some accumulation of error vs isValid
-
inline bool operator==(const PxQuatT &q) const
returns true if the two quaternions are exactly equal
-
inline void toRadiansAndUnitAxis(Type &angle, PxVec3T<Type> &axis) const
converts this quaternion to angle-axis representation
-
inline Type getAngle() const
Gets the angle between this quat and the identity quaternion.
Unit: Radians
-
inline Type getAngle(const PxQuatT &q) const
Gets the angle between this quat and the argument.
Unit: Radians
-
inline Type magnitudeSquared() const
This is the squared 4D vector length, should be 1 for unit quaternions.
-
inline const PxVec3T<Type> rotate(const PxVec3T<Type> &v) const
rotates passed vec by this (assumed unitary)
-
inline PxQuatT()