3 Element vector class. More...
#include <PxVec3.h>
Public Member Functions | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 () |
default constructor leaves data uninitialized. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 (PxZERO r) |
zero constructor. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 (float a) |
Assigns scalar parameter to all elements. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 (float nx, float ny, float nz) |
Initializes from 3 scalar parameters. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE | PxVec3 (const PxVec3 &v) |
Copy ctor. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator= (const PxVec3 &p) |
Assignment operator. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float & | operator[] (unsigned int index) |
element access More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE const float & | operator[] (unsigned int index) const |
element access More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE bool | operator== (const PxVec3 &v) const |
returns true if the two vectors are exactly equal. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE bool | operator!= (const PxVec3 &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 3 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 PxVec3 | operator- () const |
negation More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator+ (const PxVec3 &v) const |
vector addition More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator- (const PxVec3 &v) const |
vector difference More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator* (float f) const |
scalar post-multiplication More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | operator/ (float f) const |
scalar division More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator+= (const PxVec3 &v) |
vector addition More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator-= (const PxVec3 &v) |
vector difference More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator*= (float f) |
scalar multiplication More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 & | operator/= (float f) |
scalar division More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | dot (const PxVec3 &v) const |
returns the scalar product of this and other. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | cross (const PxVec3 &v) const |
cross product More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | getNormalized () const |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | normalize () |
normalizes the vector in place More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | 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. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | normalizeFast () |
normalizes the vector in place. Asserts if vector magnitude is under PX_NORMALIZATION_EPSILON. returns vector magnitude. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | multiply (const PxVec3 &a) const |
a[i] * b[i], for all i. More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | minimum (const PxVec3 &v) const |
element-wise minimum More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | minElement () const |
returns MIN(x, y, z); More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | maximum (const PxVec3 &v) const |
element-wise maximum More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE float | maxElement () const |
returns MAX(x, y, z); More... | |
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec3 | abs () const |
returns absolute values of components; More... | |
Public Attributes | |
float | x |
float | y |
float | z |
3 Element vector class.
This is a 3-dimensional vector class with public data members.
|
inline |
default constructor leaves data uninitialized.
|
inline |
zero constructor.
References PX_UNUSED().
|
inlineexplicit |
Assigns scalar parameter to all elements.
Useful to initialize to zero or one.
[in] | a | Value to assign to elements. |
|
inline |
Initializes from 3 scalar parameters.
[in] | nx | Value to initialize X component. |
[in] | ny | Value to initialize Y component. |
[in] | nz | Value to initialize Z component. |
|
inline |
Copy ctor.
|
inline |
returns absolute values of components;
References PxAbs().
Referenced by PxMeshScale::isValidForTriangleMesh().
|
inline |
|
inline |
returns the scalar product of this and other.
Referenced by PxPlane::distance(), PxTransform::inverseTransform(), PxSolverBodyData::projectVelocity(), PxTGSSolverBodyVel::projectVelocity(), PxTGSSolverBodyData::projectVelocity(), PxPlane::PxPlane(), PxMassProperties::scaleInertia(), and PxTransform::transform().
|
inline |
return a unit vector
References PxRecipSqrt().
|
inline |
returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
References PxIsFinite().
Referenced by PxMassProperties::getMassSpaceInertia(), PxTransform::isFinite(), PxBounds3::isFinite(), PxTransform::isValid(), PxMassProperties::rotateInertia(), PxMassProperties::scaleInertia(), PxMassProperties::sum(), PxMassProperties::translate(), and PxMassProperties::translateInertia().
|
inline |
is normalized - used by API parameter validation
References physx::intrinsics::isFinite(), and PxAbs().
|
inline |
tests for exact zero vector
|
inline |
returns the magnitude
References PxSqrt().
Referenced by PxTriangle::area(), physx::Gu::ContactBuffer::contact(), and PxQuat::PxQuat().
|
inline |
returns the squared magnitude
Avoids calling PxSqrt()!
|
inline |
|
inline |
element-wise maximum
References PxMax(), x, y, and z.
Referenced by PxBounds3::boundsOfPoints(), and PxBounds3::include().
|
inline |
|
inline |
element-wise minimum
References PxMin(), x, y, and z.
Referenced by PxBounds3::boundsOfPoints(), and PxBounds3::include().
|
inline |
a[i] * b[i], for all i.
Referenced by PxMassProperties::PxMassProperties(), and PxMassProperties::scaleInertia().
|
inline |
normalizes the vector in place
Referenced by PxTriangle::normal().
|
inline |
normalizes the vector in place. Asserts if vector magnitude is under PX_NORMALIZATION_EPSILON. returns vector magnitude.
References PX_NORMALIZATION_EPSILON, and PX_SHARED_ASSERT.
|
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.
|
inline |
|
inline |
scalar post-multiplication
|
inline |
scalar multiplication
|
inline |
|
inline |
|
inline |
negation
|
inline |
|
inline |
|
inline |
scalar division
|
inline |
scalar division
|
inline |
|
inline |
|
inline |
element access
References PX_SHARED_ASSERT.
|
inline |
element access
References PX_SHARED_ASSERT.
float PxVec3::x |
Referenced by PxBounds3::basisExtent(), PxBounds3::contains(), PxMat33::createDiagonal(), PxExtendedVec3::cross(), cross(), PxExtendedVec3::dot(), dot(), PxBounds3::fattenFast(), PxMat33::getInverse(), PxBounds3::intersects(), PxBounds3::isEmpty(), PxBounds3::isInside(), PxBounds3::isValid(), maximum(), minimum(), multiply(), operator!=(), operator*(), operator+(), PxExtendedVec3::operator+=(), operator+=(), operator-(), PxExtendedVec3::operator-=(), operator-=(), operator=(), operator==(), PxMassProperties::PxMassProperties(), PxQuat::PxQuat(), PxQuat::rotate(), PxQuat::rotateInv(), PxMassProperties::scaleInertia(), PxMat44::setPosition(), PxMat33::transform(), and PxMassProperties::translateInertia().
float PxVec3::y |
Referenced by PxBounds3::basisExtent(), PxBounds3::contains(), PxMat33::createDiagonal(), PxExtendedVec3::cross(), cross(), PxExtendedVec3::dot(), dot(), PxBounds3::fattenFast(), PxMat33::getInverse(), PxBounds3::intersects(), PxBounds3::isInside(), PxBounds3::isValid(), maximum(), minimum(), multiply(), operator!=(), operator*(), operator+(), PxExtendedVec3::operator+=(), operator+=(), operator-(), PxExtendedVec3::operator-=(), operator-=(), operator=(), operator==(), PxMassProperties::PxMassProperties(), PxQuat::PxQuat(), PxQuat::rotate(), PxQuat::rotateInv(), PxMassProperties::scaleInertia(), PxMat44::setPosition(), PxMat33::transform(), and PxMassProperties::translateInertia().
float PxVec3::z |
Referenced by PxBounds3::basisExtent(), PxBounds3::contains(), PxMat33::createDiagonal(), PxExtendedVec3::cross(), cross(), PxExtendedVec3::dot(), dot(), PxBounds3::fattenFast(), PxMat33::getInverse(), PxBounds3::intersects(), PxMat44::inverseRT(), PxBounds3::isInside(), PxBounds3::isValid(), maximum(), minimum(), multiply(), operator!=(), operator*(), operator+(), PxExtendedVec3::operator+=(), operator+=(), operator-(), PxExtendedVec3::operator-=(), operator-=(), operator=(), operator==(), PxMassProperties::PxMassProperties(), PxQuat::PxQuat(), PxQuat::rotate(), PxQuat::rotateInv(), PxMassProperties::scaleInertia(), PxMat44::setPosition(), PxMat33::transform(), and PxMassProperties::translateInertia().