RavEngine
Loading...
Searching...
No Matches
physx::PxQuatT< Type > Class Template Reference

This is a quaternion class. For more information on quaternion mathematics consult a mathematics source on complex numbers. More...

#include <PxQuat.h>

Public Member Functions

PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT ()
 Default constructor, does not do any initialization.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT (PxIDENTITY)
 identity constructor
 
PX_CUDA_CALLABLE PX_FORCE_INLINE 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.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT (Type nx, Type ny, Type nz, Type nw)
 Constructor. Take note of the order of the elements!
 
PX_CUDA_CALLABLE PX_INLINE PxQuatT (Type angleRadians, const PxVec3T< Type > &unitAxis)
 Creates from angle-axis representation.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT (const PxQuatT &v)
 Copy ctor.
 
PX_CUDA_CALLABLE PX_INLINE PxQuatT (const PxMat33T< Type > &m)
 Creates from orientation matrix.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isIdentity () const
 returns true if quat is identity
 
PX_CUDA_CALLABLE bool isFinite () const
 returns true if all elements are finite (not NAN or INF, etc.)
 
PX_CUDA_CALLABLE bool isUnit () const
 returns true if finite and magnitude is close to unit
 
PX_CUDA_CALLABLE bool isSane () const
 returns true if finite and magnitude is reasonably close to unit to allow for some accumulation of error vs isValid
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool operator== (const PxQuatT &q) const
 returns true if the two quaternions are exactly equal
 
PX_CUDA_CALLABLE PX_INLINE void toRadiansAndUnitAxis (Type &angle, PxVec3T< Type > &axis) const
 converts this quaternion to angle-axis representation
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type getAngle () const
 Gets the angle between this quat and the identity quaternion.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type getAngle (const PxQuatT &q) const
 Gets the angle between this quat and the argument.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type magnitudeSquared () const
 This is the squared 4D vector length, should be 1 for unit quaternions.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type dot (const PxQuatT &v) const
 returns the scalar product of this and other.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT getNormalized () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type magnitude () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type normalize ()
 maps to the closest unit quaternion.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT getConjugate () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T< Type > getImaginaryPart () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T< Type > getBasisVector0 () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T< Type > getBasisVector1 () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T< Type > getBasisVector2 () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3T< Type > rotate (const PxVec3T< Type > &v) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3T< Type > rotateInv (const PxVec3T< Type > &v) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT & operator= (const PxQuatT &p)
 Assignment operator.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT & operator*= (const PxQuatT &q)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT & operator+= (const PxQuatT &q)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT & operator-= (const PxQuatT &q)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT & operator*= (const Type s)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT operator* (const PxQuatT &q) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT operator+ (const PxQuatT &q) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT operator- () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT operator- (const PxQuatT &q) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT operator* (Type r) const
 

Public Attributes

Type x
 
Type y
 
Type z
 
Type w
 

Detailed Description

template<class Type>
class physx::PxQuatT< Type >

This is a quaternion class. For more information on quaternion mathematics consult a mathematics source on complex numbers.

Constructor & Destructor Documentation

◆ PxQuatT() [1/2]

template<class Type >
PX_CUDA_CALLABLE PX_INLINE physx::PxQuatT< Type >::PxQuatT ( Type  angleRadians,
const PxVec3T< Type > &  unitAxis 
)
inline

Creates from angle-axis representation.

Axis must be normalized!

Angle is in radians!

Unit: Radians

◆ PxQuatT() [2/2]

template<class Type >
PX_CUDA_CALLABLE PX_INLINE physx::PxQuatT< Type >::PxQuatT ( const PxMat33T< Type > &  m)
explicit

Creates from orientation matrix.

Parameters
[in]mRotation matrix to extract quaternion from.

Member Function Documentation

◆ getAngle() [1/2]

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE Type physx::PxQuatT< Type >::getAngle ( ) const
inline

Gets the angle between this quat and the identity quaternion.

Unit: Radians

◆ getAngle() [2/2]

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE Type physx::PxQuatT< Type >::getAngle ( const PxQuatT< Type > &  q) const
inline

Gets the angle between this quat and the argument.

Unit: Radians

◆ getBasisVector0()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T< Type > physx::PxQuatT< Type >::getBasisVector0 ( ) const
inline

brief computes rotation of x-axis

◆ getBasisVector1()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T< Type > physx::PxQuatT< Type >::getBasisVector1 ( ) const
inline

brief computes rotation of y-axis

◆ getBasisVector2()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T< Type > physx::PxQuatT< Type >::getBasisVector2 ( ) const
inline

brief computes rotation of z-axis

◆ operator*()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT physx::PxQuatT< Type >::operator* ( const PxQuatT< Type > &  q) const
inline

quaternion multiplication

◆ operator+()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT physx::PxQuatT< Type >::operator+ ( const PxQuatT< Type > &  q) const
inline

quaternion addition

◆ operator-()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuatT physx::PxQuatT< Type >::operator- ( ) const
inline

quaternion subtraction

◆ rotate()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3T< Type > physx::PxQuatT< Type >::rotate ( const PxVec3T< Type > &  v) const
inline

rotates passed vec by this (assumed unitary)

◆ rotateInv()

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3T< Type > physx::PxQuatT< Type >::rotateInv ( const PxVec3T< Type > &  v) const
inline

inverse rotates passed vec by this (assumed unitary)

Member Data Documentation

◆ x

template<class Type >
Type physx::PxQuatT< Type >::x

the quaternion elements


The documentation for this class was generated from the following files: