49 return mMin.GetX() <= mMax.GetX() && mMin.GetY() <= mMax.GetY() && mMin.GetZ() <= mMax.GetZ();
107 return 0.5f * (mMin + mMax);
113 return 0.5f * (mMax - mMin);
191 for (
int c = 0;
c < 3; ++
c)
227 template <
class VERTEX_ARRAY>
#define JPH_NAMESPACE_END
Definition Core.h:367
std::uint32_t uint32
Definition Core.h:442
#define JPH_NAMESPACE_BEGIN
Definition Core.h:361
Array< Float3 > VertexList
Definition Float3.h:43
AllocateFunction Allocate
Definition Memory.cpp:59
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
Axis aligned box.
Definition AABox.h:16
Vec3 GetExtent() const
Get extent of bounding box (half of the size)
Definition AABox.h:111
JPH_OVERRIDE_NEW_DELETE AABox()
Constructor.
Definition AABox.h:21
static AABox sBiggest()
Get bounding box of size 2 * FLT_MAX.
Definition AABox.h:30
void Translate(DVec3Arg inTranslation)
Translate bounding box.
Definition AABox.h:177
AABox Scaled(Vec3Arg inScale) const
Scale this bounding box, can handle non-uniform and negative scaling.
Definition AABox.h:215
bool Contains(Vec3Arg inOther) const
Check if this box contains a point.
Definition AABox.h:143
Vec3 GetSize() const
Get size of bounding box.
Definition AABox.h:117
void EnsureMinimalEdgeLength(float inMinEdgeLength)
Make sure that each edge of the bounding box has a minimal length.
Definition AABox.h:91
Vec3 mMin
Bounding box min and max.
Definition AABox.h:300
void SetEmpty()
Reset the bounding box to an empty bounding box.
Definition AABox.h:40
AABox Intersect(const AABox &inOther) const
Intersect this bounding box with inOther, returns the intersection.
Definition AABox.h:85
void ExpandBy(Vec3Arg inVector)
Widen the box on both sides by inVector.
Definition AABox.h:98
static AABox sFromTwoPoints(Vec3Arg inP1, Vec3Arg inP2)
Create box from 2 points.
Definition AABox.h:27
void Encapsulate(const AABox &inRHS)
Encapsulate bounding box in bounding box.
Definition AABox.h:60
AABox(Vec3Arg inMin, Vec3Arg inMax)
Definition AABox.h:22
void Encapsulate(const VertexList &inVertices, const IndexedTriangle &inTriangle)
Encapsulate triangle in bounding box.
Definition AABox.h:78
AABox Transformed(DMat44Arg inMatrix) const
Transform bounding box.
Definition AABox.h:207
void GetSupportingFace(Vec3Arg inDirection, VERTEX_ARRAY &outVertices) const
Get the vertices of the face that faces inDirection the most.
Definition AABox.h:228
float GetSqDistanceTo(Vec3Arg inPoint) const
Get the squared distance between inPoint and this box (will be 0 if in Point is inside the box)
Definition AABox.h:294
AABox(Vec3Arg inCenter, float inRadius)
Definition AABox.h:24
float GetVolume() const
Get volume of bounding box.
Definition AABox.h:130
Vec3 GetClosestPoint(Vec3Arg inPoint) const
Get the closest point on or in this box to inPoint.
Definition AABox.h:288
Vec3 GetSupport(Vec3Arg inDirection) const
Calculate the support vector for this convex shape.
Definition AABox.h:221
AABox Transformed(Mat44Arg inMatrix) const
Transform bounding box.
Definition AABox.h:184
bool Overlaps(const Plane &inPlane) const
Check if this box overlaps with a plane.
Definition AABox.h:161
bool Overlaps(const AABox &inOther) const
Check if this box overlaps with another box.
Definition AABox.h:155
AABox(DVec3Arg inMin, DVec3Arg inMax)
Definition AABox.h:23
float GetSurfaceArea() const
Get surface area of bounding box.
Definition AABox.h:123
void Translate(Vec3Arg inTranslation)
Translate bounding box.
Definition AABox.h:170
bool IsValid() const
Check if the bounding box is valid (max >= min)
Definition AABox.h:47
void Encapsulate(Vec3Arg inPos)
Encapsulate point in bounding box.
Definition AABox.h:53
Vec3 GetCenter() const
Get center of bounding box.
Definition AABox.h:105
bool Contains(const AABox &inOther) const
Check if this box contains another box.
Definition AABox.h:137
bool Contains(DVec3Arg inOther) const
Check if this box contains a point.
Definition AABox.h:149
void Encapsulate(const Triangle &inRHS)
Encapsulate triangle in bounding box.
Definition AABox.h:67
Vec3 mMax
Definition AABox.h:301
Holds a 4x4 matrix of floats with the last column consisting of doubles.
Definition DMat44.h:13
Triangle with 32-bit indices and material index.
Definition IndexedTriangle.h:73
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
An infinite plane described by the formula X . Normal + Constant = 0.
Definition Plane.h:11
A simple triangle and its material.
Definition Triangle.h:11
JPH_INLINE bool TestAnyXYZTrue() const
Test if any of X, Y or Z components are true (true is when highest bit of component is set)
Definition UVec4.inl:395
static JPH_INLINE UVec4 sAnd(UVec4Arg inV1, UVec4Arg inV2)
Logical and (component wise)
Definition UVec4.inl:194
static JPH_INLINE UVec4 sOr(UVec4Arg inV1, UVec4Arg inV2)
Logical or (component wise)
Definition UVec4.inl:166
JPH_INLINE bool TestAllXYZTrue() const
Test if X, Y and Z components are true (true is when highest bit of component is set)
Definition UVec4.inl:405
static JPH_INLINE Vec3 sMax(Vec3Arg inV1, Vec3Arg inV2)
Return the maximum of each of the components.
Definition Vec3.inl:159
static JPH_INLINE Vec3 sMin(Vec3Arg inV1, Vec3Arg inV2)
Return the minimum value of each of the components.
Definition Vec3.inl:146
JPH_INLINE float GetX() const
Get individual components.
Definition Vec3.h:123
static JPH_INLINE UVec4 sGreaterOrEqual(Vec3Arg inV1, Vec3Arg inV2)
Greater than or equal (component wise)
Definition Vec3.inl:237
static JPH_INLINE UVec4 sLessOrEqual(Vec3Arg inV1, Vec3Arg inV2)
Less than or equal (component wise)
Definition Vec3.inl:207
static JPH_INLINE UVec4 sGreater(Vec3Arg inV1, Vec3Arg inV2)
Greater than (component wise)
Definition Vec3.inl:222
static JPH_INLINE Vec3 sSelect(Vec3Arg inV1, Vec3Arg inV2, UVec4Arg inControl)
Component wise select, returns inV1 when highest bit of inControl = 0 and inV2 when highest bit of in...
Definition Vec3.inl:269
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:107
static JPH_INLINE UVec4 sLess(Vec3Arg inV1, Vec3Arg inV2)
Less than (component wise)
Definition Vec3.inl:192
static JPH_INLINE Vec3 sReplicate(float inV)
Replicate inV across all components.
Definition Vec3.inl:118
static JPH_INLINE Vec3 sLoadFloat3Unsafe(const Float3 &inV)
Load 3 floats from memory (reads 32 bits extra which it doesn't use)
Definition Vec3.inl:134