This is a utility class used to represent the Axis-Aligned Bounding Boxes of objects in various subsystems. More...
#include <axisalignedbox.h>
Public Types | |
enum | AxisExtent { AE_Min = 1, AE_Max = 2 } |
This enum is used to help make querys for data on the AABB. | |
typedef std::pair< Boole, Ray > | RayTestResult |
This is a type used for the return of a ray intersection test. More... | |
enum | Side { SideMinX = 0, SideMinY = 1, SideMinZ = 2, SideMaxX = 3, SideMaxY = 4, SideMaxZ = 5 } |
Used to uniquely identify sides of an axis aligned box. | |
Public Member Functions | |
AxisAlignedBox () | |
Blank constructor. | |
AxisAlignedBox (const AxisAlignedBox &Other) | |
Copy constructor. More... | |
AxisAlignedBox (const Vector3 &Min, const Vector3 &Max) | |
Extents constructor. More... | |
AxisAlignedBox (const Ogre::AxisAlignedBox &InternalAABB) | |
Internal constructor. More... | |
~AxisAlignedBox () | |
Class destructor. | |
void | Expand (const Vector3 &Point) |
Expands the size of this AABB to encompass it's current bounds plus a point in 3D space. More... | |
void | Expand (const AxisAlignedBox &Other) |
Expands the size of this AABB to encompass it's current bounds plus another AABB. More... | |
void | ExtractOgreAABB (const Ogre::AxisAlignedBox &InternalAABB) |
Changes this AxisAlignedBox to match the Ogre AxisAlignedBox. More... | |
Vector3 | GetCenter () const |
Gets the center of this AABB. More... | |
Vector3 | GetCorner (const AxisExtent XEx, const AxisExtent YEx, const AxisExtent ZEx) const |
Gets the location of the specified corner. More... | |
Vector3 | GetHalfSize () const |
Gets half the size of this AABB. More... | |
Ogre::AxisAlignedBox | GetOgreAABB () const |
Gets an Ogre::AxisAlignedBox that contains this Spheres information. More... | |
AxisAlignedBox | GetOverlap (const AxisAlignedBox &Other) const |
Gets an AABB that has the dimensions of the overlap between this AABB and another AABB. More... | |
Real | GetSideExtent (Side WhichSideExtent) const |
Plane | GetSidePlane (Side WhichSidePlane) const |
Get a plane corresponding to a side of the box. More... | |
Vector3 | GetSize () const |
Gets the size of this AABB. More... | |
Real | GetVolume () const |
Gets the total volume of this AABB. More... | |
RayTestResult | Intersects (const Ray &ToCheck) const |
Checks to see if a ray intersects this AABB. More... | |
Boole | IsInside (const Vector3 &ToCheck) const |
Checks to see if a point is inside this AABB. More... | |
Boole | IsOverlapping (const Sphere &ToCheck) const |
Checks to see if a sphere overlaps with this AABB. More... | |
Boole | IsOverlapping (const AxisAlignedBox &ToCheck) const |
Checks to see if another AABB overlaps with this one. More... | |
Boole | IsOverlapping (const Plane &ToCheck) const |
Checks to see if a plane intersects this AABB. More... | |
Boole | IsZero () const |
Gets whether or not this AABB has no size. More... | |
Boole | operator!= (const AxisAlignedBox &Other) const |
Inequality operator. More... | |
Boole | operator< (const AxisAlignedBox &Other) const |
Greater-than or equals-to operator. More... | |
Boole | operator<= (const AxisAlignedBox &Other) const |
Less-than or equals-to operator. More... | |
void | operator= (const AxisAlignedBox &Other) |
Assignment operator. More... | |
void | operator= (const Ogre::AxisAlignedBox &InternalAABB) |
The assignment operator from Ogre::AxisAlignedBox to Mezzanine::AxisAlignedBox. More... | |
Boole | operator== (const AxisAlignedBox &Other) const |
Equality operator. More... | |
Boole | operator> (const AxisAlignedBox &Other) const |
Greater-than operator. More... | |
Boole | operator>= (const AxisAlignedBox &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... | |
void | SetExtents (const Vector3 &Min, const Vector3 &Max) |
Sets the minimum and maximum extents of this AABB. 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 | MaxExt |
The maximum extents on each axis in world space. More... | |
Vector3 | MinExt |
The minimum extents on each axis in world space. More... | |
This is a utility class used to represent the Axis-Aligned Bounding Boxes of objects in various subsystems.
Definition at line 63 of file axisalignedbox.h.
typedef std::pair<Boole,Ray> Mezzanine::AxisAlignedBox::RayTestResult |
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 AABB.
Definition at line 76 of file axisalignedbox.h.
Mezzanine::AxisAlignedBox::AxisAlignedBox | ( | const AxisAlignedBox & | Other | ) |
Copy constructor.
Other | The other AABB to copy. |
Definition at line 62 of file axisalignedbox.cpp.
Extents constructor.
Min | The minimum extents on each axis in world space. |
Max | The maximum extents on each axis in world space. |
Definition at line 67 of file axisalignedbox.cpp.
|
explicit |
Internal constructor.
InternalAABB | The internal Ogre AxisAlignedBox to construct this AxisAlignedBox from. |
Definition at line 72 of file axisalignedbox.cpp.
void Mezzanine::AxisAlignedBox::Expand | ( | const Vector3 & | Point | ) |
Expands the size of this AABB to encompass it's current bounds plus a point in 3D space.
Point | The point in 3D space to encompass. |
Definition at line 107 of file axisalignedbox.cpp.
void Mezzanine::AxisAlignedBox::Expand | ( | const AxisAlignedBox & | Other | ) |
Expands the size of this AABB to encompass it's current bounds plus another AABB.
Other | The other AABB to encompass. |
Definition at line 113 of file axisalignedbox.cpp.
void Mezzanine::AxisAlignedBox::ExtractOgreAABB | ( | const Ogre::AxisAlignedBox & | InternalAABB | ) |
Changes this AxisAlignedBox to match the Ogre AxisAlignedBox.
InternalAABB | The Ogre::AxisAlignedBox to copy. |
Definition at line 185 of file axisalignedbox.cpp.
Vector3 Mezzanine::AxisAlignedBox::GetCenter | ( | ) | const |
Gets the center of this AABB.
Definition at line 146 of file axisalignedbox.cpp.
Vector3 Mezzanine::AxisAlignedBox::GetCorner | ( | const AxisExtent | XEx, |
const AxisExtent | YEx, | ||
const AxisExtent | ZEx | ||
) | const |
Gets the location of the specified corner.
XEx | The extent for the X axis to retrieve. |
YEx | The extent for the Y axis to retrieve. |
ZEx | The extent for the Z axis to retrieve. |
Definition at line 149 of file axisalignedbox.cpp.
Vector3 Mezzanine::AxisAlignedBox::GetHalfSize | ( | ) | const |
Gets half the size of this AABB.
Definition at line 143 of file axisalignedbox.cpp.
Ogre::AxisAlignedBox Mezzanine::AxisAlignedBox::GetOgreAABB | ( | ) | const |
Gets an Ogre::AxisAlignedBox that contains this Spheres information.
Definition at line 188 of file axisalignedbox.cpp.
AxisAlignedBox Mezzanine::AxisAlignedBox::GetOverlap | ( | const AxisAlignedBox & | Other | ) | const |
Gets an AABB that has the dimensions of the overlap between this AABB and another AABB.
Other | The AABB to get the overlap for. |
Definition at line 94 of file axisalignedbox.cpp.
|
static |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Definition at line 232 of file axisalignedbox.cpp.
Plane Mezzanine::AxisAlignedBox::GetSidePlane | ( | AxisAlignedBox::Side | WhichSidePlane | ) | const |
Get a plane corresponding to a side of the box.
WhichSidePlane | Which side do you want a plane for? |
Definition at line 169 of file axisalignedbox.cpp.
Vector3 Mezzanine::AxisAlignedBox::GetSize | ( | ) | const |
Gets the size of this AABB.
Definition at line 140 of file axisalignedbox.cpp.
Real Mezzanine::AxisAlignedBox::GetVolume | ( | ) | const |
Gets the total volume of this AABB.
Definition at line 88 of file axisalignedbox.cpp.
AxisAlignedBox::RayTestResult Mezzanine::AxisAlignedBox::Intersects | ( | const Ray & | ToCheck | ) | const |
Checks to see if a ray intersects this AABB.
ToCheck | The ray to check for a hit. |
Definition at line 131 of file axisalignedbox.cpp.
Checks to see if a point is inside this AABB.
ToCheck | The location to check to see if it is within this AABB. |
Definition at line 119 of file axisalignedbox.cpp.
Checks to see if a sphere overlaps with this AABB.
ToCheck | The sphere to check for overlap. |
Definition at line 122 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::IsOverlapping | ( | const AxisAlignedBox & | ToCheck | ) | const |
Checks to see if another AABB overlaps with this one.
ToCheck | The other AABB to check for overlap. |
Definition at line 125 of file axisalignedbox.cpp.
Checks to see if a plane intersects this AABB.
ToCheck | The plane to check for intersection. |
Definition at line 128 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::IsZero | ( | ) | const |
Gets whether or not this AABB has no size.
Definition at line 81 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::operator!= | ( | const AxisAlignedBox & | Other | ) | const |
Inequality operator.
Other | The other AABB to compare with. |
Definition at line 261 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::operator< | ( | const AxisAlignedBox & | Other | ) | const |
Greater-than or equals-to operator.
Other | The other AABB to compare with. |
Definition at line 249 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::operator<= | ( | const AxisAlignedBox & | Other | ) | const |
Less-than or equals-to operator.
Other | The other AABB to compare with. |
Definition at line 255 of file axisalignedbox.cpp.
void Mezzanine::AxisAlignedBox::operator= | ( | const AxisAlignedBox & | Other | ) |
Assignment operator.
Other | The other AABB to copy from. |
Definition at line 240 of file axisalignedbox.cpp.
void Mezzanine::AxisAlignedBox::operator= | ( | const Ogre::AxisAlignedBox & | InternalAABB | ) |
The assignment operator from Ogre::AxisAlignedBox to Mezzanine::AxisAlignedBox.
InternalAABB | The Ogre::AxisAlignedBox to take data from. |
Definition at line 243 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::operator== | ( | const AxisAlignedBox & | Other | ) | const |
Equality operator.
Other | The other AABB to compare with. |
Definition at line 258 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::operator> | ( | const AxisAlignedBox & | Other | ) | const |
Greater-than operator.
Other | The other AABB to compare with. |
Definition at line 246 of file axisalignedbox.cpp.
Boole Mezzanine::AxisAlignedBox::operator>= | ( | const AxisAlignedBox & | Other | ) | const |
Less-than operator.
Other | The other AABB to compare with. |
Definition at line 252 of file axisalignedbox.cpp.
void Mezzanine::AxisAlignedBox::ProtoDeSerialize | ( | const XML::Node & | SelfRoot | ) |
Take the data stored in an XML Node and overwrite this object with it.
SelfRoot | An XML::Node containing the data to populate this class with. |
Definition at line 212 of file axisalignedbox.cpp.
void Mezzanine::AxisAlignedBox::ProtoSerialize | ( | XML::Node & | ParentNode | ) | const |
Convert this class to an XML::Node ready for serialization.
ParentNode | The point in the XML hierarchy that all this shape should be appended to. |
Definition at line 194 of file axisalignedbox.cpp.
Sets the minimum and maximum extents of this AABB.
Min | The minimum extents on each axis in world space. |
Max | The maximum extents on each axis in world space. |
Definition at line 137 of file axisalignedbox.cpp.
Vector3 Mezzanine::AxisAlignedBox::MaxExt |
The maximum extents on each axis in world space.
Definition at line 98 of file axisalignedbox.h.
Vector3 Mezzanine::AxisAlignedBox::MinExt |
The minimum extents on each axis in world space.
Definition at line 95 of file axisalignedbox.h.