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

2 Element vector class. More...

#include <PxVec2.h>

Public Member Functions

PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T ()
 default constructor leaves data uninitialized.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T (PxZERO)
 zero constructor.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T (Type a)
 Assigns scalar parameter to all elements.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T (Type nx, Type ny)
 Initializes from 2 scalar parameters.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T (const PxVec2T &v)
 Copy ctor.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T & operator= (const PxVec2T &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 PxVec2T &v) const
 returns true if the two vectors are exactly equal.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE bool operator!= (const PxVec2T &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 2 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 PxVec2T operator- () const
 negation
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T operator+ (const PxVec2T &v) const
 vector addition
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T operator- (const PxVec2T &v) const
 vector difference
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T operator* (Type f) const
 scalar post-multiplication
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T operator/ (Type f) const
 scalar division
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T & operator+= (const PxVec2T &v)
 vector addition
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T & operator-= (const PxVec2T &v)
 vector difference
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T & operator*= (Type f)
 scalar multiplication
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T & operator/= (Type f)
 scalar division
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type dot (const PxVec2T &v) const
 returns the scalar product of this and other.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T getNormalized () const
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type normalize ()
 normalizes the vector in place
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T multiply (const PxVec2T &a) const
 a[i] * b[i], for all i.
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T minimum (const PxVec2T &v) const
 element-wise minimum
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type minElement () const
 returns MIN(x, y);
 
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2T maximum (const PxVec2T &v) const
 element-wise maximum
 
PX_CUDA_CALLABLE PX_FORCE_INLINE Type maxElement () const
 returns MAX(x, y);
 

Public Attributes

Type x
 
Type y
 

Detailed Description

template<class Type>
class physx::PxVec2T< Type >

2 Element vector class.

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

Constructor & Destructor Documentation

◆ PxVec2T() [1/2]

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

Assigns scalar parameter to all elements.

Useful to initialize to zero or one.

Parameters
[in]aValue to assign to elements.

◆ PxVec2T() [2/2]

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

Initializes from 2 scalar parameters.

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

Member Function Documentation

◆ getNormalized()

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

returns a unit vector

◆ magnitudeSquared()

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

returns the squared magnitude

Avoids calling PxSqrt()!


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