Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::Sphere Class Reference

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

#include <OgreSphere.h>

List of all members.

Public Methods

 Sphere ()
 Standard constructor - creates a unit sphere around the origin. More...

 Sphere (const Vector3 &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...

Vector3 getCenter (void) const
 Returns the center point of the sphere. More...

void setCenter (const Vector3 &center)
 Sets the center point of the sphere. More...


Protected Attributes

Real 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

Ogre::Sphere::Sphere   [inline]
 

Standard constructor - creates a unit sphere around the origin.

Ogre::Sphere::Sphere const Vector3   center,
Real    radius
[inline]
 

Constructor allowing arbitrary spheres.

Parameters:
center  The center point of the sphere.
radius  The radius of the sphere.


Member Function Documentation

Vector3 Ogre::Sphere::getCenter void    const [inline]
 

Returns the center point of the sphere.

Real Ogre::Sphere::getRadius void    const [inline]
 

Returns the radius of the sphere.

void Ogre::Sphere::setCenter const Vector3   center [inline]
 

Sets the center point of the sphere.

void Ogre::Sphere::setRadius Real    radius [inline]
 

Sets the radius of the sphere.


Member Data Documentation

Vector3 Ogre::Sphere::mCenter [protected]
 

Real Ogre::Sphere::mRadius [protected]
 

Copyright © 2002 by The OGRE Team