Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Mezzanine::Sphere Class Reference

This is a generic sphere class used for spacial queries. More...

#include <sphere.h>

+ Collaboration diagram for Mezzanine::Sphere:

Public Types

typedef std::pair< Boole, RayRayTestResult
 This is a type used for the return of a ray intersection test. More...
 

Public Member Functions

 Sphere ()
 Blank constructor.
 
 Sphere (const Sphere &Other)
 Copy constructor. More...
 
 Sphere (const Real SphereRadius)
 Radius constructor. More...
 
 Sphere (const Vector3 &SphereCenter, const Real SphereRadius)
 Descriptive constructor. More...
 
 Sphere (const Ogre::Sphere &InternalSphere)
 Internal constructor. More...
 
 ~Sphere ()
 Class destructor.
 
void ExtractOgreSphere (const Ogre::Sphere &InternalSphere)
 Changes this Sphere to match the Ogre Sphere. More...
 
Ogre::Sphere GetOgreSphere () const
 Gets an Ogre::Sphere that contains this Spheres information. More...
 
RayTestResult Intersects (const Ray &ToCheck) const
 Checks to see if a ray intersects this sphere. More...
 
Boole IsInside (const Vector3 &ToCheck) const
 Checks to see if a point is inside this sphere. More...
 
Boole IsOverlapping (const Sphere &ToCheck) const
 Checks to see if another sphere overlaps with this one. More...
 
Boole IsOverlapping (const AxisAlignedBox &ToCheck) const
 Checks to see if an AABB overlaps with this sphere. More...
 
Boole IsOverlapping (const Plane &ToCheck) const
 Checks to see if a plane intersects this sphere. More...
 
Boole operator!= (const Sphere &Other) const
 Inequality operator. More...
 
Boole operator< (const Sphere &Other) const
 Greater-than or equals-to operator. More...
 
Boole operator<= (const Sphere &Other) const
 Less-than or equals-to operator. More...
 
void operator= (const Sphere &Other)
 Assignment operator. More...
 
void operator= (const Ogre::Sphere &InternalSphere)
 The assignment operator from Ogre::Sphere to Mezzanine::Sphere. More...
 
Boole operator== (const Sphere &Other) const
 Equality operator. More...
 
Boole operator> (const Sphere &Other) const
 Greater-than operator. More...
 
Boole operator>= (const Sphere &Other) const
 Less-than operator. More...
 
void ProtoDeSerialize (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite this object with it. More...
 
void ProtoSerialize (XML::Node &ParentNode) const
 Convert this class to an XML::Node ready for serialization. More...
 

Static Public Member Functions

static String GetSerializableName ()
 Get the name of the the XML tag this class will leave behind as its instances are serialized. More...
 

Public Attributes

Vector3 Center
 The point in world space that is the center of the sphere.
 
Real Radius
 The radius of the sphere.
 

Detailed Description

This is a generic sphere class used for spacial queries.

Definition at line 62 of file sphere.h.

Member Typedef Documentation

This is a type used for the return of a ray intersection test.

This type provides more verbose return data that can be used for further tests.

The first member stores whether or not there was a hit. The second member stores ray containing the points where the ray entered and exited the sphere.

Definition at line 68 of file sphere.h.

Constructor & Destructor Documentation

Mezzanine::Sphere::Sphere ( const Sphere Other)

Copy constructor.

Parameters
OtherThe other sphere to copy from.

Definition at line 62 of file sphere.cpp.

Mezzanine::Sphere::Sphere ( const Real  SphereRadius)

Radius constructor.

Parameters
SphereRadiusThe radius of the sphere.

Definition at line 67 of file sphere.cpp.

Mezzanine::Sphere::Sphere ( const Vector3 SphereCenter,
const Real  SphereRadius 
)

Descriptive constructor.

Parameters
SphereCenterThe point in world space that is the center of the sphere.
SphereRadiusThe radius of the sphere.

Definition at line 71 of file sphere.cpp.

Mezzanine::Sphere::Sphere ( const Ogre::Sphere &  InternalSphere)
explicit

Internal constructor.

Parameters
InternalSphereThe internal Ogre Sphere to construct this Sphere from.

Definition at line 76 of file sphere.cpp.

Member Function Documentation

void Mezzanine::Sphere::ExtractOgreSphere ( const Ogre::Sphere &  InternalSphere)

Changes this Sphere to match the Ogre Sphere.

Parameters
InternalSphereThe Ogre::Sphere to copy.

Definition at line 103 of file sphere.cpp.

Ogre::Sphere Mezzanine::Sphere::GetOgreSphere ( ) const

Gets an Ogre::Sphere that contains this Spheres information.

Returns
This returns an Ogre::Sphere that contains the same information as this Spheres information.

Definition at line 106 of file sphere.cpp.

String Mezzanine::Sphere::GetSerializableName ( )
static

Get the name of the the XML tag this class will leave behind as its instances are serialized.

Returns
A string containing the name of this class.

Definition at line 152 of file sphere.cpp.

Sphere::RayTestResult Mezzanine::Sphere::Intersects ( const Ray ToCheck) const

Checks to see if a ray intersects this sphere.

Parameters
ToCheckThe ray to check for a hit.
Returns
Returns a std::pair containing whether or not the ray hit, and if it did the subsection of the ray that went through the sphere.

Definition at line 97 of file sphere.cpp.

Boole Mezzanine::Sphere::IsInside ( const Vector3 ToCheck) const

Checks to see if a point is inside this sphere.

Parameters
ToCheckThe location to check to see if it is within this sphere.
Returns
Returns true if the point provided is within this sphere, false otherwise.

Definition at line 85 of file sphere.cpp.

Boole Mezzanine::Sphere::IsOverlapping ( const Sphere ToCheck) const

Checks to see if another sphere overlaps with this one.

Parameters
ToCheckThe other sphere to check for overlap.
Returns
Returns true if the provided sphere overlaps with this sphere, false otherwise.

Definition at line 88 of file sphere.cpp.

Boole Mezzanine::Sphere::IsOverlapping ( const AxisAlignedBox ToCheck) const

Checks to see if an AABB overlaps with this sphere.

Parameters
ToCheckThe AABB to check for overlap.
Returns
Returns true if the AABB overlaps with this sphere, false otherwise.

Definition at line 91 of file sphere.cpp.

Boole Mezzanine::Sphere::IsOverlapping ( const Plane ToCheck) const

Checks to see if a plane intersects this sphere.

Parameters
ToCheckThe plane to check for intersection.
Returns
Returns true if the provided plane intersects with this sphere, false otherwise.

Definition at line 94 of file sphere.cpp.

Boole Mezzanine::Sphere::operator!= ( const Sphere Other) const

Inequality operator.

Parameters
OtherThe other Sphere to compare with.
Returns
Returns true if this Sphere is not the same as the other provided Sphere, false otherwise.

Definition at line 181 of file sphere.cpp.

Boole Mezzanine::Sphere::operator< ( const Sphere Other) const

Greater-than or equals-to operator.

Note
This operator compares the radii of both spheres.
Parameters
OtherThe other Sphere to compare with.
Returns
Returns true if this Sphere is larger than or equal to the other provided Sphere, false otherwise.

Definition at line 169 of file sphere.cpp.

Boole Mezzanine::Sphere::operator<= ( const Sphere Other) const

Less-than or equals-to operator.

Note
This operator compares the radii of both spheres.
Parameters
OtherThe other Sphere to compare with.
Returns
Returns true if this Sphere is smaller than or equal to the other provided Sphere, false otherwise.

Definition at line 175 of file sphere.cpp.

void Mezzanine::Sphere::operator= ( const Sphere Other)

Assignment operator.

Parameters
OtherThe other Sphere to copy from.

Definition at line 160 of file sphere.cpp.

void Mezzanine::Sphere::operator= ( const Ogre::Sphere &  InternalSphere)

The assignment operator from Ogre::Sphere to Mezzanine::Sphere.

Parameters
InternalSphereThe Ogre::Sphere to take data from.

Definition at line 163 of file sphere.cpp.

Boole Mezzanine::Sphere::operator== ( const Sphere Other) const

Equality operator.

Parameters
OtherThe other Sphere to compare with.
Returns
Returns true if this Sphere is the same as the other provided Sphere, false otherwise.

Definition at line 178 of file sphere.cpp.

Boole Mezzanine::Sphere::operator> ( const Sphere Other) const

Greater-than operator.

Note
This operator compares the radii of both spheres.
Parameters
OtherThe other Sphere to compare with.
Returns
Returns true if this Sphere is larger than the other provided Sphere, false otherwise.

Definition at line 166 of file sphere.cpp.

Boole Mezzanine::Sphere::operator>= ( const Sphere Other) const

Less-than operator.

Note
This operator compares the radii of both spheres.
Parameters
OtherThe other Sphere to compare with.
Returns
Returns true if this Sphere is smaller than the other provided Sphere, false otherwise.

Definition at line 172 of file sphere.cpp.

void Mezzanine::Sphere::ProtoDeSerialize ( const XML::Node SelfRoot)

Take the data stored in an XML Node and overwrite this object with it.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.

Definition at line 128 of file sphere.cpp.

void Mezzanine::Sphere::ProtoSerialize ( XML::Node ParentNode) const

Convert this class to an XML::Node ready for serialization.

Parameters
ParentNodeThe point in the XML hierarchy that all this shape should be appended to.

Definition at line 112 of file sphere.cpp.


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