30 #ifndef PXFOUNDATION_PXVEC4_H 31 #define PXFOUNDATION_PXVEC4_H 137 return reinterpret_cast<float*
>(
this)[index];
147 return reinterpret_cast<const float*
>(
this)[index];
155 return x == v.
x && y == v.
y && z == v.
z && w == v.
w;
163 return x != v.
x || y != v.
y || z != v.
z || w != v.
w;
171 return x == 0 && y == 0 && z == 0 && w == 0;
187 const float unitTolerance = 1e-4f;
198 return x * x + y * y + z * z + w * w;
206 return PxSqrt(magnitudeSquared());
214 return PxVec4(-x, -y, -z, -w);
222 return PxVec4(x + v.
x, y + v.
y, z + v.
z, w + v.
w);
230 return PxVec4(x - v.
x, y - v.
y, z - v.
z, w - v.
w);
239 return PxVec4(x * f, y * f, z * f, w * f);
248 return PxVec4(x * f, y * f, z * f, w * f);
304 return x * v.
x + y * v.
y + z * v.
z + w * v.
w;
311 float m = magnitudeSquared();
320 float m = magnitude();
331 return PxVec4(x * a.
x, y * a.
y, z * a.
z, w * a.
w);
360 x = y = z = w = 0.0f;
368 return PxVec4(f * v.
x, f * v.
y, f * v.
z, f * v.
w);
376 #endif // #ifndef PXFOUNDATION_PXVEC4_H Definition: GuContactBuffer.h:37
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator+(const PxVec4 &v) const
vector addition
Definition: PxVec4.h:220
PX_CUDA_CALLABLE PX_INLINE PxVec4 & operator/=(float f)
scalar division
Definition: PxVec4.h:289
static PX_CUDA_CALLABLE PX_INLINE PxVec4 operator*(float f, const PxVec4 &v)
Definition: PxVec4.h:366
PX_CUDA_CALLABLE PX_INLINE PxVec4 maximum(const PxVec4 &v) const
element-wise maximum
Definition: PxVec4.h:345
PX_CUDA_CALLABLE PX_INLINE bool operator!=(const PxVec4 &v) const
returns true if the two vectors are not exactly equal.
Definition: PxVec4.h:161
PX_CUDA_CALLABLE PX_INLINE float dot(const PxVec4 &v) const
returns the scalar product of this and other.
Definition: PxVec4.h:302
PX_CUDA_CALLABLE PX_INLINE PxVec4 & operator=(const PxVec4 &p)
Assignment operator.
Definition: PxVec4.h:121
PX_CUDA_CALLABLE PX_INLINE bool isFinite() const
returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
Definition: PxVec4.h:177
#define PX_FORCE_INLINE
Definition: PxPreprocessor.h:364
float w
Definition: PxVec4.h:363
PxZERO
Definition: Px.h:76
float z
Definition: PxVec4.h:363
PX_CUDA_CALLABLE PX_INLINE PxVec4 multiply(const PxVec4 &a) const
a[i] * b[i], for all i.
Definition: PxVec4.h:329
PX_CUDA_CALLABLE PX_INLINE float magnitudeSquared() const
returns the squared magnitude
Definition: PxVec4.h:196
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite(float a)
platform-specific finiteness check (not INF or NAN)
Definition: PxUnixIntrinsics.h:127
PX_CUDA_CALLABLE PX_INLINE PxVec4(float nx, float ny, float nz, float nw)
Initializes from 3 scalar parameters.
Definition: PxVec4.h:86
PX_CUDA_CALLABLE PX_INLINE PxVec4()
default constructor leaves data uninitialized.
Definition: PxVec4.h:55
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxSqrt(float a)
Square root.
Definition: PxMath.h:144
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator-(const PxVec4 &v) const
vector difference
Definition: PxVec4.h:228
PX_CUDA_CALLABLE PX_INLINE void setZero()
set vector elements to zero
Definition: PxVec4.h:358
PX_CUDA_CALLABLE PX_INLINE PxVec4 getNormalized() const
Definition: PxVec4.h:309
PX_CUDA_CALLABLE PX_INLINE PxVec4 & operator*=(float f)
scalar multiplication
Definition: PxVec4.h:278
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator-() const
negation
Definition: PxVec4.h:212
PX_CUDA_CALLABLE PX_INLINE PxVec4 & operator+=(const PxVec4 &v)
vector addition
Definition: PxVec4.h:254
PX_CUDA_CALLABLE PX_INLINE PxVec4(const float v[])
Initializes from an array of scalar parameters.
Definition: PxVec4.h:105
PX_CUDA_CALLABLE PX_FORCE_INLINE T PxMin(T a, T b)
The return value is the lesser of the two specified values.
Definition: PxMath.h:86
PX_CUDA_CALLABLE PX_INLINE bool operator==(const PxVec4 &v) const
returns true if the two vectors are exactly equal.
Definition: PxVec4.h:153
PX_CUDA_CALLABLE PX_INLINE bool isZero() const
tests for exact zero vector
Definition: PxVec4.h:169
PX_CUDA_CALLABLE PX_INLINE PxVec4 & operator-=(const PxVec4 &v)
vector difference
Definition: PxVec4.h:266
PX_CUDA_CALLABLE PX_INLINE float normalize()
normalizes the vector in place
Definition: PxVec4.h:318
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxRecipSqrt(float a)
reciprocal square root.
Definition: PxMath.h:156
PX_CUDA_CALLABLE PX_INLINE bool isNormalized() const
is normalized - used by API parameter validation
Definition: PxVec4.h:185
PX_CUDA_CALLABLE PX_INLINE PxVec4(const PxVec3 &v, float nw)
Initializes from 3 scalar parameters.
Definition: PxVec4.h:96
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxAbs(float a)
abs returns the absolute value of its argument.
Definition: PxMath.h:107
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec4(PxZERO r)
zero constructor.
Definition: PxVec4.h:62
PX_CUDA_CALLABLE PX_FORCE_INLINE T PxMax(T a, T b)
The return value is the greater of the two specified values.
Definition: PxMath.h:70
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator/(float f) const
scalar division
Definition: PxVec4.h:245
PX_CUDA_CALLABLE PX_INLINE float magnitude() const
returns the magnitude
Definition: PxVec4.h:204
PX_CUDA_CALLABLE PX_INLINE void PX_UNUSED(T const &)
Definition: PxPreprocessor.h:479
PX_CUDA_CALLABLE PX_INLINE const float & operator[](unsigned int index) const
element access
Definition: PxVec4.h:143
PX_CUDA_CALLABLE PX_FORCE_INLINE bool PxIsFinite(float f)
returns true if the passed number is a finite floating point number as opposed to INF...
Definition: PxMath.h:292
4 Element vector class.
Definition: PxVec4.h:49
PX_CUDA_CALLABLE PX_INLINE float & operator[](unsigned int index)
element access
Definition: PxVec4.h:133
PX_CUDA_CALLABLE PX_INLINE PxVec4(float a)
Assigns scalar parameter to all elements.
Definition: PxVec4.h:74
#define PX_ASSERT(exp)
Definition: PxAssert.h:61
PX_CUDA_CALLABLE PX_INLINE PxVec4 minimum(const PxVec4 &v) const
element-wise minimum
Definition: PxVec4.h:337
PX_CUDA_CALLABLE PX_INLINE PxVec4 operator*(float f) const
scalar post-multiplication
Definition: PxVec4.h:237
float y
Definition: PxVec4.h:363
#define PX_INLINE
Definition: PxPreprocessor.h:349
#define PX_CUDA_CALLABLE
Definition: PxPreprocessor.h:473
3 Element vector class.
Definition: PxVec3.h:49
PX_CUDA_CALLABLE PX_INLINE PxVec4(const PxVec4 &v)
Copy ctor.
Definition: PxVec4.h:112
float x
Definition: PxVec4.h:363
PX_CUDA_CALLABLE PX_INLINE PxVec3 getXYZ() const
Definition: PxVec4.h:350