Plasma Engine  2.0
Loading...
Searching...
No Matches
plSimdBBox Class Reference

Public Member Functions

 PL_DECLARE_POD_TYPE ()
 
 plSimdBBox ()
 Default constructor does not initialize anything.
 
 plSimdBBox (const plSimdVec4f &vMin, const plSimdVec4f &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 plSimdVec4f &vCenter, const plSimdVec4f &vHalfExtents)
 Sets the box from a center point and half-extents for each axis.
 
void SetFromPoints (const plSimdVec4f *pPoints, plUInt32 uiNumPoints, plUInt32 uiStride=sizeof(plSimdVec4f))
 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.
 
plSimdVec4f GetCenter () const
 Returns the center position of the box.
 
plSimdVec4f GetExtents () const
 Returns the extents of the box along each axis.
 
plSimdVec4f GetHalfExtents () const
 Returns the half extents of the box along each axis.
 
void ExpandToInclude (const plSimdVec4f &vPoint)
 Expands the box such that the given point is inside it.
 
void ExpandToInclude (const plSimdVec4f *pPoints, plUInt32 uiNumPoints, plUInt32 uiStride=sizeof(plSimdVec4f))
 Expands the box such that all the given points are inside it.
 
void ExpandToInclude (const plSimdBBox &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 plSimdVec4f &vPoint) const
 Checks whether the given point is inside the box.
 
bool Contains (const plSimdBBox &rhs) const
 Checks whether the given box is completely inside this box.
 
bool Contains (const plSimdBSphere &sphere) const
 Checks whether the given sphere is completely inside this box.
 
bool Overlaps (const plSimdBBox &rhs) const
 Checks whether this box overlaps with the given box.
 
bool Overlaps (const plSimdBSphere &sphere) const
 Checks whether the given sphere overlaps with this box.
 
void Grow (const plSimdVec4f &vDiff)
 Will increase the size of the box in all directions by the given amount (per axis).
 
void Translate (const plSimdVec4f &vDiff)
 Moves the box by the given vector.
 
void Transform (const plSimdTransform &transform)
 Transforms the corners of the box and recomputes the aabb of those transformed points.
 
void Transform (const plSimdMat4f &mMat)
 Transforms the corners of the box and recomputes the aabb of those transformed points.
 
plSimdVec4f GetClampedPoint (const plSimdVec4f &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.
 
plSimdFloat GetDistanceSquaredTo (const plSimdVec4f &vPoint) const
 Returns the squared minimum distance from the box's surface to the point. Zero if the point is inside the box.
 
plSimdFloat GetDistanceTo (const plSimdVec4f &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 plSimdBBox &rhs) const
 
bool operator!= (const plSimdBBox &rhs) const
 

Static Public Member Functions

static plSimdBBox MakeZero ()
 Creates a box that is located at the origin and has zero size. This is a 'valid' box.
 
static plSimdBBox 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 plSimdBBox MakeFromCenterAndHalfExtents (const plSimdVec4f &vCenter, const plSimdVec4f &vHalfExtents)
 Creates a box from a center point and half-extents for each axis.
 
static plSimdBBox MakeFromMinMax (const plSimdVec4f &vMin, const plSimdVec4f &vMax)
 Creates a box with the given minimum and maximum values.
 
static plSimdBBox MakeFromPoints (const plSimdVec4f *pPoints, plUInt32 uiNumPoints, plUInt32 uiStride=sizeof(plSimdVec4f))
 Creates a box around the given set of points. If uiNumPoints is zero, the returned box is invalid (same as MakeInvalid() returns).
 

Public Attributes

plSimdVec4f m_Min
 
plSimdVec4f m_Max
 

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