Menge Modular Pedestrian Simulation Framework for Research and Development
Menge::Portal Class Reference

A simple portal definition. More...

`#include <Portal.h>`

## Public Member Functions

Portal ()
Default constructor.

Portal (float x0, float y0, float x1, float y1)
Constructor specifying portal geometry. More...

void set (float x0, float y0, float x1, float y1)
Sets the geometry of the portal. More...

void set (const Vector2 &p0, const Vector2 &p1)
Sets the geometry of the portal. More...

Vector2 nearestPoint (const Vector2 &pos, float radius)
Computes the neareset clearable point w.r.t. the portal. More...

## Public Attributes

Vector2 _p0
The first end point of the portal line segment.

Vector2 _p1
The second end point of the portal line segment.

float _mag
The distance between endpoints (i.e., length of the portal).

Vector2 _dir
The direction from the first to the second end point of the portal.

## Detailed Description

A simple portal definition.

A portal is simply a line segment - a region through which agents can pass.

## Constructor & Destructor Documentation

 Menge::Portal::Portal ( float x0, float y0, float x1, float y1 )

Constructor specifying portal geometry.

Parameters
 x0 The x-position of the first end point. y0 The y-position of the first end point. x1 The x-position of the second end point. y1 The y-position of the second end point.

## Member Function Documentation

 Vector2 Menge::Portal::nearestPoint ( const Vector2 & pos, float radius )

Computes the neareset clearable point w.r.t. the portal.

Given the position and radius of an agent, computes the best clearable goal point. Clearable means that the straight-line path between the agent's current position and that goal point does NOT intersect either end point of the goal.

This is important because we assume that the end points attach to obstacles and if the end point intersects the path, that means the preferred velocity is leading the agent into a collision with the obstacle.

Parameters
 pos The position of the agent. radius The radius of the agent.
Returns
The nearest clearable point.
 void Menge::Portal::set ( float x0, float y0, float x1, float y1 )

Sets the geometry of the portal.

Parameters
 x0 The x-position of the first end point. y0 The y-position of the first end point. x1 The x-position of the second end point. y1 The y-position of the second end point.
 void Menge::Portal::set ( const Vector2 & p0, const Vector2 & p1 )

Sets the geometry of the portal.

Parameters
 p0 The position of the first end point. p1 The position of the second end point.

The documentation for this class was generated from the following files:
• src/menge/MengeCore/resources/Portal.h
• src/menge/MengeCore/resources/Portal.cpp