ezEngine  Release 25.03
ezBoundingBoxSphereTemplate< 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

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

Static Public Member Functions

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

Public Attributes

ezVec3Template< Type > m_vCenter
 
Type m_fSphereRadius
 
ezVec3Template< Type > m_vBoxHalfExtents
 

Detailed Description

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