XII Release 0.1.0
Loading...
Searching...
No Matches
xiiBoundingBoxSphereTemplate< 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

 XII_DECLARE_POD_TYPE ()
 
 xiiBoundingBoxSphereTemplate ()
 Default constructor does not initialize anything.
 
 xiiBoundingBoxSphereTemplate (const xiiBoundingBoxSphereTemplate &rhs)
 
void operator= (const xiiBoundingBoxSphereTemplate &rhs)
 
 xiiBoundingBoxSphereTemplate (const xiiBoundingBoxTemplate< Type > &box)
 Constructs the bounds from the given box. The sphere radius is calculated from the box extends.
 
 xiiBoundingBoxSphereTemplate (const xiiBoundingSphereTemplate< 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 xiiBoundingBoxTemplate< Type > GetBox () const
 Returns the bounding box.
 
const xiiBoundingSphereTemplate< Type > GetSphere () const
 Returns the bounding sphere.
 
void ExpandToInclude (const xiiBoundingBoxSphereTemplate &rhs)
 Expands the bounds such that the given bounds are inside it.
 
void Transform (const xiiMat4Template< Type > &mTransform)
 Transforms the bounds in its local space.
 

Static Public Member Functions

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

Public Attributes

xiiVec3Template< Type > m_vCenter
 
Type m_fSphereRadius
 
xiiVec3Template< Type > m_vBoxHalfExtents
 

Detailed Description

template<typename Type>
class xiiBoundingBoxSphereTemplate< 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: