|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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)
BoundingSphere & | operator*= (const Matrix &matrix)

## Static Public Member Functions

static const BoundingSphere & | empty ()

## Public Attributes

Vector3 | center
float | radius

## Detailed Description

Defines a 3-dimensional bounding sphere.

## Constructor & Destructor Documentation

gameplay::BoundingSphere::BoundingSphere | ( |  | ) |

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:

  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.

Parameters:

  copy | The bounding sphere to copy.

gameplay::BoundingSphere::~BoundingSphere | ( |  | ) |

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:

  sphere | The bounding sphere to test intersection with.

Returns:
  true if the specified bounding sphere intersects this bounding sphere; false otherwise.

bool gameplay::BoundingSphere::intersects | ( | const BoundingBox & | box | ) | const

Tests whether this bounding sphere intersects the specified bounding box.

Parameters:

  box | The 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:

  frustum | The 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:

  plane | The 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:

  ray | The 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.

bool gameplay::BoundingSphere::isEmpty | ( |  | ) | const

Determines if this bounding sphere is empty.

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

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.

Parameters:

  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.

Parameters:

  box | The bounding box to merge with.

BoundingSphere& gameplay::BoundingSphere::operator*= | ( | const Matrix & | matrix | ) | `[inline]`

Transforms this bounding sphere by the given matrix.

Parameters:

  matrix | The 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:

  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.

Parameters:

  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.

Parameters:

  box | The box to contain.

void gameplay::BoundingSphere::transform | ( | const Matrix & | matrix | ) |

Transforms the bounding sphere by the given transformation matrix.

Parameters:

  matrix | The transformation matrix to transform by.

## Member Data Documentation

Vector3 gameplay::BoundingSphere::center

The center point.

float gameplay::BoundingSphere::radius

The sphere radius.

All Classes Functions Variables Typedefs Enumerations Enumerator