omegalib  13.1
omicron::Sphere Class Reference

A sphere primitive, mostly used for bounds checking. More...

#include <Sphere.h>

Public Member Functions

 Sphere ()
 Standard constructor - creates a unit sphere around the origin. More...
 
 Sphere (const Vector3f &center, real radius)
 Constructor allowing arbitrary spheres. More...
 
real getRadius (void) const
 Returns the radius of the sphere. More...
 
void setRadius (real radius)
 Sets the radius of the sphere. More...
 
const Vector3fgetCenter (void) const
 Returns the center point of the sphere. More...
 
void setCenter (const Vector3f &center)
 Sets the center point of the sphere. More...
 
bool intersects (const Sphere &s) const
 Returns whether or not this sphere intersects another sphere. More...
 
bool intersects (const AlignedBox3 &box) const
 Returns whether or not this sphere intersects a box. More...
 
bool intersects (const Plane &plane) const
 Returns whether or not this sphere intersects a plane. More...
 
bool intersects (const Vector3f &v) const
 Returns whether or not this sphere intersects a point. More...
 

Protected Attributes

real mRadius
 
Vector3f mCenter
 

Detailed Description

A sphere primitive, mostly used for bounds checking.

Remarks
A sphere in math texts is normally represented by the function x^2 + y^2 + z^2 = r^2 (for sphere's centered on the origin). Ogre stores spheres simply as a center point and a radius.

Constructor & Destructor Documentation

omicron::Sphere::Sphere ( )
inline

Standard constructor - creates a unit sphere around the origin.

omicron::Sphere::Sphere ( const Vector3f center,
real  radius 
)
inline

Constructor allowing arbitrary spheres.

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

Member Function Documentation

const Vector3f& omicron::Sphere::getCenter ( void  ) const
inline

Returns the center point of the sphere.

real omicron::Sphere::getRadius ( void  ) const
inline

Returns the radius of the sphere.

bool omicron::Sphere::intersects ( const Sphere s) const
inline

Returns whether or not this sphere intersects another sphere.

bool omicron::Sphere::intersects ( const AlignedBox3 box) const
inline

Returns whether or not this sphere intersects a box.

bool omicron::Sphere::intersects ( const Plane plane) const
inline

Returns whether or not this sphere intersects a plane.

bool omicron::Sphere::intersects ( const Vector3f v) const
inline

Returns whether or not this sphere intersects a point.

void omicron::Sphere::setCenter ( const Vector3f center)
inline

Sets the center point of the sphere.

void omicron::Sphere::setRadius ( real  radius)
inline

Sets the radius of the sphere.

Member Data Documentation

Vector3f omicron::Sphere::mCenter
protected
real omicron::Sphere::mRadius
protected

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