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 | Friends | List of all members
Menge::PortalRoute Class Reference

The definition of a route through a navigation mesh from a start to an end node. More...

#include <Route.h>

Public Member Functions

 PortalRoute (unsigned int start, unsigned int end)
 Constructor. More...
 
 ~PortalRoute ()
 Destructor.
 
unsigned int getStartNode () const
 Returns the identifier for the first node on the route. More...
 
unsigned int getEndNode () const
 Returns the identifier for the destination node on the route. More...
 
size_t getPortalCount () const
 Reports the number of portals on the route. More...
 
unsigned int getPortalNode (size_t i) const
 Reports the node for the ith portal. More...
 
WayPortalgetPortal (size_t i)
 Gets the ith portal. More...
 
const WayPortalgetPortal (size_t i) const
 Gets a const version of the ith portal. More...
 
void appendWayPortal (const NavMeshEdge *edge, unsigned int node)
 Appends a way portal to the path. More...
 
bool isEquivalent (const PortalRoute *route)
 Reports if the two routes have the same envelope. More...
 
float getLength () const
 Report the length of the path.
 

Protected Attributes

unsigned int _startNode
 The start node.
 
unsigned int _endNode
 The end node.
 
float _maxWidth
 The maximum width an agent can be to take this route.
 
float _bestSmallest
 The smallest agent width for which this has proven to be the optimal path.
 
float _length
 The length of the route.
 
std::vector< WayPortal_portals
 The list of portals to pass through along the route.
 

Friends

class PathPlanner
 

Detailed Description

The definition of a route through a navigation mesh from a start to an end node.

Constructor & Destructor Documentation

Menge::PortalRoute::PortalRoute ( unsigned int  start,
unsigned int  end 
)

Constructor.

Parameters
startThe index of the start node of the route.
endThe index of the end node of the rotue.

Member Function Documentation

void Menge::PortalRoute::appendWayPortal ( const NavMeshEdge edge,
unsigned int  node 
)

Appends a way portal to the path.

Parameters
edgeThe edge forming the portal
nodeThe node in which the agent should be traveling toward the edge
unsigned int Menge::PortalRoute::getEndNode ( ) const
inline

Returns the identifier for the destination node on the route.

Returns
The destination node's index.
WayPortal* Menge::PortalRoute::getPortal ( size_t  i)
inline

Gets the ith portal.

Parameters
iThe path-local index of the portal.
Returns
A pointer to the ith portal.
const WayPortal* Menge::PortalRoute::getPortal ( size_t  i) const
inline

Gets a const version of the ith portal.

Parameters
iThe path-local index of the portal.
Returns
A pointer to the ith portal.
size_t Menge::PortalRoute::getPortalCount ( ) const
inline

Reports the number of portals on the route.

Returns
The number of portals on the route.
unsigned int Menge::PortalRoute::getPortalNode ( size_t  i) const
inline

Reports the node for the ith portal.

Parameters
iThe index of the portal.
Returns
The index of the node the agent should be in when moving toward the ith portal.
unsigned int Menge::PortalRoute::getStartNode ( ) const
inline

Returns the identifier for the first node on the route.

Returns
The first node's index.
bool Menge::PortalRoute::isEquivalent ( const PortalRoute route)

Reports if the two routes have the same envelope.

Two routes are equivalent if they have the same sequence of nav mesh nodes. It is assumed that they have the same start and end nodes.

Parameters
routeThe route to compare with this.
Returns
True if the two routes are equivalent. False otherwise.

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