#include <BoundingSphere.h>
Public Member Functions | |
BoundingSphere () | |
BoundingSphere (const Vector3 ¢er, float radius) | |
BoundingSphere (const BoundingSphere ©) | |
~BoundingSphere () | |
bool | intersects (const BoundingSphere &sphere) const |
bool | intersects (const BoundingBox &box) const |
bool | intersects (const Frustum &frustum) const |
float | intersects (const Plane &plane) const |
float | intersects (const Ray &ray) const |
bool | isEmpty () const |
void | merge (const BoundingSphere &sphere) |
void | merge (const BoundingBox &box) |
void | set (const Vector3 ¢er, float radius) |
void | set (const BoundingSphere &sphere) |
void | set (const BoundingBox &box) |
void | transform (const Matrix &matrix) |
BoundingSphere & | operator*= (const Matrix &matrix) |
Static Public Member Functions | |
static const BoundingSphere & | empty () |
Public Attributes | |
Vector3 | center |
float | radius |
Defines a 3-dimensional bounding sphere.
Constructs a new bounding sphere initialized to all zeros.
gameplay::BoundingSphere::BoundingSphere | ( | const Vector3 & | center, |
float | radius | ||
) |
Constructs a new bounding sphere initialized to the specified values.
center | The center of the sphere. |
radius | The radius of the sphere. |
gameplay::BoundingSphere::BoundingSphere | ( | const BoundingSphere & | copy | ) |
Constructs a bounding sphere from the given bounding sphere.
copy | The bounding sphere to copy. |
Destructor.
static const BoundingSphere& gameplay::BoundingSphere::empty | ( | ) | [static] |
Returns an empty bounding sphere.
bool gameplay::BoundingSphere::intersects | ( | const BoundingSphere & | sphere | ) | const |
Tests whether this bounding sphere intersects the specified bounding sphere.
sphere | The bounding sphere to test intersection with. |
bool gameplay::BoundingSphere::intersects | ( | const BoundingBox & | box | ) | const |
Tests whether this bounding sphere intersects the specified bounding box.
box | The bounding box to test intersection with. |
bool gameplay::BoundingSphere::intersects | ( | const Frustum & | frustum | ) | const |
Tests whether this bounding sphere intersects the specified frustum.
frustum | The frustum to test intersection with. |
float gameplay::BoundingSphere::intersects | ( | const Plane & | plane | ) | const |
Tests whether this bounding sphere intersects the specified plane.
plane | The plane to test intersection with. |
float gameplay::BoundingSphere::intersects | ( | const Ray & | ray | ) | const |
Tests whether this bounding sphere intersects the specified ray.
ray | The ray to test intersection with. |
bool gameplay::BoundingSphere::isEmpty | ( | ) | const |
Determines if this bounding sphere is empty.
void gameplay::BoundingSphere::merge | ( | const BoundingSphere & | sphere | ) |
Sets this bounding sphere to the smallest bounding sphere that contains both this bounding sphere and the specified bounding sphere.
sphere | The bounding sphere to merge with. |
void gameplay::BoundingSphere::merge | ( | const BoundingBox & | box | ) |
Sets this bounding sphere to the smallest bounding sphere that contains both this bounding sphere and the specified bounding box.
box | The bounding box to merge with. |
BoundingSphere& gameplay::BoundingSphere::operator*= | ( | const Matrix & | matrix | ) | [inline] |
Transforms this bounding sphere by the given matrix.
matrix | The matrix to transform by. |
void gameplay::BoundingSphere::set | ( | const Vector3 & | center, |
float | radius | ||
) |
Sets this bounding sphere to the specified values.
center | The center of the sphere. |
radius | The radius of the sphere. |
void gameplay::BoundingSphere::set | ( | const BoundingSphere & | sphere | ) |
Sets this bounding sphere to the specified bounding sphere.
sphere | The bounding sphere to set to. |
void gameplay::BoundingSphere::set | ( | const BoundingBox & | box | ) |
Sets this bounding sphere to tightly contain the specified bounding box.
box | The box to contain. |
void gameplay::BoundingSphere::transform | ( | const Matrix & | matrix | ) |
Transforms the bounding sphere by the given transformation matrix.
matrix | The transformation matrix to transform by. |
The center point.
The sphere radius.