47 #include "MathTools/mathtools.h"
86 {
return MathTools::IsInside(*
this,ToCheck); }
89 {
return MathTools::Overlap(*
this,ToCheck); }
92 {
return MathTools::Overlap(ToCheck,*
this); }
95 {
return MathTools::Overlap(ToCheck,*
this); }
98 {
return MathTools::Intersects(*
this,ToCheck); }
104 { this->
Center = InternalSphere.getCenter(); this->
Radius = InternalSphere.getRadius(); }
135 if( !CurrAttrib.
Empty() )
140 if( !CenterNode.
Empty() ) {
This is a generic sphere class used for spacial queries.
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
A light-weight handle for manipulating attributes in DOM tree.
Boole operator>=(const Sphere &Other) const
Less-than operator.
bool Boole
Generally acts a single bit, true or false.
Thrown when the requested identity could not be found.
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Real Radius
The radius of the sphere.
void ProtoSerialize(XML::Node &ParentNode) const
Convert this class to an XML::Node ready for serialization.
~Sphere()
Class destructor.
static String GetSerializableName()
Get the name of the the XML tag this class will leave behind as its instances are serialized...
bool Empty() const
Is this storing anything at all?
This is used to represent a flat infinite slice of the game world.
This implements the exception hiearchy for Mezzanine.
Ogre::Sphere GetOgreSphere() const
Gets an Ogre::Sphere that contains this Spheres information.
Sphere()
Blank constructor.
This file contains the AxisAlignedBox class for representing AABB's of objects in the world...
float Real
A Datatype used to represent a real floating point number.
The interface for serialization.
bool SetValue(const Char8 *rhs)
Set the value of this.
Boole operator<=(const Sphere &Other) const
Less-than or equals-to operator.
This file contains a generic Sphere class for math and spacial query.
void operator=(const Sphere &Other)
Assignment operator.
Boole IsInside(const Vector3 &ToCheck) const
Checks to see if a point is inside this sphere.
A light-weight handle for manipulating nodes in DOM tree.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
bool Empty() const
Is this storing anything at all?
Boole operator==(const Sphere &Other) const
Equality operator.
Ogre::Vector3 GetOgreVector3() const
Gets a Ogre vector3.
RayTestResult Intersects(const Ray &ToCheck) const
Checks to see if a ray intersects this sphere.
Real AsReal(Real def=0) const
Attempts to convert the value of the attribute to a Real and returns the results. ...
Boole IsOverlapping(const Sphere &ToCheck) const
Checks to see if another sphere overlaps with this one.
void ExtractOgreSphere(const Ogre::Sphere &InternalSphere)
Changes this Sphere to match the Ogre Sphere.
Boole operator<(const Sphere &Other) const
Greater-than or equals-to operator.
This is used to represent a point in space, or a vector through space.
Vector3 Center
The point in world space that is the center of the sphere.
Boole operator>(const Sphere &Other) const
Greater-than operator.
The bulk of the engine components go in this namspace.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
std::pair< Boole, Ray > RayTestResult
This is a type used for the return of a ray intersection test.
Boole operator!=(const Sphere &Other) const
Inequality operator.
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
std::string String
A datatype used to a series of characters.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
This represents a line placed in 3D space and is used with spacial queries.
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
This is a utility class used to represent the Axis-Aligned Bounding Boxes of objects in various subsy...