PxVec2 Class Reference

2 Element vector class. More...

#include <PxVec2.h>

Public Member Functions

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

Public Attributes

float x
 
float y
 

Detailed Description

2 Element vector class.

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

Constructor & Destructor Documentation

◆ PxVec2() [1/5]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2::PxVec2 ( )
inline

default constructor leaves data uninitialized.

◆ PxVec2() [2/5]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2::PxVec2 ( PxZERO  r)
inline

zero constructor.

References PX_UNUSED().

◆ PxVec2() [3/5]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2::PxVec2 ( float  a)
inlineexplicit

Assigns scalar parameter to all elements.

Useful to initialize to zero or one.

Parameters
[in]aValue to assign to elements.

◆ PxVec2() [4/5]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2::PxVec2 ( float  nx,
float  ny 
)
inline

Initializes from 2 scalar parameters.

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

◆ PxVec2() [5/5]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2::PxVec2 ( const PxVec2 v)
inline

Copy ctor.

Member Function Documentation

◆ dot()

PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec2::dot ( const PxVec2 v) const
inline

returns the scalar product of this and other.

References x, and y.

◆ getNormalized()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::getNormalized ( ) const
inline

return a unit vector

References PxRecipSqrt().

◆ isFinite()

PX_CUDA_CALLABLE PX_INLINE bool PxVec2::isFinite ( ) const
inline

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

References PxIsFinite().

◆ isNormalized()

PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec2::isNormalized ( ) const
inline

is normalized - used by API parameter validation

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

◆ isZero()

PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec2::isZero ( ) const
inline

tests for exact zero vector

◆ magnitude()

PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec2::magnitude ( ) const
inline

returns the magnitude

References PxSqrt().

◆ magnitudeSquared()

PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec2::magnitudeSquared ( ) const
inline

returns the squared magnitude

Avoids calling PxSqrt()!

◆ maxElement()

PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec2::maxElement ( ) const
inline

returns MAX(x, y);

References PxMax().

◆ maximum()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::maximum ( const PxVec2 v) const
inline

element-wise maximum

References PxMax(), x, and y.

◆ minElement()

PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec2::minElement ( ) const
inline

returns MIN(x, y);

References PxMin().

◆ minimum()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::minimum ( const PxVec2 v) const
inline

element-wise minimum

References PxMin(), x, and y.

◆ multiply()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::multiply ( const PxVec2 a) const
inline

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

References x, and y.

◆ normalize()

PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec2::normalize ( )
inline

normalizes the vector in place

◆ operator!=()

PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec2::operator!= ( const PxVec2 v) const
inline

returns true if the two vectors are not exactly equal.

References x, and y.

◆ operator*()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::operator* ( float  f) const
inline

scalar post-multiplication

◆ operator*=()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2& PxVec2::operator*= ( float  f)
inline

scalar multiplication

◆ operator+()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::operator+ ( const PxVec2 v) const
inline

vector addition

References x, and y.

◆ operator+=()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2& PxVec2::operator+= ( const PxVec2 v)
inline

vector addition

References x, and y.

◆ operator-() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::operator- ( ) const
inline

negation

◆ operator-() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::operator- ( const PxVec2 v) const
inline

vector difference

References x, and y.

◆ operator-=()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2& PxVec2::operator-= ( const PxVec2 v)
inline

vector difference

References x, and y.

◆ operator/()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 PxVec2::operator/ ( float  f) const
inline

scalar division

◆ operator/=()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2& PxVec2::operator/= ( float  f)
inline

scalar division

◆ operator=()

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2& PxVec2::operator= ( const PxVec2 p)
inline

Assignment operator.

References x, and y.

◆ operator==()

PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec2::operator== ( const PxVec2 v) const
inline

returns true if the two vectors are exactly equal.

References x, and y.

◆ operator[]() [1/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE float& PxVec2::operator[] ( int  index)
inline

element access

References PX_ASSERT.

◆ operator[]() [2/2]

PX_CUDA_CALLABLE PX_FORCE_INLINE const float& PxVec2::operator[] ( int  index) const
inline

element access

References PX_ASSERT.

Member Data Documentation

◆ x

◆ y


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