ezEngine  Release 25.03
ezSimdBBox Class Reference

Public Member Functions

 EZ_DECLARE_POD_TYPE ()
 
 ezSimdBBox ()
 Default constructor does not initialize anything.
 
 ezSimdBBox (const ezSimdVec4f &vMin, const ezSimdVec4f &vMax)
 Constructs the box with the given minimum and maximum values.
 
void SetInvalid ()
 Resets the box to an invalid state. ExpandToInclude can then be used to make it into a bounding box for objects.
 
void SetCenterAndHalfExtents (const ezSimdVec4f &vCenter, const ezSimdVec4f &vHalfExtents)
 Sets the box from a center point and half-extents for each axis.
 
void SetFromPoints (const ezSimdVec4f *pPoints, ezUInt32 uiNumPoints, ezUInt32 uiStride=sizeof(ezSimdVec4f))
 Creates a new bounding-box around the given set of points.
 
bool IsValid () const
 Checks whether the box is in an invalid state.
 
bool IsNaN () const
 Checks whether any component is NaN.
 
ezSimdVec4f GetCenter () const
 Returns the center position of the box.
 
ezSimdVec4f GetExtents () const
 Returns the extents of the box along each axis.
 
ezSimdVec4f GetHalfExtents () const
 Returns the half extents of the box along each axis.
 
void ExpandToInclude (const ezSimdVec4f &vPoint)
 Expands the box such that the given point is inside it.
 
void ExpandToInclude (const ezSimdVec4f *pPoints, ezUInt32 uiNumPoints, ezUInt32 uiStride=sizeof(ezSimdVec4f))
 Expands the box such that all the given points are inside it.
 
void ExpandToInclude (const ezSimdBBox &rhs)
 Expands the box such that the given box is inside it.
 
void ExpandToCube ()
 If the box is not cubic all extents are set to the value of the maximum extent, such that the box becomes cubic.
 
bool Contains (const ezSimdVec4f &vPoint) const
 Checks whether the given point is inside the box.
 
bool Contains (const ezSimdBBox &rhs) const
 Checks whether the given box is completely inside this box.
 
bool Contains (const ezSimdBSphere &sphere) const
 Checks whether the given sphere is completely inside this box.
 
bool Overlaps (const ezSimdBBox &rhs) const
 Checks whether this box overlaps with the given box.
 
bool Overlaps (const ezSimdBSphere &sphere) const
 Checks whether the given sphere overlaps with this box.
 
void Grow (const ezSimdVec4f &vDiff)
 Will increase the size of the box in all directions by the given amount (per axis).
 
void Translate (const ezSimdVec4f &vDiff)
 Moves the box by the given vector.
 
void Transform (const ezSimdTransform &transform)
 Transforms the corners of the box and recomputes the aabb of those transformed points.
 
void Transform (const ezSimdMat4f &mMat)
 Transforms the corners of the box and recomputes the aabb of those transformed points.
 
ezSimdVec4f GetClampedPoint (const ezSimdVec4f &vPoint) const
 The given point is clamped to the volume of the box, i.e. it will be either inside the box or on its surface and it will have the closest possible distance to the original point.
 
ezSimdFloat GetDistanceSquaredTo (const ezSimdVec4f &vPoint) const
 Returns the squared minimum distance from the box's surface to the point. Zero if the point is inside the box.
 
ezSimdFloat GetDistanceTo (const ezSimdVec4f &vPoint) const
 Returns the minimum distance from the box's surface to the point. Zero if the point is inside the box.
 
bool operator== (const ezSimdBBox &rhs) const
 
bool operator!= (const ezSimdBBox &rhs) const
 

Static Public Member Functions

static ezSimdBBox MakeZero ()
 Creates a box that is located at the origin and has zero size. This is a 'valid' box.
 
static ezSimdBBox MakeInvalid ()
 Creates a box that is in an invalid state. ExpandToInclude can then be used to make it into a bounding box for objects.
 
static ezSimdBBox MakeFromCenterAndHalfExtents (const ezSimdVec4f &vCenter, const ezSimdVec4f &vHalfExtents)
 Creates a box from a center point and half-extents for each axis.
 
static ezSimdBBox MakeFromMinMax (const ezSimdVec4f &vMin, const ezSimdVec4f &vMax)
 Creates a box with the given minimum and maximum values.
 
static ezSimdBBox MakeFromPoints (const ezSimdVec4f *pPoints, ezUInt32 uiNumPoints, ezUInt32 uiStride=sizeof(ezSimdVec4f))
 Creates a box around the given set of points. If uiNumPoints is zero, the returned box is invalid (same as MakeInvalid() returns).
 

Public Attributes

ezSimdVec4f m_Min
 
ezSimdVec4f m_Max
 

The documentation for this class was generated from the following files: