<html> <head> <title>Ogre::Sphere class Reference - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link type="text/css" rel="stylesheet" href="style.css"> </head> <body> <!-- Generated by Doxygen 1.2.16 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>Ogre::Sphere Class Reference</h1>A sphere primitive, mostly used for bounds checking. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>></code> <p> Collaboration diagram for Ogre::Sphere:<p><center><img src="classOgre_1_1Sphere__coll__graph.png" border="0" usemap="#Ogre_1_1Sphere__coll__map" alt="Collaboration graph"></center> <map name="Ogre_1_1Sphere__coll__map"> <area href="classOgre_1_1Vector3.html" shape="rect" coords="7,36,100,17" alt=""> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classOgre_1_1Sphere-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea0">Sphere</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Standard constructor - creates a unit sphere around the origin.</em> <a href="#Ogre_1_1Spherea0"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea1">Sphere</a> (const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> &center, <a class="el" href="namespaceOgre.html#a349">Real</a> radius)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor allowing arbitrary spheres.</em> <a href="#Ogre_1_1Spherea1"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea2">getRadius</a> (void) const</td></tr> <tr><td> </td><td><font size=-1><em>Returns the radius of the sphere.</em> <a href="#Ogre_1_1Spherea2"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea3">setRadius</a> (<a class="el" href="namespaceOgre.html#a349">Real</a> radius)</td></tr> <tr><td> </td><td><font size=-1><em>Sets the radius of the sphere.</em> <a href="#Ogre_1_1Spherea3"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> & </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea4">getCenter</a> (void) const</td></tr> <tr><td> </td><td><font size=-1><em>Returns the center point of the sphere.</em> <a href="#Ogre_1_1Spherea4"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea5">setCenter</a> (const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> &center)</td></tr> <tr><td> </td><td><font size=-1><em>Sets the center point of the sphere.</em> <a href="#Ogre_1_1Spherea5"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea6">intersects</a> (const Sphere &s) const</td></tr> <tr><td> </td><td><font size=-1><em>Returns whether or not this sphere interects another sphere.</em> <a href="#Ogre_1_1Spherea6"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea7">intersects</a> (const <a class="el" href="classOgre_1_1AxisAlignedBox.html">AxisAlignedBox</a> &box) const</td></tr> <tr><td> </td><td><font size=-1><em>Returns whether or not this sphere interects a box.</em> <a href="#Ogre_1_1Spherea7"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea8">intersects</a> (const <a class="el" href="classOgre_1_1Plane.html">Plane</a> &plane) const</td></tr> <tr><td> </td><td><font size=-1><em>Returns whether or not this sphere interects a plane.</em> <a href="#Ogre_1_1Spherea8"></a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spherea9">intersects</a> (const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> &v) const</td></tr> <tr><td> </td><td><font size=-1><em>Returns whether or not this sphere interects a point.</em> <a href="#Ogre_1_1Spherea9"></a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="namespaceOgre.html#a349">Real</a> </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spheren0">mRadius</a></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classOgre_1_1Vector3.html">Vector3</a> </td><td valign=bottom><a class="el" href="classOgre_1_1Sphere.html#Ogre_1_1Spheren1">mCenter</a></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> A sphere primitive, mostly used for bounds checking. <p> <dl compact><dt><b> Remarks: </b><dd> 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). <a class="el" href="namespaceOgre.html">Ogre</a> stores spheres simply as a center point and a radius. </dl> <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00042">42</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>.<hr><h2>Constructor & Destructor Documentation</h2> <a name="Ogre_1_1Spherea0" doxytag="Ogre::Sphere::Sphere"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Ogre::Sphere::Sphere </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Standard constructor - creates a unit sphere around the origin. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00049">49</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. </td> </tr> </table> <a name="Ogre_1_1Spherea1" doxytag="Ogre::Sphere::Sphere"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Ogre::Sphere::Sphere </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> & </td> <td class="mdname" nowrap> <em>center</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname" nowrap> <em>radius</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor allowing arbitrary spheres. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>center</em> </td><td> The center point of the sphere. </td></tr> <tr><td valign=top><em>radius</em> </td><td> The radius of the sphere. </td></tr> </table> </dl> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00054">54</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> References <a class="el" href="OgrePrerequisites_8h-source.html#l00086">Ogre::Real</a>. </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="Ogre_1_1Spherea4" doxytag="Ogre::Sphere::getCenter"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a>& Ogre::Sphere::getCenter </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the center point of the sphere. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00064">64</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> Referenced by <a class="el" href="OgreOctreeSceneManager_8cpp-source.html#l00088">Ogre::intersect</a>(), <a class="el" href="OgreMath_8cpp-source.html#l00282">Ogre::Math::intersects</a>(), <a class="el" href="OgreFrustum_8cpp-source.html#l00224">Ogre::Frustum::isVisible</a>(), and <a class="el" href="OgreCamera_8cpp-source.html#l00454">Ogre::Camera::isVisible</a>(). </td> </tr> </table> <a name="Ogre_1_1Spherea2" doxytag="Ogre::Sphere::getRadius"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::Sphere::getRadius </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns the radius of the sphere. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00058">58</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> References <a class="el" href="OgrePrerequisites_8h-source.html#l00086">Ogre::Real</a>. <p> Referenced by <a class="el" href="OgreOctreeSceneManager_8cpp-source.html#l00088">Ogre::intersect</a>(), <a class="el" href="OgreMath_8cpp-source.html#l00282">Ogre::Math::intersects</a>(), <a class="el" href="OgreFrustum_8cpp-source.html#l00224">Ogre::Frustum::isVisible</a>(), and <a class="el" href="OgreCamera_8cpp-source.html#l00454">Ogre::Camera::isVisible</a>(). </td> </tr> </table> <a name="Ogre_1_1Spherea9" doxytag="Ogre::Sphere::intersects"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool Ogre::Sphere::intersects </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> & </td> <td class="mdname1" valign="top" nowrap> <em>v</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns whether or not this sphere interects a point. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00086">86</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. </td> </tr> </table> <a name="Ogre_1_1Spherea8" doxytag="Ogre::Sphere::intersects"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool Ogre::Sphere::intersects </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classOgre_1_1Plane.html">Plane</a> & </td> <td class="mdname1" valign="top" nowrap> <em>plane</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns whether or not this sphere interects a plane. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00081">81</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. </td> </tr> </table> <a name="Ogre_1_1Spherea7" doxytag="Ogre::Sphere::intersects"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool Ogre::Sphere::intersects </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classOgre_1_1AxisAlignedBox.html">AxisAlignedBox</a> & </td> <td class="mdname1" valign="top" nowrap> <em>box</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns whether or not this sphere interects a box. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00076">76</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. </td> </tr> </table> <a name="Ogre_1_1Spherea6" doxytag="Ogre::Sphere::intersects"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool Ogre::Sphere::intersects </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const Sphere & </td> <td class="mdname1" valign="top" nowrap> <em>s</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Returns whether or not this sphere interects another sphere. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00070">70</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> References <a class="el" href="OgreVector3_8h-source.html#l00251">Ogre::Vector3::length</a>(), <a class="el" href="OgreSphere_8h-source.html#l00046">mCenter</a>, and <a class="el" href="OgreSphere_8h-source.html#l00045">mRadius</a>. <p> Referenced by <a class="el" href="OgreSceneManager_8cpp-source.html#l02033">Ogre::DefaultSphereSceneQuery::execute</a>(). </td> </tr> </table> <a name="Ogre_1_1Spherea5" doxytag="Ogre::Sphere::setCenter"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Ogre::Sphere::setCenter </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> & </td> <td class="mdname1" valign="top" nowrap> <em>center</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets the center point of the sphere. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00067">67</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> Referenced by <a class="el" href="OgreBillboardSet_8cpp-source.html#l00812">Ogre::BillboardSet::billboardVisible</a>(), <a class="el" href="OgreSceneManager_8cpp-source.html#l02033">Ogre::DefaultSphereSceneQuery::execute</a>(), and <a class="el" href="OgreMovableObject_8cpp-source.html#l00116">Ogre::MovableObject::getWorldBoundingSphere</a>(). </td> </tr> </table> <a name="Ogre_1_1Spherea3" doxytag="Ogre::Sphere::setRadius"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Ogre::Sphere::setRadius </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="namespaceOgre.html#a349">Real</a> </td> <td class="mdname1" valign="top" nowrap> <em>radius</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Sets the radius of the sphere. <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00061">61</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> References <a class="el" href="OgrePrerequisites_8h-source.html#l00086">Ogre::Real</a>. <p> Referenced by <a class="el" href="OgreBillboardSet_8cpp-source.html#l00812">Ogre::BillboardSet::billboardVisible</a>(), <a class="el" href="OgreSceneManager_8cpp-source.html#l02033">Ogre::DefaultSphereSceneQuery::execute</a>(), and <a class="el" href="OgreMovableObject_8cpp-source.html#l00116">Ogre::MovableObject::getWorldBoundingSphere</a>(). </td> </tr> </table> <hr><h2>Member Data Documentation</h2> <a name="Ogre_1_1Spheren1" doxytag="Ogre::Sphere::mCenter"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classOgre_1_1Vector3.html">Vector3</a> Ogre::Sphere::mCenter<code> [protected]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00046">46</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> Referenced by <a class="el" href="OgreSphere_8h-source.html#l00070">intersects</a>(). </td> </tr> </table> <a name="Ogre_1_1Spheren0" doxytag="Ogre::Sphere::mRadius"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="namespaceOgre.html#a349">Real</a> Ogre::Sphere::mRadius<code> [protected]</code> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="OgreSphere_8h-source.html#l00045">45</a> of file <a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a>. <p> Referenced by <a class="el" href="OgreSphere_8h-source.html#l00070">intersects</a>(). </td> </tr> </table> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="OgreSphere_8h-source.html">OgreSphere.h</a></ul> <p> Copyright © 2002-2003 by The OGRE Team<br /> Last modified Wed Jan 21 00:20:41 2004 </p> </body> </html>