9 #include "mengeCommon.h"
17 using namespace Menge;
38 Ellipse(
const Vector2 & center );
47 Ellipse(
const Vector2 & center,
const Vector2 & axes );
59 Ellipse(
const Vector2 & center,
const Vector2 & axes,
float angle );
86 float distanceOfClosestApproach(
const Ellipse & other )
const;
98 float approxDistanceOfClosestApproach(
const Ellipse & other )
const;
107 Vector2 closestPoint(
const Vector2 & pt )
const;
121 float minimumDistance(
const Agents::Obstacle * obstacle, Vector2 & dir )
const;
134 float distanceOfClosestApproach(
const Agents::Obstacle * line )
const;
149 float approximateMinimumDistance(
const Vector2 & pt )
const;
160 float radiusInPointDirection(
const Vector2 & pt )
const;
170 Vector2 toEllipseSpace(
const Vector2 & pt )
const;
179 Vector2 fromEllipseSpace(
const Vector2 & pt )
const;
186 inline void setOrientation(
float angle ) { _cosPhi = cos(angle); _sinPhi = sin(angle); }
193 inline void setOrientation(
const Vector2 & dir ) { _cosPhi = dir.x(); _sinPhi = dir.y(); }
200 inline void setCenter(
const Vector2 & pos ) { _center.set( pos ); }
208 inline void setAxes(
const Vector2 & axes ) { _majorAxis = axes.x(); _minorAxis = axes.y(); }
216 inline void setAxes(
float major,
float minor ) { _majorAxis = major; _minorAxis = minor; }
230 inline float getMajor()
const {
return _majorAxis; }
244 inline float getMinor()
const {
return _minorAxis; }
249 inline float getSmallerAxis()
const {
return _minorAxis < _majorAxis ? _minorAxis : _majorAxis; }
254 inline float getLargerAxis()
const {
return _minorAxis < _majorAxis ? _majorAxis : _minorAxis; }
299 #endif //__ELLIPSE_H__
Contains the specification of the generalized centrifugal force pedestrian model. ...
Definition: Ellipse.cpp:9
float _sinPhi
Part of the orientation of the ellipse. Oriented with angle phi. This is sine of that angle...
Definition: Ellipse.h:274
void setAxes(const Vector2 &axes)
Sets the major and minor axes of the ellipse.
Definition: Ellipse.h:208
float getMajor() const
Returns the length of the major axis.
Definition: Ellipse.h:230
float _minorAxis
Length of semi-minor axis. The semi-minor axis is perpendicular to the "direction" the ellipse is ori...
Definition: Ellipse.h:296
float _cosPhi
Part of the orientation of the ellipse. Oriented with angle phi. This is cosine of that angle...
Definition: Ellipse.h:267
float ellipseCenterDistance(const Ellipse &other) const
Compute the distance between the centers of this ellipse and the provided ellipse.
Definition: Ellipse.h:68
void setMajorAxis(float length)
Sets the major axis of the ellipse.
Definition: Ellipse.h:223
void setMinorAxis(float length)
Sets the minor axis of the ellipse.
Definition: Ellipse.h:237
Vector2 ellipseCenterDisplace(const Ellipse &other) const
Computes the displacement from this ellipse's center to the other ellipse's center.
Definition: Ellipse.h:77
Definition of an ellipse.
Definition: Ellipse.h:24
void setAxes(float major, float minor)
Sets the major and minor axes of the ellipse.
Definition: Ellipse.h:216
void setOrientation(const Vector2 &dir)
Sets the orientation of the ellipse.
Definition: Ellipse.h:193
Vector2 _center
The center of the ellipse.
Definition: Ellipse.h:260
float getLargerAxis() const
Returns the larger of the axes.
Definition: Ellipse.h:254
float getMinor() const
Returns the length of the minor axis.
Definition: Ellipse.h:244
float _majorAxis
Length of semi-major axis. The semi-major axis is the "direction" the ellipse is oriented. So, when phi is zero, the semi-major axis is aligned with the x-axis. It need not be a bigger value than the semi-minor axis.
Definition: Ellipse.h:285
float getSmallerAxis() const
Returns the smaller of the axes.
Definition: Ellipse.h:249
void setOrientation(float angle)
Sets the orientation of the ellipse.
Definition: Ellipse.h:186
void setCenter(const Vector2 &pos)
Set center of the ellipse.
Definition: Ellipse.h:200