RavEngine
Loading...
Searching...
No Matches
physx::PxQuat Class 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 PxQuat ()
 Default constructor, does not do any initialization.
 
PX_CUDA_CALLABLE PX_INLINE PxQuat (PxIDENTITY r)
 identity constructor
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat (float 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 PxQuat (float nx, float ny, float nz, float nw)
 Constructor. Take note of the order of the elements!
 
PX_CUDA_CALLABLE PX_INLINE PxQuat (float angleRadians, const PxVec3 &unitAxis)
 Creates from angle-axis representation.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat (const PxQuat &v)
 Copy ctor.
 
PX_CUDA_CALLABLE PX_INLINE PxQuat (const PxMat33 &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_INLINE bool operator== (const PxQuat &q) const
 returns true if the two quaternions are exactly equal
 
PX_CUDA_CALLABLE PX_INLINE void toRadiansAndUnitAxis (float &angle, PxVec3 &axis) const
 converts this quaternion to angle-axis representation
 
PX_CUDA_CALLABLE PX_INLINE float getAngle () const
 Gets the angle between this quat and the identity quaternion.
 
PX_CUDA_CALLABLE PX_INLINE float getAngle (const PxQuat &q) const
 Gets the angle between this quat and the argument.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE float magnitudeSquared () const
 This is the squared 4D vector length, should be 1 for unit quaternions.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE float dot (const PxQuat &v) const
 returns the scalar product of this and other.
 
PX_CUDA_CALLABLE PX_INLINE PxQuat getNormalized () const
 
PX_CUDA_CALLABLE PX_INLINE float magnitude () const
 
PX_CUDA_CALLABLE PX_INLINE float normalize ()
 maps to the closest unit quaternion.
 
PX_CUDA_CALLABLE PX_INLINE PxQuat getConjugate () const
 
PX_CUDA_CALLABLE PX_INLINE PxVec3 getImaginaryPart () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getBasisVector0 () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getBasisVector1 () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 getBasisVector2 () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3 rotate (const PxVec3 &v) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3 rotateInv (const PxVec3 &v) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat & operator= (const PxQuat &p)
 Assignment operator.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat & operator*= (const PxQuat &q)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat & operator+= (const PxQuat &q)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat & operator-= (const PxQuat &q)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat & operator*= (const float s)
 
PX_CUDA_CALLABLE PX_INLINE PxQuat operator* (const PxQuat &q) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat operator+ (const PxQuat &q) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat operator- () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat operator- (const PxQuat &q) const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat operator* (float r) const
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Detailed Description

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

Constructor & Destructor Documentation

◆ PxQuat() [1/2]

PX_CUDA_CALLABLE PX_INLINE physx::PxQuat::PxQuat ( float  angleRadians,
const PxVec3 &  unitAxis 
)
inline

Creates from angle-axis representation.

Axis must be normalized!

Angle is in radians!

Unit: Radians

◆ PxQuat() [2/2]

PX_CUDA_CALLABLE PX_INLINE physx::PxQuat::PxQuat ( const PxMat33 &  m)
explicit

Creates from orientation matrix.

Parameters
[in]mRotation matrix to extract quaternion from.

Member Function Documentation

◆ getAngle() [1/2]

PX_CUDA_CALLABLE PX_INLINE float physx::PxQuat::getAngle ( ) const
inline

Gets the angle between this quat and the identity quaternion.

Unit: Radians

◆ getAngle() [2/2]

PX_CUDA_CALLABLE PX_INLINE float physx::PxQuat::getAngle ( const PxQuat &  q) const
inline

Gets the angle between this quat and the argument.

Unit: Radians

◆ getBasisVector0()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 physx::PxQuat::getBasisVector0 ( ) const
inline

brief computes rotation of x-axis

◆ getBasisVector1()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 physx::PxQuat::getBasisVector1 ( ) const
inline

brief computes rotation of y-axis

◆ getBasisVector2()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 physx::PxQuat::getBasisVector2 ( ) const
inline

brief computes rotation of z-axis

◆ operator*()

PX_CUDA_CALLABLE PX_INLINE PxQuat physx::PxQuat::operator* ( const PxQuat &  q) const
inline

quaternion multiplication

◆ operator+()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat physx::PxQuat::operator+ ( const PxQuat &  q) const
inline

quaternion addition

◆ operator-()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxQuat physx::PxQuat::operator- ( ) const
inline

quaternion subtraction

◆ rotate()

PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3 physx::PxQuat::rotate ( const PxVec3 &  v) const
inline

rotates passed vec by this (assumed unitary)

◆ rotateInv()

PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec3 physx::PxQuat::rotateInv ( const PxVec3 &  v) const
inline

inverse rotates passed vec by this (assumed unitary)

Member Data Documentation

◆ x

float physx::PxQuat::x

the quaternion elements


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