44 #ifndef __GEOMETRY_2D_H__
45 #define __GEOMETRY_2D_H__
47 #include "mengeCommon.h"
78 virtual bool containsPoint(
const Vector2 & pt )
const = 0;
89 virtual bool containsPoint(
const Vector2 & pt,
const Vector2 & pos )
const = 0;
140 void setRadius(
float radius ) { _radSqd = radius * radius; }
155 void set(
const Vector2 & center,
float radius ) { _center.set( center ); _radSqd = radius * radius; }
164 virtual bool containsPoint(
const Vector2 & pt )
const;
174 virtual bool containsPoint(
const Vector2 & pt,
const Vector2 & pos )
const;
240 virtual bool containsPoint(
const Vector2 & pt )
const;
250 virtual bool containsPoint(
const Vector2 & pt,
const Vector2 & pos )
const;
268 void setSize(
const Vector2 & size );
341 virtual bool containsPoint(
const Vector2 & pt )
const;
351 virtual bool containsPoint(
const Vector2 & pt,
const Vector2 & pos )
const;
361 void set(
const Vector2 & pivot,
float width,
float height,
float angle );
379 void setAngle(
float angle );
412 #endif // __GEOMETRY_2D_H__
Vector2 _minPt
The minimum extent of the bounding box.
Definition: Geometry2D.h:274
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
CircleShape()
Default constructor.
Definition: Geometry2D.h:102
void set(const Vector2 ¢er, float radius)
Sets the properties of the circle.
Definition: Geometry2D.h:155
Abstract 2d Geometry class for FSM queries.
Definition: Geometry2D.h:59
void setRadius(float radius)
Sets the radius of the circle.
Definition: Geometry2D.h:140
Vector2 _halfSize
The half width and height of the box.
Definition: Geometry2D.h:395
Vector2 _size
The width and height of the box (along its local coordinate system).
Definition: Geometry2D.h:390
Oriented bounding box.
Definition: Geometry2D.h:292
The namespace for math primitives for simulation and visualization.
Vector2 _halfSize
The size of the bounding box (along the x- and y- axes).
Definition: Geometry2D.h:284
float _cosTheta
The cosine of the box's angle of rotation (used for accelerating queries).
Definition: Geometry2D.h:401
CircleShape(const Vector2 ¢er, float radius)
Constructor.
Definition: Geometry2D.h:110
void setCenter(const Vector2 ¢er)
Sets the center of the circle.
Definition: Geometry2D.h:147
Geometry2D()
Constructor.
Definition: Geometry2D.h:64
void setSize(const Vector2 &size)
Sets the size of the OBB.
Definition: Geometry2D.h:370
float _radSqd
Squared radius of the circle.
Definition: Geometry2D.h:185
Vector2 _maxPt
The maximum extent of the bounding box.
Definition: Geometry2D.h:279
Axis-aligned bounding box.
Definition: Geometry2D.h:193
float _sinTheta
The sine of the box's angle of rotation (used for accelerating queries).
Definition: Geometry2D.h:407
virtual ~Geometry2D()
Simple destructor.
Definition: Geometry2D.h:69
Circle shape.
Definition: Geometry2D.h:97
Vector2 _center
Center of the circle.
Definition: Geometry2D.h:180
Vector2 _pivot
The minimum corners of the bounding box (the box is rotated around this point).
Definition: Geometry2D.h:385