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

This is used to represent a flat infinite slice of the game world. More...

#include <plane.h>

+ Collaboration diagram for Mezzanine::Plane:

Public Types

typedef std::pair< Boole, Vector3RayTestResult
 This is a type used for the return of a ray intersection test. More...
 
enum  Side { S_None = 0, S_Positive = 1, S_Negative = 2, S_Both = 3 }
 An enum used to describe which side of the plane the result of a query is on.
 

Public Member Functions

 Plane ()
 Default constructor.
 
 Plane (const Plane &Other)
 Copy constructor. More...
 
 Plane (const Vector3 &Norm, const Real Constant)
 Descriptive constructor. More...
 
 Plane (const Vector3 &Norm, const Vector3 &Point)
 Dual Vector constructor. More...
 
 Plane (const Vector3 &First, const Vector3 &Second, const Vector3 &Third)
 Triangle constructor. More...
 
 Plane (const Ogre::Plane &InternalPlane)
 Compatibility constructor. More...
 
 ~Plane ()
 Class destructor.
 
void Define (const Vector3 &Norm, const Real Constant)
 Defines the dimensions of this plane explicitly. More...
 
void Define (const Vector3 &Norm, const Vector3 &Point)
 Defines the dimensions of this plane based on an origin and direction. More...
 
void Define (const Vector3 &First, const Vector3 &Second, const Vector3 &Third)
 Defines the dimensions of this plane from a triangle in 3D space. More...
 
void ExtractOgrePlane (const Ogre::Plane &InternalPlane)
 Changes this Plane to match the Ogre Plane. More...
 
Real GetDistance (const Vector3 &Point) const
 Gets the distance from the plane to a point in 3D space. More...
 
Ogre::Plane GetOgrePlane () const
 Gets an Ogre::Plane that contains this Planes information. More...
 
Ray GetOverlap (const Plane &Other) const
 Gets the overlap of two Planes expressed as a Ray. More...
 
Side GetSide (const Vector3 &Point) const
 Gets which side of the plane a point in 3D space is. More...
 
Side GetSide (const Vector3 &Center, const Vector3 &HalfSize) const
 Gets which side of the plane a box shape is. More...
 
RayTestResult Intersects (const Ray &ToCheck) const
 Checks to see if a ray intersects this Plane. More...
 
Boole IsOverlapping (const Sphere &ToCheck) const
 Checks to see if a sphere overlaps with this Plane. More...
 
Boole IsOverlapping (const AxisAlignedBox &ToCheck) const
 Checks to see if an AABB overlaps with this Plane. More...
 
Boole IsOverlapping (const Plane &ToCheck) const
 Checks to see if another Plane intersects this one. More...
 
Boole operator!= (const Plane &Other) const
 Inequality operator. More...
 
void operator= (const Plane &Other)
 Assignment operator. More...
 
void operator= (const Ogre::Plane &InternalPlane)
 The assignment operator from Ogre::Plane to Mezzanine::Plane. More...
 
Boole operator== (const Plane &Other) const
 Equality 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

Real Distance
 How from from the origin the plane is.
 
Vector3 Normal
 The rotation of the plane.
 

Detailed Description

This is used to represent a flat infinite slice of the game world.

The Normal value represents how rotated the plane will be, and The Distance with represent how far you need to move down a line perpendicular to the plane, (ie the normal, which is defined by the Normal value) from the Origin.

Definition at line 65 of file plane.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 the point where it was hit.

Definition at line 79 of file plane.h.

Constructor & Destructor Documentation

Mezzanine::Plane::Plane ( const Plane Other)

Copy constructor.

Parameters
OtherThe other plane to copy from.

Definition at line 70 of file plane.cpp.

Mezzanine::Plane::Plane ( const Vector3 Norm,
const Real  Constant 
)

Descriptive constructor.

Parameters
NormThe positive direction of the plane.
ConstantThe Constant distance of the origin with which to project the plane.

Definition at line 75 of file plane.cpp.

Mezzanine::Plane::Plane ( const Vector3 Norm,
const Vector3 Point 
)

Dual Vector constructor.

Parameters
NormThe positive direction of the plane.
PointThe "origin" point of the plane in 3D space.

Definition at line 80 of file plane.cpp.

Mezzanine::Plane::Plane ( const Vector3 First,
const Vector3 Second,
const Vector3 Third 
)

Triangle constructor.

Parameters
FirstThis is one point in the triangle.
SecondThis is another point in the triangle.
ThirdThis is one point in the triangle.

Definition at line 83 of file plane.cpp.

Mezzanine::Plane::Plane ( const Ogre::Plane &  InternalPlane)
explicit

Compatibility constructor.

Parameters
InternalPlaneThis is the Ogre::Plane to copy from.

Definition at line 86 of file plane.cpp.

Member Function Documentation

void Mezzanine::Plane::Define ( const Vector3 Norm,
const Real  Constant 
)

Defines the dimensions of this plane explicitly.

Parameters
NormThe positive direction of the plane.
ConstantThe Constant with which to project the plane.

Definition at line 95 of file plane.cpp.

void Mezzanine::Plane::Define ( const Vector3 Norm,
const Vector3 Point 
)

Defines the dimensions of this plane based on an origin and direction.

Parameters
NormThe positive direction of the plane.
PointThe "origin" point of the plane in 3D space.

Definition at line 101 of file plane.cpp.

void Mezzanine::Plane::Define ( const Vector3 First,
const Vector3 Second,
const Vector3 Third 
)

Defines the dimensions of this plane from a triangle in 3D space.

Parameters
FirstThis is one point in the triangle.
SecondThis is another point in the triangle.
ThirdThis is one point in the triangle.

Definition at line 107 of file plane.cpp.

void Mezzanine::Plane::ExtractOgrePlane ( const Ogre::Plane &  InternalPlane)

Changes this Plane to match the Ogre Plane.

Parameters
InternalPlaneThe Ogre::Plane to copy.

Definition at line 198 of file plane.cpp.

Real Mezzanine::Plane::GetDistance ( const Vector3 Point) const

Gets the distance from the plane to a point in 3D space.

Note
This function will only return a true unit distance if the Normal member of this class is properly normalized. Take care when altering it's value.
Parameters
PointThe point in 3D space to get the distance to.
Returns
Returns the distance from the plane to the specified point. Positive values mean the point is on the positive side, and vice versa.

Definition at line 141 of file plane.cpp.

Ogre::Plane Mezzanine::Plane::GetOgrePlane ( ) const

Gets an Ogre::Plane that contains this Planes information.

Returns
This returns an Ogre::Plane that contains the same information as this Planes information.

Definition at line 190 of file plane.cpp.

Ray Mezzanine::Plane::GetOverlap ( const Plane Other) const

Gets the overlap of two Planes expressed as a Ray.

Note
The "IsOverlapping" method overload that accepts a Plane is a fairly quick and easy check you could perform prior to this method to ensure you get valid results.
Parameters
OtherThe other Plane to compare with.
Returns
Returns a Ray expressing the overlapping portions of the two Planes, or a blank/default Ray if they don't overlap.

Definition at line 144 of file plane.cpp.

String Mezzanine::Plane::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 245 of file plane.cpp.

Plane::Side Mezzanine::Plane::GetSide ( const Vector3 Point) const

Gets which side of the plane a point in 3D space is.

Parameters
PointThe point in 3D space to determine on which side of the plane it lies.
Returns
Returns a Side enum value, indicating which side of the plane the point is on.

Definition at line 116 of file plane.cpp.

Plane::Side Mezzanine::Plane::GetSide ( const Vector3 Center,
const Vector3 HalfSize 
) const

Gets which side of the plane a box shape is.

Parameters
CenterThe point in 3D space where the center of the box is.
HalfSizeHalf of the total size on each axis.
Returns
Returns a Side enum value indicating which side of the plane the box is on.

Definition at line 128 of file plane.cpp.

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

Checks to see if a ray intersects this Plane.

Parameters
ToCheckThe ray to check for a hit.
Returns
Returns true if the ray intersects this Plane, false otherwise.

Definition at line 184 of file plane.cpp.

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

Checks to see if a sphere overlaps with this Plane.

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

Definition at line 175 of file plane.cpp.

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

Checks to see if an AABB overlaps with this Plane.

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

Definition at line 178 of file plane.cpp.

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

Checks to see if another Plane intersects this one.

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

Definition at line 181 of file plane.cpp.

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

Inequality operator.

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

Definition at line 262 of file plane.cpp.

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

Assignment operator.

Parameters
OtherThe other Plane to copy from.

Definition at line 253 of file plane.cpp.

void Mezzanine::Plane::operator= ( const Ogre::Plane &  InternalPlane)

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

Parameters
InternalPlaneThe Ogre::Plane to take data from.

Definition at line 256 of file plane.cpp.

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

Equality operator.

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

Definition at line 259 of file plane.cpp.

void Mezzanine::Plane::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 223 of file plane.cpp.

void Mezzanine::Plane::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 207 of file plane.cpp.


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