![]()  | 
  
    OGRE 14.4
    
   Object-Oriented Graphics Rendering Engine 
   | 
 
A sphere primitive, mostly used for bounds checking. More...
#include <OgreSphere.h>
Public Member Functions | |
| Sphere () | |
| Standard constructor - creates a unit sphere around the origin.   | |
| Sphere (const Vector3 ¢er, Real radius) | |
| Constructor allowing arbitrary spheres.   | |
| const Vector3 & | getCenter (void) const | 
| Returns the center point of the sphere.   | |
| Real | getRadius (void) const | 
| Returns the radius of the sphere.   | |
| bool | intersects (const AxisAlignedBox &box) const | 
| Returns whether or not this sphere intersects a box.   | |
| bool | intersects (const Plane &plane) const | 
| Returns whether or not this sphere intersects a plane.   | |
| bool | intersects (const Sphere &s) const | 
| Returns whether or not this sphere intersects another sphere.   | |
| bool | intersects (const Vector3 &v) const | 
| Returns whether or not this sphere intersects a point.   | |
| void | merge (const Sphere &oth) | 
| Merges another Sphere into the current sphere.   | |
| void | setCenter (const Vector3 ¢er) | 
| Sets the center point of the sphere.   | |
| void | setRadius (Real radius) | 
| Sets the radius of the sphere.   | |
A sphere primitive, mostly used for bounds checking.
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.
      
  | 
  inline | 
Standard constructor - creates a unit sphere around the origin.
Constructor allowing arbitrary spheres.
| center | The center point of the sphere. | 
| radius | The radius of the sphere. | 
Returns the center point of the sphere.
Returns whether or not this sphere intersects another sphere.
References Ogre::Math::Sqr().
      
  | 
  inline | 
Returns whether or not this sphere intersects a box.
References Ogre::Math::intersects().
Returns whether or not this sphere intersects a plane.
References Ogre::Math::Abs(), and Ogre::Plane::getDistance().
Returns whether or not this sphere intersects a point.
References Ogre::Math::Sqr().
Merges another Sphere into the current sphere.
References Ogre::Math::Sqr(), and Ogre::Math::Sqrt().