Plasma Engine  2.0
Loading...
Searching...
No Matches
plBoundingBoxSphereTemplate< Type > Class Template Reference

A combination of a bounding box and a bounding sphere with the same center. More...

#include <BoundingBoxSphere.h>

Public Types

using ComponentType = Type
 

Public Member Functions

 PL_DECLARE_POD_TYPE ()
 
 plBoundingBoxSphereTemplate ()
 Default constructor does not initialize anything.
 
 plBoundingBoxSphereTemplate (const plBoundingBoxSphereTemplate &rhs)
 
void operator= (const plBoundingBoxSphereTemplate &rhs)
 
 plBoundingBoxSphereTemplate (const plBoundingBoxTemplate< Type > &box)
 Constructs the bounds from the given box. The sphere radius is calculated from the box extends.
 
 plBoundingBoxSphereTemplate (const plBoundingSphereTemplate< Type > &sphere)
 Constructs the bounds from the given sphere. The box extends are calculated from the sphere radius.
 
bool IsValid () const
 Checks whether the bounds is in an invalid state.
 
bool IsNaN () const
 Checks whether any component is NaN.
 
const plBoundingBoxTemplate< Type > GetBox () const
 Returns the bounding box.
 
const plBoundingSphereTemplate< Type > GetSphere () const
 Returns the bounding sphere.
 
void ExpandToInclude (const plBoundingBoxSphereTemplate &rhs)
 Expands the bounds such that the given bounds are inside it.
 
void Transform (const plMat4Template< Type > &mTransform)
 Transforms the bounds in its local space.
 

Static Public Member Functions

static plBoundingBoxSphereTemplate< Type > MakeZero ()
 Creates an object with all zero values. These are valid bounds around the origin with no volume.
 
static plBoundingBoxSphereTemplate< Type > MakeInvalid ()
 Creates an 'invalid' object, ie one with negative extents/radius. Invalid objects can be made valid through ExpandToInclude().
 
static plBoundingBoxSphereTemplate< Type > MakeFromCenterExtents (const plVec3Template< Type > &vCenter, const plVec3Template< Type > &vBoxHalfExtents, Type fSphereRadius)
 Creates an object from the given center point and extents.
 
static plBoundingBoxSphereTemplate< Type > MakeFromPoints (const plVec3Template< Type > *pPoints, plUInt32 uiNumPoints, plUInt32 uiStride=sizeof(plVec3Template< Type >))
 Creates an object that contains all the provided points.
 
static plBoundingBoxSphereTemplate< Type > MakeFromBox (const plBoundingBoxTemplate< Type > &box)
 Creates an object from another bounding box.
 
static plBoundingBoxSphereTemplate< Type > MakeFromSphere (const plBoundingSphereTemplate< Type > &sphere)
 Creates an object from another bounding sphere.
 
static plBoundingBoxSphereTemplate< Type > MakeFromBoxAndSphere (const plBoundingBoxTemplate< Type > &box, const plBoundingSphereTemplate< Type > &sphere)
 Creates an object from another bounding box and a sphere.
 

Public Attributes

plVec3Template< Type > m_vCenter
 
Type m_fSphereRadius
 
plVec3Template< Type > m_vBoxHalfExtends
 

Detailed Description

template<typename Type>
class plBoundingBoxSphereTemplate< Type >

A combination of a bounding box and a bounding sphere with the same center.

This class uses less memory than storying a bounding box and sphere separate.


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