36#include "foundation/PxTransform.h"
37#include "foundation/PxMat33.h"
38#include "common/PxPhysXCommonConfig.h"
46 PX_PHYSX_COMMON_API
void computeOBBPoints(PxVec3*
PX_RESTRICT pts,
const PxVec3& center,
const PxVec3& extents,
const PxVec3& base0,
const PxVec3& base1,
const PxVec3& base2);
69 #pragma warning( disable : 4251 )
71 class PX_PHYSX_COMMON_API
Box
107 center = other.center;
108 extents = other.extents;
118 extents =
PxVec3(-PX_MAX_REAL, -PX_MAX_REAL, -PX_MAX_REAL);
130 if(extents.x < 0.0f)
return false;
131 if(extents.y < 0.0f)
return false;
132 if(extents.z < 0.0f)
return false;
151 return rot.transformTranspose(src);
156 return rot * src + center;
161 return PxTransform(center, PxQuat(rot));
164 PX_INLINE PxVec3 computeAABBExtent()
const
166 const PxReal a00 =
PxAbs(rot[0][0]);
167 const PxReal a01 =
PxAbs(rot[0][1]);
168 const PxReal a02 =
PxAbs(rot[0][2]);
170 const PxReal a10 =
PxAbs(rot[1][0]);
171 const PxReal a11 =
PxAbs(rot[1][1]);
172 const PxReal a12 =
PxAbs(rot[1][2]);
174 const PxReal a20 =
PxAbs(rot[2][0]);
175 const PxReal a21 =
PxAbs(rot[2][1]);
176 const PxReal a22 =
PxAbs(rot[2][2]);
178 const PxReal ex = extents.x;
179 const PxReal ey = extents.y;
180 const PxReal ez = extents.z;
182 return PxVec3( a00 * ex + a10 * ey + a20 * ez,
183 a01 * ex + a11 * ey + a21 * ez,
184 a02 * ex + a12 * ey + a22 * ez);
193 Gu::computeOBBPoints(pts, center, extents, rot.column0, rot.column1, rot.column2);
A padded version of Gu::Box, to safely load its data using SIMD.
Definition GuBox.h:206
Represents an oriented bounding box.
Definition GuBox.h:72
PX_INLINE bool isValid() const
Checks the box is valid.
Definition GuBox.h:127
PX_FORCE_INLINE ~Box()
Destructor.
Definition GuBox.h:99
PX_FORCE_INLINE Box(const PxVec3 &origin, const PxVec3 &extent, const PxMat33 &base)
Constructor.
Definition GuBox.h:89
PX_FORCE_INLINE Box()
Constructor.
Definition GuBox.h:77
PX_FORCE_INLINE void computeBoxPoints(PxVec3 *PX_RESTRICT pts) const
Definition GuBox.h:191
PX_INLINE void setEmpty()
Setups an empty box.
Definition GuBox.h:115
PX_FORCE_INLINE Box(const Box &other)
Copy constructor.
Definition GuBox.h:93
PX_FORCE_INLINE const Box & operator=(const Box &other)
Assignment operator.
Definition GuBox.h:104
Represents a capsule.
Definition GuCapsule.h:47
3x3 matrix class
Definition PxMat33.h:91
3 Element vector class.
Definition PxVec3.h:50
#define PX_RESTRICT
Definition PxPreprocessor.h:355
#define PX_FORCE_INLINE
Definition PxPreprocessor.h:335
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
#define PX_INLINE
Definition PxPreprocessor.h:320
transform(pattern)
Definition docopt.py:72
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
PX_CUDA_CALLABLE PX_FORCE_INLINE float PxAbs(float a)
abs returns the absolute value of its argument.
Definition PxMath.h:109