30 #ifndef PXFOUNDATION_PXMAT44_H 31 #define PXFOUNDATION_PXMAT44_H 64 : column0(1.0f, 0.0f, 0.0f, 0.0f)
65 , column1(0.0f, 1.0f, 0.0f, 0.0f)
66 , column2(0.0f, 0.0f, 1.0f, 0.0f)
67 , column3(0.0f, 0.0f, 0.0f, 1.0f)
80 : column0(col0), column1(col1), column2(col2), column3(col3)
86 : column0(r, 0.0f, 0.0f, 0.0f)
87 , column1(0.0f, r, 0.0f, 0.0f)
88 , column2(0.0f, 0.0f, r, 0.0f)
89 , column3(0.0f, 0.0f, 0.0f, r)
95 : column0(col0, 0), column1(col1, 0), column2(col2, 0), column3(col3, 1.0f)
101 : column0(values[0], values[1], values[2], values[3])
102 , column1(values[4], values[5], values[6], values[7])
103 , column2(values[8], values[9], values[10], values[11])
104 , column3(values[12], values[13], values[14], values[15])
116 const float x2 = x + x;
117 const float y2 = y + y;
118 const float z2 = z + z;
120 const float xx = x2 * x;
121 const float yy = y2 * y;
122 const float zz = z2 * z;
124 const float xy = x2 * y;
125 const float xz = x2 * z;
126 const float xw = x2 * w;
128 const float yz = y2 * z;
129 const float yw = y2 * w;
130 const float zw = z2 * w;
132 column0 =
PxVec4(1.0f - yy - zz, xy + zw, xz - yw, 0.0f);
133 column1 =
PxVec4(xy - zw, 1.0f - xx - zz, yz + xw, 0.0f);
134 column2 =
PxVec4(xz + yw, yz - xw, 1.0f - xx - yy, 0.0f);
135 column3 =
PxVec4(0.0f, 0.0f, 0.0f, 1.0f);
140 : column0(diagonal.x, 0.0f, 0.0f, 0.0f)
141 , column1(0.0f, diagonal.y, 0.0f, 0.0f)
142 , column2(0.0f, 0.0f, diagonal.z, 0.0f)
143 , column3(0.0f, 0.0f, 0.0f, diagonal.w)
149 : column0(axes.column0, 0.0f), column1(axes.column1, 0.0f), column2(axes.column2, 0.0f), column3(position, 1.0f)
168 : column0(other.column0), column1(other.column1), column2(other.column2), column3(other.column3)
186 PxVec4(column0.x, column1.x, column2.x, column3.x),
PxVec4(column0.y, column1.y, column2.y, column3.y),
187 PxVec4(column0.z, column1.z, column2.z, column3.z),
PxVec4(column0.w, column1.w, column2.w, column3.w));
193 return PxMat44(-column0, -column1, -column2, -column3);
213 return PxMat44(column0 * scalar, column1 * scalar, column2 * scalar, column3 * scalar);
262 *
this = *
this * other;
269 return (*
this)[col][row];
275 return (*
this)[col][row];
281 return column0 * other.
x + column1 * other.
y + column2 * other.
z + column3 * other.
w;
287 return transform(
PxVec4(other, 1.0f)).getXYZ();
293 return column0 * other.
x + column1 * other.
y + column2 * other.
z;
299 return rotate(
PxVec4(other, 1.0f)).getXYZ();
305 return (&column0)[num].getXYZ();
310 return column3.getXYZ();
315 column3.x = position.
x;
316 column3.y = position.
y;
317 column3.z = position.
z;
327 return (&column0)[num];
331 return (&column0)[num];
344 PxVec3 r0(column0.x, column1.x, column2.x), r1(column0.y, column1.y, column2.y),
345 r2(column0.z, column1.z, column2.z);
347 return PxMat44(r0, r1, r2, -(r0 * column3.x + r1 * column3.y + r2 * column3.
z));
352 return column0.isFinite() && column1.isFinite() && column2.isFinite() && column3.isFinite();
376 #endif // #ifndef PXFOUNDATION_PXMAT44_H Definition: GuContactBuffer.h:37
PX_CUDA_CALLABLE PX_INLINE PxMat44 & operator*=(float scalar)
Equals scalar multiplication.
Definition: PxMat44.h:250
PX_CUDA_CALLABLE PX_INLINE PxMat44 & operator-=(const PxMat44 &other)
Equals-sub.
Definition: PxMat44.h:240
PX_CUDA_CALLABLE PX_INLINE const PxVec4 rotate(const PxVec4 &other) const
Rotate vector by matrix, equal to v' = M*v.
Definition: PxMat44.h:291
PX_CUDA_CALLABLE PX_INLINE void scale(const PxVec4 &p)
Definition: PxMat44.h:334
PX_CUDA_CALLABLE PX_INLINE const PxVec3 rotate(const PxVec3 &other) const
Rotate vector by matrix, equal to v' = M*v.
Definition: PxMat44.h:297
PX_CUDA_CALLABLE PX_INLINE const PxVec3 getPosition() const
Definition: PxMat44.h:308
PX_CUDA_CALLABLE PX_FORCE_INLINE float & operator()(unsigned int row, unsigned int col)
Element access, mathematical way!
Definition: PxMat44.h:273
#define PX_FORCE_INLINE
Definition: PxPreprocessor.h:351
This is a quaternion class. For more information on quaternion mathematics consult a mathematics sour...
Definition: PxQuat.h:49
float w
Definition: PxVec4.h:363
PX_CUDA_CALLABLE PX_INLINE void setPosition(const PxVec3 &position)
Definition: PxMat44.h:313
PX_CUDA_CALLABLE PX_INLINE PxMat44(PxIDENTITY r)
identity constructor
Definition: PxMat44.h:63
PX_CUDA_CALLABLE PX_INLINE bool isFinite() const
Definition: PxMat44.h:350
PxZERO
Definition: Px.h:76
float z
Definition: PxVec4.h:363
PX_CUDA_CALLABLE PX_INLINE const PxVec4 transform(const PxVec4 &other) const
Transform vector by matrix, equal to v' = M*v.
Definition: PxMat44.h:279
PX_CUDA_CALLABLE PX_INLINE bool operator==(const PxMat44 &m) const
returns true if the two matrices are exactly equal
Definition: PxMat44.h:161
PX_CUDA_CALLABLE PX_INLINE PxMat44(float values[])
Construct from float[16].
Definition: PxMat44.h:100
#define PX_SHARED_ASSERT(exp)
Definition: PxSharedAssert.h:39
float z
Definition: PxQuat.h:395
PX_CUDA_CALLABLE PX_INLINE const PxMat44 operator-() const
Unary minus.
Definition: PxMat44.h:191
static PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec2 operator*(float f, const PxVec2 &v)
Definition: PxVec2.h:337
float y
Definition: PxVec3.h:381
4x4 matrix class
Definition: PxMat44.h:54
float w
Definition: PxQuat.h:395
PX_CUDA_CALLABLE PX_INLINE const PxMat44 operator-(const PxMat44 &other) const
Subtract.
Definition: PxMat44.h:204
PX_CUDA_CALLABLE PX_INLINE PxMat44(const PxQuat &q)
Construct from a quaternion.
Definition: PxMat44.h:109
PX_CUDA_CALLABLE PX_INLINE PxMat44 & operator*=(const PxMat44 &other)
Equals matrix multiplication.
Definition: PxMat44.h:260
PX_CUDA_CALLABLE PX_INLINE PxMat44(const PxVec4 &diagonal)
Construct from a diagonal vector.
Definition: PxMat44.h:139
PxVec4 column2
Definition: PxMat44.h:357
float x
Definition: PxQuat.h:395
PX_CUDA_CALLABLE PxMat44(const PxVec3 &col0, const PxVec3 &col1, const PxVec3 &col2, const PxVec3 &col3)
Construct from three base vectors and a translation.
Definition: PxMat44.h:94
PX_CUDA_CALLABLE PX_FORCE_INLINE PxVec4 & operator[](unsigned int num)
Definition: PxMat44.h:325
PX_CUDA_CALLABLE PX_INLINE const PxVec3 transform(const PxVec3 &other) const
Transform vector by matrix, equal to v' = M*v.
Definition: PxMat44.h:285
PX_CUDA_CALLABLE PX_INLINE PxMat44 & operator=(const PxMat44 &other)
Assignment operator.
Definition: PxMat44.h:173
PX_CUDA_CALLABLE PX_INLINE PxMat44(const PxMat44 &other)
Copy constructor.
Definition: PxMat44.h:167
PX_CUDA_CALLABLE PX_FORCE_INLINE const float * front() const
Definition: PxMat44.h:320
PX_CUDA_CALLABLE PX_INLINE const PxMat44 operator*(const PxMat44 &other) const
Matrix multiplication.
Definition: PxMat44.h:219
PX_CUDA_CALLABLE PX_INLINE const PxMat44 operator+(const PxMat44 &other) const
Add.
Definition: PxMat44.h:197
PxVec4 column3
Definition: PxMat44.h:357
3x3 matrix class
Definition: PxMat33.h:90
PX_CUDA_CALLABLE PxMat44(const PxVec4 &col0, const PxVec4 &col1, const PxVec4 &col2, const PxVec4 &col3)
Construct from four 4-vectors.
Definition: PxMat44.h:79
PX_CUDA_CALLABLE PX_INLINE const PxVec3 getBasis(int num) const
Definition: PxMat44.h:302
PX_CUDA_CALLABLE PX_INLINE const PxMat44 operator*(float scalar) const
Scalar multiplication.
Definition: PxMat44.h:211
PX_CUDA_CALLABLE PX_INLINE void PX_UNUSED(T const &)
Definition: PxPreprocessor.h:466
PX_CUDA_CALLABLE PX_INLINE PxMat44(float r)
constructor that generates a multiple of the identity matrix
Definition: PxMat44.h:85
PX_CUDA_CALLABLE PX_INLINE PxMat44(PxZERO r)
zero constructor
Definition: PxMat44.h:73
4 Element vector class.
Definition: PxVec4.h:49
PX_CUDA_CALLABLE PX_FORCE_INLINE float operator()(unsigned int row, unsigned int col) const
Element access, mathematical way!
Definition: PxMat44.h:267
PxVec4 column1
Definition: PxMat44.h:357
PxVec4 column0
Definition: PxMat44.h:357
float y
Definition: PxQuat.h:395
PX_CUDA_CALLABLE PX_INLINE const PxMat44 inverseRT(void) const
Definition: PxMat44.h:342
PxIDENTITY
Definition: Px.h:82
PX_CUDA_CALLABLE PxMat44(const PxMat33 &axes, const PxVec3 &position)
Construct from Mat33 and a translation.
Definition: PxMat44.h:148
PX_CUDA_CALLABLE PX_INLINE PxMat44()
Default constructor.
Definition: PxMat44.h:58
PX_CUDA_CALLABLE PX_INLINE PxMat44 & operator+=(const PxMat44 &other)
Equals-add.
Definition: PxMat44.h:230
PX_CUDA_CALLABLE PX_FORCE_INLINE const PxVec4 & operator[](unsigned int num) const
Definition: PxMat44.h:329
float y
Definition: PxVec4.h:363
float z
Definition: PxVec3.h:381
#define PX_INLINE
Definition: PxPreprocessor.h:336
#define PX_CUDA_CALLABLE
Definition: PxPreprocessor.h:460
PX_CUDA_CALLABLE PX_INLINE const PxMat44 getTranspose() const
Get transposed matrix.
Definition: PxMat44.h:183
3 Element vector class.
Definition: PxVec3.h:49
float x
Definition: PxVec4.h:363
PX_CUDA_CALLABLE PxMat44(const PxTransform &t)
Definition: PxMat44.h:153
float x
Definition: PxVec3.h:381