PxVec3 Class Reference
[Foundation]
3 Element vector class.
More...
#include <PxVec3.h>
Public Member Functions | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 () |
default constructor leaves data uninitialized. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 (PxReal a) |
Assigns scalar parameter to all elements. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 (PxReal nx, PxReal ny, PxReal nz) |
Initializes from 3 scalar parameters. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 (const PxVec3 &v) |
Copy ctor. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator= (const PxVec3 &p) |
Assignment operator. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal & | operator[] (int index) |
element access | |
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxReal & | operator[] (int index) const |
element access | |
PX_CUDA_CALLABLE PX_FORCE_INLINE bool | operator== (const PxVec3 &v) const |
returns true if the two vectors are exactly equal. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE bool | operator!= (const PxVec3 &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 PxReal | magnitudeSquared () const |
returns the squared magnitude | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal | magnitude () const |
returns the magnitude | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator- () const |
negation | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator+ (const PxVec3 &v) const |
vector addition | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator- (const PxVec3 &v) const |
vector difference | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator* (PxReal f) const |
scalar post-multiplication | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator/ (PxReal f) const |
scalar division | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator+= (const PxVec3 &v) |
vector addition | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator-= (const PxVec3 &v) |
vector difference | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator*= (PxReal f) |
scalar multiplication | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator/= (PxReal f) |
scalar division | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal | dot (const PxVec3 &v) const |
returns the scalar product of this and other. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | cross (const PxVec3 &v) const |
cross product | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | getNormalized () const |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal | normalize () |
normalizes the vector in place | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal | 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 PxReal | normalizeFast () |
normalizes the vector in place. Asserts if vector magnitude is under PX_NORMALIZATION_EPSILON. returns vector magnitude. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | multiply (const PxVec3 &a) const |
a[i] * b[i], for all i. | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | minimum (const PxVec3 &v) const |
element-wise minimum | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | minElement () const |
returns MIN(x, y, z); | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | maximum (const PxVec3 &v) const |
element-wise maximum | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | maxElement () const |
returns MAX(x, y, z); | |
Public Attributes | |
PxReal | x |
PxReal | y |
PxReal | z |
Detailed Description
3 Element vector class.This is a 3-dimensional vector class with public data members.
Constructor & Destructor Documentation
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3::PxVec3 | ( | ) | [inline] |
default constructor leaves data uninitialized.
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3::PxVec3 | ( | 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.
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3::PxVec3 | ( | const PxVec3 & | v | ) | [inline] |
Copy ctor.
Member Function Documentation
returns the scalar product of this and other.
Referenced by PxPlane::distance(), and PxPlane::PxPlane().
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 PxVec3::getNormalized | ( | ) | const [inline] |
return a unit vector
References PxRecipSqrt().
PX_CUDA_CALLABLE PX_INLINE bool PxVec3::isFinite | ( | ) | const [inline] |
returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
References PxIsFinite().
Referenced by PxBounds3::isFinite(), PxTriangleMeshGeometry::isValid(), PxConvexMeshGeometry::isValid(), and PxBoxGeometry::isValid().
PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec3::isNormalized | ( | ) | const [inline] |
PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec3::isZero | ( | ) | const [inline] |
tests for exact zero vector
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal PxVec3::magnitude | ( | ) | const [inline] |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal PxVec3::magnitudeSquared | ( | ) | const [inline] |
returns the squared magnitude
Avoids calling PxSqrt()!
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec3::maxElement | ( | ) | const [inline] |
element-wise maximum
References PxMax(), x, y, and z.
Referenced by PxBounds3::boundsOfPoints(), and PxBounds3::include().
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxVec3::minElement | ( | ) | const [inline] |
element-wise minimum
References PxMin(), x, y, and z.
Referenced by PxBounds3::boundsOfPoints(), and PxBounds3::include().
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal PxVec3::normalize | ( | ) | [inline] |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal PxVec3::normalizeFast | ( | ) | [inline] |
normalizes the vector in place. Asserts if vector magnitude is under PX_NORMALIZATION_EPSILON. returns vector magnitude.
References PX_ASSERT, and PX_NORMALIZATION_EPSILON.
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal PxVec3::normalizeSafe | ( | ) | [inline] |
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.
References PX_NORMALIZATION_EPSILON.
PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec3::operator!= | ( | const PxVec3 & | v | ) | const [inline] |
scalar post-multiplication
scalar multiplication
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 PxVec3::operator- | ( | ) | const [inline] |
negation
scalar division
PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxVec3::operator== | ( | const PxVec3 & | v | ) | const [inline] |
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxReal& PxVec3::operator[] | ( | int | index | ) | const [inline] |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxReal& PxVec3::operator[] | ( | int | index | ) | [inline] |
Member Data Documentation
Referenced by PxBounds3::basisExtent(), PxBounds3::contains(), PxMat33::createDiagonal(), cross(), PxExtendedVec3::cross(), dot(), PxExtendedVec3::dot(), PxBounds3::fatten(), PxBounds3::intersects(), PxBounds3::isEmpty(), PxBounds3::isInside(), PxTriangleMeshGeometry::isValid(), PxConvexMeshGeometry::isValid(), PxBoxGeometry::isValid(), maximum(), minimum(), multiply(), operator!=(), operator*(), operator+(), operator+=(), PxExtendedVec3::operator+=(), operator-(), operator-=(), PxExtendedVec3::operator-=(), operator=(), operator==(), PxQuat::PxQuat(), PxMat44::setPosition(), and PxMat33::transform().
Referenced by PxBounds3::basisExtent(), PxBounds3::contains(), PxMat33::createDiagonal(), cross(), PxExtendedVec3::cross(), dot(), PxExtendedVec3::dot(), PxBounds3::fatten(), PxBounds3::intersects(), PxBounds3::isEmpty(), PxBounds3::isInside(), PxTriangleMeshGeometry::isValid(), PxConvexMeshGeometry::isValid(), PxBoxGeometry::isValid(), maximum(), minimum(), multiply(), operator!=(), operator*(), operator+(), operator+=(), PxExtendedVec3::operator+=(), operator-(), operator-=(), PxExtendedVec3::operator-=(), operator=(), operator==(), PxQuat::PxQuat(), PxMat44::setPosition(), and PxMat33::transform().
Referenced by PxBounds3::basisExtent(), PxBounds3::contains(), PxMat33::createDiagonal(), cross(), PxExtendedVec3::cross(), dot(), PxExtendedVec3::dot(), PxBounds3::fatten(), PxBounds3::intersects(), PxMat44::inverseRT(), PxBounds3::isEmpty(), PxBounds3::isInside(), PxTriangleMeshGeometry::isValid(), PxConvexMeshGeometry::isValid(), PxBoxGeometry::isValid(), maximum(), minimum(), multiply(), operator!=(), operator*(), operator+(), operator+=(), PxExtendedVec3::operator+=(), operator-(), operator-=(), PxExtendedVec3::operator-=(), operator=(), operator==(), PxQuat::PxQuat(), PxMat44::setPosition(), and PxMat33::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