Menge
Modular Pedestrian Simulation Framework for Research and Development
|
Axis-aligned bounding box. More...
#include <Geometry2D.h>
Public Member Functions | |
AABBShape () | |
Default constructor. | |
AABBShape (const Vector2 &minPt, const Vector2 &maxPt) | |
Constructor. More... | |
AABBShape (const AABBShape &shape) | |
Copy constructor. More... | |
AABBShape (const AABBShape &shape, const Vector2 &offset) | |
Initializes this shape as an translated version of the input shape. More... | |
AABBShape | operator+ (const Vector2 &pt) |
Construct an offset version of this shape. More... | |
virtual bool | containsPoint (const Vector2 &pt) const |
Determine if the point is inside the shape based on the instance properties. More... | |
virtual bool | containsPoint (const Vector2 &pt, const Vector2 &pos) const |
Determine if the point is inside a AABB, centered on the given position. More... | |
void | set (const Vector2 &minPt, const Vector2 &maxPt) |
Sets the extent of the AABB. More... | |
void | setSize (const Vector2 &size) |
Sets the size of the AABB. More... | |
Public Member Functions inherited from Menge::Math::Geometry2D | |
Geometry2D () | |
Constructor. | |
virtual | ~Geometry2D () |
Simple destructor. | |
Protected Attributes | |
Vector2 | _minPt |
The minimum extent of the bounding box. | |
Vector2 | _maxPt |
The maximum extent of the bounding box. | |
Vector2 | _halfSize |
The size of the bounding box (along the x- and y- axes). | |
Axis-aligned bounding box.
Constructor.
minPt | The minimum values of the bounding box along the x- and y-axes, respectively. |
maxPt | The maximum values of the bounding box along the x- and y-axes, respectively. |
Menge::Math::AABBShape::AABBShape | ( | const AABBShape & | shape | ) |
Copy constructor.
shape | The shape to copy from. |
|
virtual |
Determine if the point is inside the shape based on the instance properties.
pt | The point to test. |
Implements Menge::Math::Geometry2D.
Reimplemented in Menge::BFSM::AABBCondition.
|
virtual |
Determine if the point is inside a AABB, centered on the given position.
pt | The point to test. |
pos | The position of the circle. |
Implements Menge::Math::Geometry2D.
Construct an offset version of this shape.
pt | The offset value. |
Sets the extent of the AABB.
minPt | The minimum point (along the x- and y-axes). |
maxPt | The maximum point (along the x- and y-axes). |
void Menge::Math::AABBShape::setSize | ( | const Vector2 & | size | ) |
Sets the size of the AABB.
It implicitly changes the maximum extent of the box, keeping the minimum point where it is.
size | The width and height of the box. |