My Project
Public Member Functions | Protected Attributes | List of all members
ParaEngine::Sphere Class Reference

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

#include <ParaSphere.h>

Public Member Functions

 Sphere ()
 Standard constructor - creates a unit sphere around the origin. More...
 
 Sphere (const Vector3 &center, float radius)
 Constructor allowing arbitrary spheres. More...
 
float getRadius (void) const
 Returns the radius of the sphere. More...
 
void setRadius (float radius)
 Sets the radius of the sphere. More...
 
const Vector3getCenter (void) const
 Returns the center point of the sphere. More...
 
void setCenter (const Vector3 &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 AxisAlignedBox &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 Vector3 &v) const
 Returns whether or not this sphere intersects a point. More...
 

Protected Attributes

float mRadius
 
Vector3 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

§ Sphere() [1/2]

ParaEngine::Sphere::Sphere ( )
inline

Standard constructor - creates a unit sphere around the origin.

§ Sphere() [2/2]

ParaEngine::Sphere::Sphere ( const Vector3 center,
float  radius 
)
inline

Constructor allowing arbitrary spheres.

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

Member Function Documentation

§ getCenter()

const Vector3& ParaEngine::Sphere::getCenter ( void  ) const
inline

Returns the center point of the sphere.

§ getRadius()

float ParaEngine::Sphere::getRadius ( void  ) const
inline

Returns the radius of the sphere.

§ intersects() [1/4]

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

Returns whether or not this sphere intersects another sphere.

§ intersects() [2/4]

bool ParaEngine::Sphere::intersects ( const AxisAlignedBox box) const
inline

Returns whether or not this sphere intersects a box.

§ intersects() [3/4]

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

Returns whether or not this sphere intersects a plane.

§ intersects() [4/4]

bool ParaEngine::Sphere::intersects ( const Vector3 v) const
inline

Returns whether or not this sphere intersects a point.

§ setCenter()

void ParaEngine::Sphere::setCenter ( const Vector3 center)
inline

Sets the center point of the sphere.

§ setRadius()

void ParaEngine::Sphere::setRadius ( float  radius)
inline

Sets the radius of the sphere.


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