Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Menge::Math::AABBShape Class Reference

Axis-aligned bounding box. More...

#include <Geometry2D.h>

Inheritance diagram for Menge::Math::AABBShape:
Menge::Math::Geometry2D Menge::BFSM::AABBCondition

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).
 

Detailed Description

Axis-aligned bounding box.

Constructor & Destructor Documentation

Menge::Math::AABBShape::AABBShape ( const Vector2 minPt,
const Vector2 maxPt 
)

Constructor.

Parameters
minPtThe minimum values of the bounding box along the x- and y-axes, respectively.
maxPtThe maximum values of the bounding box along the x- and y-axes, respectively.
Menge::Math::AABBShape::AABBShape ( const AABBShape shape)

Copy constructor.

Parameters
shapeThe shape to copy from.
Menge::Math::AABBShape::AABBShape ( const AABBShape shape,
const Vector2 offset 
)

Initializes this shape as an translated version of the input shape.

Parameters
shapeThe shape to copy from.
offsetdefines an offset from the copied AABBShape for the new AABBShape

Member Function Documentation

bool Menge::Math::AABBShape::containsPoint ( const Vector2 pt) const
virtual

Determine if the point is inside the shape based on the instance properties.

Parameters
ptThe point to test.
Returns
True if the point is inside the shape, false otherwise.

Implements Menge::Math::Geometry2D.

Reimplemented in Menge::BFSM::AABBCondition.

bool Menge::Math::AABBShape::containsPoint ( const Vector2 pt,
const Vector2 pos 
) const
virtual

Determine if the point is inside a AABB, centered on the given position.

Parameters
ptThe point to test.
posThe position of the circle.
Returns
True if the point is inside the shape, false otherwise.

Implements Menge::Math::Geometry2D.

AABBShape Menge::Math::AABBShape::operator+ ( const Vector2 pt)

Construct an offset version of this shape.

Parameters
ptThe offset value.
Returns
A new AABBShape offset from this one by the vector pt.
void Menge::Math::AABBShape::set ( const Vector2 minPt,
const Vector2 maxPt 
)

Sets the extent of the AABB.

Parameters
minPtThe minimum point (along the x- and y-axes).
maxPtThe 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.

Parameters
sizeThe width and height of the box.

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