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

#include <BoundingSphere.h>

Public Member Functions

 BoundingSphere ()
 
 BoundingSphere (const BoundingSphere &bs)
 
void Calculate (Vector3D *v, const int numPoints)
 
void Translate (const Vector3D &v)
 
bool CollisionCheck (const BoundingSphere &bs)
 
bool CollisionCheck (const Vector3D &p1)
 
bool CollisionCheck (const Vector3D &p1, const Vector3D &p2, const Vector3D &p3)
 
bool CollisionCheck (const BoundingBox &aabb)
 

Public Attributes

Vector3D mCenter
 
float mRadius
 

Detailed Description

3D sphere with a center and radius.

Constructor & Destructor Documentation

◆ BoundingSphere() [1/2]

Ult::BoundingSphere::BoundingSphere ( )

BoundingSphere default constructor.

◆ BoundingSphere() [2/2]

Ult::BoundingSphere::BoundingSphere ( const BoundingSphere & bs)

BoundingSphere copy constructor.

Member Function Documentation

◆ Calculate()

void Ult::BoundingSphere::Calculate ( Vector3D * v,
const int numPoints )

Initialize the sphere to encapsulate all of the input points.

◆ CollisionCheck() [1/4]

bool Ult::BoundingSphere::CollisionCheck ( const BoundingBox & aabb)

Returns true if the input box overlaps this sphere.

◆ CollisionCheck() [2/4]

bool Ult::BoundingSphere::CollisionCheck ( const BoundingSphere & bs)

Returns true if the input sphere overlaps this sphere.

◆ CollisionCheck() [3/4]

bool Ult::BoundingSphere::CollisionCheck ( const Vector3D & p1)

Returns true if the input point is within this sphere.

◆ CollisionCheck() [4/4]

bool Ult::BoundingSphere::CollisionCheck ( const Vector3D & p1,
const Vector3D & p2,
const Vector3D & p3 )

Returns true if any of the input points are within this sphere.

◆ Translate()

void Ult::BoundingSphere::Translate ( const Vector3D & v)

Move the sphere's center by v.

Member Data Documentation

◆ mCenter

Vector3D Ult::BoundingSphere::mCenter

The center position if this sphere.

◆ mRadius

float Ult::BoundingSphere::mRadius

The radius of this sphere.


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