overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions | Public Attributes
gameplay::BoundingSphere Class Reference

#include <BoundingSphere.h>

List of all members.

Public Member Functions

 BoundingSphere ()
 BoundingSphere (const Vector3 &center, float radius)
 BoundingSphere (const BoundingSphere &copy)
 ~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 &center, float radius)
void set (const BoundingSphere &sphere)
void set (const BoundingBox &box)
void transform (const Matrix &matrix)
BoundingSphereoperator*= (const Matrix &matrix)

Static Public Member Functions

static const BoundingSphereempty ()

Public Attributes

Vector3 center
float radius

Detailed Description

Defines a 3-dimensional bounding sphere.


Constructor & Destructor Documentation

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.

Parameters:
centerThe center of the sphere.
radiusThe radius of the sphere.

Constructs a bounding sphere from the given bounding sphere.

Parameters:
copyThe bounding sphere to copy.

Destructor.


Member Function Documentation

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.

Parameters:
sphereThe bounding sphere to test intersection with.
Returns:
true if the specified bounding sphere intersects this bounding sphere; false otherwise.

Tests whether this bounding sphere intersects the specified bounding box.

Parameters:
boxThe bounding box to test intersection with.
Returns:
true if the specified bounding box intersects this bounding sphere; false otherwise.
bool gameplay::BoundingSphere::intersects ( const Frustum frustum) const

Tests whether this bounding sphere intersects the specified frustum.

Parameters:
frustumThe frustum to test intersection with.
Returns:
true if this bounding sphere intersects the specified frustum; false otherwise.
float gameplay::BoundingSphere::intersects ( const Plane plane) const

Tests whether this bounding sphere intersects the specified plane.

Parameters:
planeThe plane to test intersection with.
Returns:
Plane::INTERSECTS_BACK INTERSECTS_BACK if this bounding sphere is in the negative half-space of the plane, Plane::INTERSECTS_FRONT INTERSECTS_FRONT if it is in the positive half-space of the plane, and Plane::INTERSECTS_INTERSECTING INTERSECTS_INTERSECTING if it intersects the plane.
float gameplay::BoundingSphere::intersects ( const Ray ray) const

Tests whether this bounding sphere intersects the specified ray.

Parameters:
rayThe ray to test intersection with.
Returns:
The distance from the origin of the ray to this bounding sphere or Ray::INTERSECTS_NONE INTERSECTS_NONE if the ray does not intersect this bounding sphere.

Determines if this bounding sphere is empty.

Returns:
true if this bounding sphere is empty; false otherwise.

Sets this bounding sphere to the smallest bounding sphere that contains both this bounding sphere and the specified bounding sphere.

Parameters:
sphereThe bounding sphere to merge with.

Sets this bounding sphere to the smallest bounding sphere that contains both this bounding sphere and the specified bounding box.

Parameters:
boxThe bounding box to merge with.
BoundingSphere& gameplay::BoundingSphere::operator*= ( const Matrix matrix) [inline]

Transforms this bounding sphere by the given matrix.

Parameters:
matrixThe matrix to transform by.
Returns:
This bounding sphere, after the transformation occurs.
void gameplay::BoundingSphere::set ( const Vector3 center,
float  radius 
)

Sets this bounding sphere to the specified values.

Parameters:
centerThe center of the sphere.
radiusThe radius of the sphere.

Sets this bounding sphere to the specified bounding sphere.

Parameters:
sphereThe bounding sphere to set to.

Sets this bounding sphere to tightly contain the specified bounding box.

Parameters:
boxThe box to contain.
void gameplay::BoundingSphere::transform ( const Matrix matrix)

Transforms the bounding sphere by the given transformation matrix.

Parameters:
matrixThe transformation matrix to transform by.

Member Data Documentation

The center point.

The sphere radius.

 All Classes Functions Variables Typedefs Enumerations Enumerator