Cyclone Cyclone: cyclone::BoundingSphere Struct Reference

cyclone::BoundingSphere Struct Reference

Represents a bounding sphere that can be tested for overlap. More...

#include <collide_coarse.h>

Collaboration diagram for cyclone::BoundingSphere:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BoundingSphere (const Vector3 &centre, real radius)
 Creates a new bounding sphere at the given centre and radius.
 BoundingSphere (const BoundingSphere &one, const BoundingSphere &two)
 Creates a bounding sphere to enclose the two given bounding spheres.
bool overlaps (const BoundingSphere *other) const
 Checks if the bounding sphere overlaps with the other given bounding sphere.SphereBVHOverlap.
real getGrowth (const BoundingSphere &other) const
 Reports how much this bounding sphere would have to grow by to incorporate the given bounding sphere.
real getSize () const
 Returns the volume of this bounding volume.

Public Attributes

Vector3 centre
real radius

Detailed Description

Represents a bounding sphere that can be tested for overlap.


Constructor & Destructor Documentation

cyclone::BoundingSphere::BoundingSphere const Vector3 centre,
real  radius
 

Creates a new bounding sphere at the given centre and radius.

cyclone::BoundingSphere::BoundingSphere const BoundingSphere one,
const BoundingSphere two
 

Creates a bounding sphere to enclose the two given bounding spheres.


Member Function Documentation

real cyclone::BoundingSphere::getGrowth const BoundingSphere other  )  const
 

Reports how much this bounding sphere would have to grow by to incorporate the given bounding sphere.

Note that this calculation returns a value not in any particular units (i.e. its not a volume growth). In fact the best implementation takes into account the growth in surface area (after the Goldsmith-Salmon algorithm for tree construction).

real cyclone::BoundingSphere::getSize  )  const [inline]
 

Returns the volume of this bounding volume.

This is used to calculate how to recurse into the bounding volume tree. For a bounding sphere it is a simple calculation.

bool cyclone::BoundingSphere::overlaps const BoundingSphere other  )  const
 

Checks if the bounding sphere overlaps with the other given bounding sphere.SphereBVHOverlap.


Member Data Documentation

Vector3 cyclone::BoundingSphere::centre
 

real cyclone::BoundingSphere::radius
 


The documentation for this struct was generated from the following file: