PxVec4 Class Reference

4 Element vector class. More...

#include <PxVec4.h>

Public Member Functions

PX_CUDA_CALLABLE PX_INLINE PxVec4 ()
 default constructor leaves data uninitialized. More...
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec4 (PxZERO r)
 zero constructor. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 (float a)
 Assigns scalar parameter to all elements. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 (float nx, float ny, float nz, float nw)
 Initializes from 3 scalar parameters. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 (const PxVec3 &v, float nw)
 Initializes from 3 scalar parameters. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 (const float v[])
 Initializes from an array of scalar parameters. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 (const PxVec4 &v)
 Copy ctor. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4operator= (const PxVec4 &p)
 Assignment operator. More...
 
PX_CUDA_CALLABLE PX_INLINE float & operator[] (unsigned int index)
 element access More...
 
PX_CUDA_CALLABLE PX_INLINE const float & operator[] (unsigned int index) const
 element access More...
 
PX_CUDA_CALLABLE PX_INLINE bool operator== (const PxVec4 &v) const
 returns true if the two vectors are exactly equal. More...
 
PX_CUDA_CALLABLE PX_INLINE bool operator!= (const PxVec4 &v) const
 returns true if the two vectors are not exactly equal. More...
 
PX_CUDA_CALLABLE PX_INLINE bool isZero () const
 tests for exact zero vector More...
 
PX_CUDA_CALLABLE PX_INLINE bool isFinite () const
 returns true if all 3 elems of the vector are finite (not NAN or INF, etc.) More...
 
PX_CUDA_CALLABLE PX_INLINE bool isNormalized () const
 is normalized - used by API parameter validation More...
 
PX_CUDA_CALLABLE PX_INLINE float magnitudeSquared () const
 returns the squared magnitude More...
 
PX_CUDA_CALLABLE PX_INLINE float magnitude () const
 returns the magnitude More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator- () const
 negation More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator+ (const PxVec4 &v) const
 vector addition More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator- (const PxVec4 &v) const
 vector difference More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator* (float f) const
 scalar post-multiplication More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator/ (float f) const
 scalar division More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4operator+= (const PxVec4 &v)
 vector addition More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4operator-= (const PxVec4 &v)
 vector difference More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4operator*= (float f)
 scalar multiplication More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4operator/= (float f)
 scalar division More...
 
PX_CUDA_CALLABLE PX_INLINE float dot (const PxVec4 &v) const
 returns the scalar product of this and other. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 getNormalized () const
 
PX_CUDA_CALLABLE PX_INLINE float normalize ()
 normalizes the vector in place More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 multiply (const PxVec4 &a) const
 a[i] * b[i], for all i. More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 minimum (const PxVec4 &v) const
 element-wise minimum More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec4 maximum (const PxVec4 &v) const
 element-wise maximum More...
 
PX_CUDA_CALLABLE PX_INLINE PxVec3 getXYZ () const
 
PX_CUDA_CALLABLE PX_INLINE void setZero ()
 set vector elements to zero More...
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Detailed Description

4 Element vector class.

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

Constructor & Destructor Documentation

◆ PxVec4() [1/7]

PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 ( )
inline

default constructor leaves data uninitialized.

◆ PxVec4() [2/7]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec4::PxVec4 ( PxZERO  r)
inline

zero constructor.

References PX_UNUSED().

◆ PxVec4() [3/7]

PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 ( float  a)
inlineexplicit

Assigns scalar parameter to all elements.

Useful to initialize to zero or one.

Parameters
[in]aValue to assign to elements.

◆ PxVec4() [4/7]

PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 ( float  nx,
float  ny,
float  nz,
float  nw 
)
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.
[in]nwValue to initialize W component.

◆ PxVec4() [5/7]

PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 ( const PxVec3 v,
float  nw 
)
inline

Initializes from 3 scalar parameters.

Parameters
[in]vValue to initialize the X, Y, and Z components.
[in]nwValue to initialize W component.

◆ PxVec4() [6/7]

PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 ( const float  v[])
inlineexplicit

Initializes from an array of scalar parameters.

Parameters
[in]vValue to initialize with.

◆ PxVec4() [7/7]

PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 ( const PxVec4 v)
inline

Copy ctor.

Member Function Documentation

◆ dot()

PX_CUDA_CALLABLE PX_INLINE float PxVec4::dot ( const PxVec4 v) const
inline

returns the scalar product of this and other.

References w, x, y, and z.

◆ getNormalized()

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::getNormalized ( ) const
inline

return a unit vector

References PxRecipSqrt().

◆ getXYZ()

PX_CUDA_CALLABLE PX_INLINE PxVec3 PxVec4::getXYZ ( ) const
inline

◆ isFinite()

PX_CUDA_CALLABLE PX_INLINE bool PxVec4::isFinite ( ) const
inline

returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)

References PxIsFinite().

◆ isNormalized()

PX_CUDA_CALLABLE PX_INLINE bool PxVec4::isNormalized ( ) const
inline

is normalized - used by API parameter validation

References physx::intrinsics::isFinite(), and PxAbs().

◆ isZero()

PX_CUDA_CALLABLE PX_INLINE bool PxVec4::isZero ( ) const
inline

tests for exact zero vector

◆ magnitude()

PX_CUDA_CALLABLE PX_INLINE float PxVec4::magnitude ( ) const
inline

returns the magnitude

References PxSqrt().

◆ magnitudeSquared()

PX_CUDA_CALLABLE PX_INLINE float PxVec4::magnitudeSquared ( ) const
inline

returns the squared magnitude

Avoids calling PxSqrt()!

◆ maximum()

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::maximum ( const PxVec4 v) const
inline

element-wise maximum

References PxMax(), w, x, y, and z.

◆ minimum()

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::minimum ( const PxVec4 v) const
inline

element-wise minimum

References PxMin(), w, x, y, and z.

◆ multiply()

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::multiply ( const PxVec4 a) const
inline

a[i] * b[i], for all i.

References w, x, y, and z.

◆ normalize()

PX_CUDA_CALLABLE PX_INLINE float PxVec4::normalize ( )
inline

normalizes the vector in place

◆ operator!=()

PX_CUDA_CALLABLE PX_INLINE bool PxVec4::operator!= ( const PxVec4 v) const
inline

returns true if the two vectors are not exactly equal.

References w, x, y, and z.

◆ operator*()

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::operator* ( float  f) const
inline

scalar post-multiplication

◆ operator*=()

PX_CUDA_CALLABLE PX_INLINE PxVec4& PxVec4::operator*= ( float  f)
inline

scalar multiplication

◆ operator+()

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::operator+ ( const PxVec4 v) const
inline

vector addition

References w, x, y, and z.

◆ operator+=()

PX_CUDA_CALLABLE PX_INLINE PxVec4& PxVec4::operator+= ( const PxVec4 v)
inline

vector addition

References w, x, y, and z.

◆ operator-() [1/2]

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::operator- ( ) const
inline

negation

◆ operator-() [2/2]

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::operator- ( const PxVec4 v) const
inline

vector difference

References w, x, y, and z.

◆ operator-=()

PX_CUDA_CALLABLE PX_INLINE PxVec4& PxVec4::operator-= ( const PxVec4 v)
inline

vector difference

References w, x, y, and z.

◆ operator/()

PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::operator/ ( float  f) const
inline

scalar division

◆ operator/=()

PX_CUDA_CALLABLE PX_INLINE PxVec4& PxVec4::operator/= ( float  f)
inline

scalar division

◆ operator=()

PX_CUDA_CALLABLE PX_INLINE PxVec4& PxVec4::operator= ( const PxVec4 p)
inline

Assignment operator.

References w, x, y, and z.

◆ operator==()

PX_CUDA_CALLABLE PX_INLINE bool PxVec4::operator== ( const PxVec4 v) const
inline

returns true if the two vectors are exactly equal.

References w, x, y, and z.

◆ operator[]() [1/2]

PX_CUDA_CALLABLE PX_INLINE float& PxVec4::operator[] ( unsigned int  index)
inline

element access

References PX_SHARED_ASSERT.

◆ operator[]() [2/2]

PX_CUDA_CALLABLE PX_INLINE const float& PxVec4::operator[] ( unsigned int  index) const
inline

element access

References PX_SHARED_ASSERT.

◆ setZero()

PX_CUDA_CALLABLE PX_INLINE void PxVec4::setZero ( )
inline

set vector elements to zero

Member Data Documentation

◆ w

◆ x

◆ y

◆ z


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