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

A visiblity cone. In order for an agent to be visible, they must lie within the visibility cone. More...

Public Member Functions

 VisibilityCone (const Vector2 &dir0, const Vector2 &dir1)
 Constructor - the visiblity cone is defined by two vectors. The cone is assumed to be the smaller angle subtending the two vectors. The constructor orders them appropriately. More...
 
bool isVisible (const Vector2 &p0, const Vector2 &p1) const
 Reports if any portion of a line segment lies within the visibility cone. More...
 
bool isVisible (const Vector2 &p) const
 Reports if the point lies within the visibility cone. More...
 
bool intersect (const VisibilityCone &cone)
 Intersects this cone with the given cone, changing the extent of this cone to adhere to the intersected span. More...
 

Public Attributes

Vector2 _left
 The left bound of the cone.
 
Vector2 _right
 the right bound of the cone.
 

Detailed Description

A visiblity cone. In order for an agent to be visible, they must lie within the visibility cone.

Constructor & Destructor Documentation

Menge::Agents::VisibilityCone::VisibilityCone ( const Vector2 dir0,
const Vector2 dir1 
)
inline

Constructor - the visiblity cone is defined by two vectors. The cone is assumed to be the smaller angle subtending the two vectors. The constructor orders them appropriately.

Parameters
dir0One bound on the cone.
dir1The other bound on the cone.

Member Function Documentation

bool Menge::Agents::VisibilityCone::intersect ( const VisibilityCone cone)
inline

Intersects this cone with the given cone, changing the extent of this cone to adhere to the intersected span.

Parameters
coneThe cone to intersect this cone with.
Returns
A boolean reporting if there is a non-empty intersection (true) or if there is no proper intersection (false).
bool Menge::Agents::VisibilityCone::isVisible ( const Vector2 p0,
const Vector2 p1 
) const
inline

Reports if any portion of a line segment lies within the visibility cone.

Parameters
p0One end of the line segment.
p1The other end of the line segment.
Returns
A boolean which indicates if any portion of the segment lies in the cone (true) and is visible, or if it lies outside and is not visible (false).
bool Menge::Agents::VisibilityCone::isVisible ( const Vector2 p) const
inline

Reports if the point lies within the visibility cone.

Parameters
pThe point to test.
Returns
A boolean which indicates if the point lies in the cone (true) and is visible, or if it lies outside and is not visible (false).

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