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. | |
Real | getRadius (void) const |
Returns the radius of the sphere. | |
void | setRadius (Real radius) |
Sets the radius of the sphere. | |
const Vector3 & | getCenter (void) const |
Returns the center point of the sphere. | |
void | setCenter (const Vector3 ¢er) |
Sets the center point of the sphere. | |
bool | intersects (const Sphere &s) const |
Returns whether or not this sphere intersects another 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 Vector3 &v) const |
Returns whether or not this sphere intersects a point. | |
void | merge (const Sphere &oth) |
Merges another Sphere into the current sphere. | |
Protected Attributes | |
Real | mRadius |
Vector3 | mCenter |
A sphere primitive, mostly used for bounds checking.
Definition at line 51 of file OgreSphere.h.
Ogre::Sphere::Sphere | ( | ) |
Standard constructor - creates a unit sphere around the origin.
Definition at line 58 of file OgreSphere.h.
Constructor allowing arbitrary spheres.
center | The center point of the sphere. | |
radius | The radius of the sphere. |
Definition at line 63 of file OgreSphere.h.
const Vector3& Ogre::Sphere::getCenter | ( | void | ) | const |
Returns the center point of the sphere.
Definition at line 73 of file OgreSphere.h.
Referenced by Ogre::PlaneBoundedVolume::intersects(), and merge().
Real Ogre::Sphere::getRadius | ( | void | ) | const |
Returns the radius of the sphere.
Definition at line 67 of file OgreSphere.h.
Referenced by Ogre::PlaneBoundedVolume::intersects(), and merge().
bool Ogre::Sphere::intersects | ( | const Vector3 & | v | ) | const |
Returns whether or not this sphere intersects a point.
Definition at line 95 of file OgreSphere.h.
References Ogre::Math::Sqr().
bool Ogre::Sphere::intersects | ( | const Plane & | plane | ) | const |
Returns whether or not this sphere intersects a plane.
Definition at line 90 of file OgreSphere.h.
References Ogre::Math::intersects().
bool Ogre::Sphere::intersects | ( | const AxisAlignedBox & | box | ) | const |
Returns whether or not this sphere intersects a box.
Definition at line 85 of file OgreSphere.h.
References Ogre::Math::intersects().
bool Ogre::Sphere::intersects | ( | const Sphere & | s | ) | const |
Returns whether or not this sphere intersects another sphere.
Definition at line 79 of file OgreSphere.h.
References mCenter, mRadius, Ogre::Math::Sqr(), and Ogre::Vector3::squaredLength().
void Ogre::Sphere::merge | ( | const Sphere & | oth | ) |
Merges another Sphere into the current sphere.
Definition at line 100 of file OgreSphere.h.
References getCenter(), getRadius(), Ogre::Math::Sqr(), Ogre::Math::Sqrt(), and Ogre::Vector3::squaredLength().
void Ogre::Sphere::setCenter | ( | const Vector3 & | center | ) |
Sets the center point of the sphere.
Definition at line 76 of file OgreSphere.h.
void Ogre::Sphere::setRadius | ( | Real | radius | ) |
Sets the radius of the sphere.
Definition at line 70 of file OgreSphere.h.
Vector3 Ogre::Sphere::mCenter [protected] |
Definition at line 55 of file OgreSphere.h.
Referenced by intersects().
Real Ogre::Sphere::mRadius [protected] |
Definition at line 54 of file OgreSphere.h.
Referenced by intersects().
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:40:41 2012