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

3 Element vector class. More...

#include <PxVec3.h>

Public Member Functions

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T ()
 default constructor leaves data uninitialized.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T (PxZERO)
 zero constructor.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T (Type a)
 Assigns scalar parameter to all elements.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T (Type nx, Type ny, Type nz)
 Initializes from 3 scalar parameters.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T (const PxVec3T &v)
 Copy ctor.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T & operator= (const PxVec3T &p)
 Assignment operator.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type & operator[] (unsigned int index)
 element access
 
PX_CUDA_CALLABLE PX_FORCE_INLINE const Type & operator[] (unsigned int index) const
 element access
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool operator== (const PxVec3T &v) const
 returns true if the two vectors are exactly equal.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool operator!= (const PxVec3T &v) const
 returns true if the two vectors are not exactly equal.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isZero () const
 tests for exact zero vector
 
PX_CUDA_CALLABLE PX_INLINE bool isFinite () const
 returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isNormalized () const
 is normalized - used by API parameter validation
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type magnitudeSquared () const
 returns the squared magnitude
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type magnitude () const
 returns the magnitude
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T operator- () const
 negation
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T operator+ (const PxVec3T &v) const
 vector addition
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T operator- (const PxVec3T &v) const
 vector difference
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T operator* (Type f) const
 scalar post-multiplication
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T operator/ (Type f) const
 scalar division
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T & operator+= (const PxVec3T &v)
 vector addition
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T & operator-= (const PxVec3T &v)
 vector difference
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T & operator*= (Type f)
 scalar multiplication
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T & operator/= (Type f)
 scalar division
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type dot (const PxVec3T &v) const
 returns the scalar product of this and other.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T cross (const PxVec3T &v) const
 cross product
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T getNormalized () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type normalize ()
 normalizes the vector in place
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type normalizeSafe ()
 normalizes the vector in place. Does nothing if vector magnitude is under PX_NORMALIZATION_EPSILON. Returns vector magnitude if >= PX_NORMALIZATION_EPSILON and 0.0f otherwise.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type normalizeFast ()
 normalizes the vector in place. Asserts if vector magnitude is under PX_NORMALIZATION_EPSILON. returns vector magnitude.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T multiply (const PxVec3T &a) const
 a[i] * b[i], for all i.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T minimum (const PxVec3T &v) const
 element-wise minimum
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type minElement () const
 returns MIN(x, y, z);
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T maximum (const PxVec3T &v) const
 element-wise maximum
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type maxElement () const
 returns MAX(x, y, z);
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3T abs () const
 returns absolute values of components;
 

Public Attributes

Type x
 
Type y
 
Type z
 

Detailed Description

template<class Type>
class physx::PxVec3T< Type >

3 Element vector class.

This is a 3-dimensional vector class with public data members.

Constructor & Destructor Documentation

◆ PxVec3T() [1/2]

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE physx::PxVec3T< Type >::PxVec3T ( Type  a)
inlineexplicit

Assigns scalar parameter to all elements.

Useful to initialize to zero or one.

Parameters
[in]aValue to assign to elements.

◆ PxVec3T() [2/2]

template<class Type >
PX_CUDA_CALLABLE PX_FORCE_INLINE physx::PxVec3T< Type >::PxVec3T ( Type  nx,
Type  ny,
Type  nz 
)
inline

Initializes from 3 scalar parameters.

Parameters
[in]nxValue to initialize X component.
[in]nyValue to initialize Y component.
[in]nzValue to initialize Z component.

Member Function Documentation

◆ getNormalized()

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

returns a unit vector

◆ magnitudeSquared()

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

returns the squared magnitude

Avoids calling PxSqrt()!


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