Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Ult::OBB Class Reference

#include <OBB.h>

Public Member Functions

 OBB ()
 
 OBB (const OBB &obb)
 
 OBB (const BoundingBox &aabb)
 
void Calculate (const Vector3D *vertices, const int numVerts)
 
void Calculate (const BoundingBox &aabb)
 
void Transform (const OBB &obb, const Matrix4x4 &mat)
 
void ObjectTransform (const OBB &obb, const Matrix4x4 &mat)
 
void ProjectionInterval (const Vector3D &axis, float &center, float &ext, float &min, float &max)
 
unsigned int GetSupport (const Vector3D &axis, Vector3D *contacts)
 
Vector3D GetFaceNormal (const int index) const
 
Vector3D GetEdgeDirection (const int index) const
 
Vector3D GetCenterPos () const
 
void SetCenter (const Vector3D &center)
 
float GetHalfAxis1 () const
 
float GetHalfAxis2 () const
 
float GetHalfAxis3 () const
 
float GetHalfAxis (const int index) const
 
void SetHalfAxis1 (const float val)
 
void SetHalfAxis2 (const float val)
 
void SetHalfAxis3 (const float val)
 
Vector3D GetAxis1 () const
 
Vector3D GetAxis2 () const
 
Vector3D GetAxis3 () const
 
Vector3D GetAxis (const int index) const
 
void SetAxis1 (const Vector3D &axis)
 
void SetAxis2 (const Vector3D &axis)
 
void SetAxis3 (const Vector3D &axis)
 

Public Attributes

Vector3D mCenter
 
float mHalfAxis1
 
float mHalfAxis2
 
float mHalfAxis3
 
Vector3D mAxis1
 
Vector3D mAxis2
 
Vector3D mAxis3
 

Detailed Description

Oriented Bounding Box

Constructor & Destructor Documentation

◆ OBB() [1/3]

Ult::OBB::OBB ( )

OBB constructor.

◆ OBB() [2/3]

Ult::OBB::OBB ( const OBB & obb)

OBB copy constructor.

◆ OBB() [3/3]

Ult::OBB::OBB ( const BoundingBox & aabb)

OBB constructor from an axis-aligned bounding box.

Member Function Documentation

◆ Calculate() [1/2]

void Ult::OBB::Calculate ( const BoundingBox & aabb)

Initialize the OBB from an axis-aligned bounding box.

◆ Calculate() [2/2]

void Ult::OBB::Calculate ( const Vector3D * vertices,
const int numVerts )

Initialize the OBB to encapsulate all of the input points.

◆ GetAxis()

Vector3D Ult::OBB::GetAxis ( const int index) const
inline

Returns the OBB axis at the given index.

◆ GetAxis1()

Vector3D Ult::OBB::GetAxis1 ( ) const
inline

Returns the first OBB axis.

◆ GetAxis2()

Vector3D Ult::OBB::GetAxis2 ( ) const
inline

Returns the second OBB axis.

◆ GetAxis3()

Vector3D Ult::OBB::GetAxis3 ( ) const
inline

Returns the third OBB axis.

◆ GetCenterPos()

Vector3D Ult::OBB::GetCenterPos ( ) const
inline

Returns the center point of this OBB.

◆ GetEdgeDirection()

Vector3D Ult::OBB::GetEdgeDirection ( const int index) const
inline

◆ GetFaceNormal()

Vector3D Ult::OBB::GetFaceNormal ( const int index) const
inline

Get the normal of the face at the given index.

◆ GetHalfAxis()

float Ult::OBB::GetHalfAxis ( const int index) const
inline

Returns the half-axis of the OBB at the given index.

◆ GetHalfAxis1()

float Ult::OBB::GetHalfAxis1 ( ) const
inline

Returns the first half-axis of the OBB.

◆ GetHalfAxis2()

float Ult::OBB::GetHalfAxis2 ( ) const
inline

Returns the second half-axis of the OBB.

◆ GetHalfAxis3()

float Ult::OBB::GetHalfAxis3 ( ) const
inline

Returns the third half-axis of the OBB.

◆ GetSupport()

unsigned int Ult::OBB::GetSupport ( const Vector3D & axis,
Vector3D * contacts )

Calculate the number of and contact points and store them in contacts. Returns the number of contact points (up to 4, so contacts must be at least length 4).

◆ ObjectTransform()

void Ult::OBB::ObjectTransform ( const OBB & obb,
const Matrix4x4 & mat )

Translate and rotate the OBB using the inverse input matrix, including translation for the OBB axes, and store the result in this OBB.

◆ ProjectionInterval()

void Ult::OBB::ProjectionInterval ( const Vector3D & axis,
float & center,
float & ext,
float & min,
float & max )

Calculate the projection inverval of the input axis with this OBB and store the results in center, ext, min, max.

◆ SetAxis1()

void Ult::OBB::SetAxis1 ( const Vector3D & axis)
inline

Sets the first OBB axis.

◆ SetAxis2()

void Ult::OBB::SetAxis2 ( const Vector3D & axis)
inline

Sets the second OBB axis.

◆ SetAxis3()

void Ult::OBB::SetAxis3 ( const Vector3D & axis)
inline

Sets the third OBB axis.

◆ SetCenter()

void Ult::OBB::SetCenter ( const Vector3D & center)
inline

Sets the center point of this OBB

◆ SetHalfAxis1()

void Ult::OBB::SetHalfAxis1 ( const float val)
inline

Sets the first half-axis of this OBB.

◆ SetHalfAxis2()

void Ult::OBB::SetHalfAxis2 ( const float val)
inline

Sets the second half-axis of this OBB.

◆ SetHalfAxis3()

void Ult::OBB::SetHalfAxis3 ( const float val)
inline

Sets the third half-axis of this OBB.

◆ Transform()

void Ult::OBB::Transform ( const OBB & obb,
const Matrix4x4 & mat )

Translate and rotate the OBB using the input matrix and store the result in this OBB.

Member Data Documentation

◆ mAxis1

Vector3D Ult::OBB::mAxis1

The axes of the OBB.

◆ mAxis2

Vector3D Ult::OBB::mAxis2

◆ mAxis3

Vector3D Ult::OBB::mAxis3

◆ mCenter

Vector3D Ult::OBB::mCenter

The center point of the OBB.

◆ mHalfAxis1

float Ult::OBB::mHalfAxis1

The half-axis values of the OBB.

◆ mHalfAxis2

float Ult::OBB::mHalfAxis2

◆ mHalfAxis3

float Ult::OBB::mHalfAxis3

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