PxVec4 Class Reference
[Foundation]
4 Element vector class.
More...
#include <PxVec4.h>
Public Member Functions | |
PX_CUDA_CALLABLE PX_INLINE | PxVec4 () |
default constructor leaves data uninitialized. | |
PX_CUDA_CALLABLE PX_INLINE | PxVec4 (PxReal a) |
Assigns scalar parameter to all elements. | |
PX_CUDA_CALLABLE PX_INLINE | PxVec4 (PxReal nx, PxReal ny, PxReal nz, PxReal nw) |
Initializes from 3 scalar parameters. | |
PX_CUDA_CALLABLE PX_INLINE | PxVec4 (const PxVec3 &v, PxReal nw) |
Initializes from 3 scalar parameters. | |
PX_CUDA_CALLABLE PX_INLINE | PxVec4 (const PxReal v[]) |
Initializes from an array of scalar parameters. | |
PX_CUDA_CALLABLE PX_INLINE | PxVec4 (const PxVec4 &v) |
Copy ctor. | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 & | operator= (const PxVec4 &p) |
Assignment operator. | |
PX_CUDA_CALLABLE PX_INLINE PxReal & | operator[] (int index) |
element access | |
PX_CUDA_CALLABLE PX_INLINE const PxReal & | operator[] (int index) const |
element access | |
PX_CUDA_CALLABLE PX_INLINE bool | operator== (const PxVec4 &v) const |
returns true if the two vectors are exactly equal. | |
PX_CUDA_CALLABLE PX_INLINE bool | operator!= (const PxVec4 &v) const |
returns true if the two vectors are not exactly equal. | |
PX_CUDA_CALLABLE PX_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_INLINE bool | isNormalized () const |
is normalized - used by API parameter validation | |
PX_CUDA_CALLABLE PX_INLINE PxReal | magnitudeSquared () const |
returns the squared magnitude | |
PX_CUDA_CALLABLE PX_INLINE PxReal | magnitude () const |
returns the magnitude | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | operator- () const |
negation | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | operator+ (const PxVec4 &v) const |
vector addition | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | operator- (const PxVec4 &v) const |
vector difference | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | operator* (PxReal f) const |
scalar post-multiplication | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | operator/ (PxReal f) const |
scalar division | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 & | operator+= (const PxVec4 &v) |
vector addition | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 & | operator-= (const PxVec4 &v) |
vector difference | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 & | operator*= (PxReal f) |
scalar multiplication | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 & | operator/= (PxReal f) |
scalar division | |
PX_CUDA_CALLABLE PX_INLINE PxReal | dot (const PxVec4 &v) const |
returns the scalar product of this and other. | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | getNormalized () const |
PX_CUDA_CALLABLE PX_INLINE PxReal | normalize () |
normalizes the vector in place | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | multiply (const PxVec4 &a) const |
a[i] * b[i], for all i. | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | minimum (const PxVec4 &v) const |
element-wise minimum | |
PX_CUDA_CALLABLE PX_INLINE PxVec4 | maximum (const PxVec4 &v) const |
element-wise maximum | |
PX_CUDA_CALLABLE PX_INLINE PxVec3 | getXYZ () const |
PX_CUDA_CALLABLE PX_INLINE void | setZero () |
set vector elements to zero | |
Public Attributes | |
PxReal | x |
PxReal | y |
PxReal | z |
PxReal | w |
Detailed Description
4 Element vector class.This is a 4-dimensional vector class with public data members.
Constructor & Destructor Documentation
PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 | ( | ) | [inline] |
default constructor leaves data uninitialized.
PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 | ( | PxReal | a | ) | [inline, explicit] |
Assigns scalar parameter to all elements.
Useful to initialize to zero or one.
- Parameters:
-
[in] a Value to assign to elements.
Initializes from 3 scalar parameters.
- Parameters:
-
[in] nx Value to initialize X component. [in] ny Value to initialize Y component. [in] nz Value to initialize Z component. [in] nw Value to initialize W component.
Initializes from 3 scalar parameters.
- Parameters:
-
[in] v Value to initialize the X, Y, and Z components. [in] nw Value to initialize W component.
PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 | ( | const PxReal | v[] | ) | [inline, explicit] |
Initializes from an array of scalar parameters.
- Parameters:
-
[in] v Value to initialize with.
PX_CUDA_CALLABLE PX_INLINE PxVec4::PxVec4 | ( | const PxVec4 & | v | ) | [inline] |
Copy ctor.
Member Function Documentation
PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::getNormalized | ( | ) | const [inline] |
return a unit vector
References PxRecipSqrt().
PX_CUDA_CALLABLE PX_INLINE PxVec3 PxVec4::getXYZ | ( | ) | const [inline] |
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().
PX_CUDA_CALLABLE PX_INLINE bool PxVec4::isNormalized | ( | ) | const [inline] |
PX_CUDA_CALLABLE PX_INLINE bool PxVec4::isZero | ( | ) | const [inline] |
tests for exact zero vector
PX_CUDA_CALLABLE PX_INLINE PxReal PxVec4::magnitude | ( | ) | const [inline] |
PX_CUDA_CALLABLE PX_INLINE PxReal PxVec4::magnitudeSquared | ( | ) | const [inline] |
returns the squared magnitude
Avoids calling PxSqrt()!
PX_CUDA_CALLABLE PX_INLINE PxReal PxVec4::normalize | ( | ) | [inline] |
normalizes the vector in place
PX_CUDA_CALLABLE PX_INLINE bool PxVec4::operator!= | ( | const PxVec4 & | v | ) | const [inline] |
scalar post-multiplication
PX_CUDA_CALLABLE PX_INLINE PxVec4 PxVec4::operator- | ( | ) | const [inline] |
negation
PX_CUDA_CALLABLE PX_INLINE bool PxVec4::operator== | ( | const PxVec4 & | v | ) | const [inline] |
PX_CUDA_CALLABLE PX_INLINE const PxReal& PxVec4::operator[] | ( | int | index | ) | const [inline] |
PX_CUDA_CALLABLE PX_INLINE PxReal& PxVec4::operator[] | ( | int | index | ) | [inline] |
PX_CUDA_CALLABLE PX_INLINE void PxVec4::setZero | ( | ) | [inline] |
set vector elements to zero
Member Data Documentation
Referenced by dot(), maximum(), minimum(), multiply(), operator!=(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator=(), operator==(), PxMat44::scale(), and PxMat44::transform().
The documentation for this class was generated from the following file:
Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com