39 #ifndef __PORTAL_PATH_H__
40 #define __PORTAL_PATH_H__
49 #include "mengeCommon.h"
58 class NavMeshLocalizer;
160 unsigned int getNode(
size_t i )
const;
242 void replan(
const Vector2 & startPos,
unsigned int startNode,
unsigned int endNode,
float minWidth,
PathPlanner * planner );
245 #endif // __PORTAL_PATH_H__
Class responsible for tracking agent relatinoships to the navigation mesh: its current location and i...
Definition: NavMeshLocalizer.h:186
void setPreferredDirection(const Agents::BaseAgent *agent, float headingCos, Agents::PrefVelocity &pVel)
Sets the directions in the preferred velocity from the path.
Definition: PortalPath.cpp:69
const PortalRoute * _route
The route to follow.
Definition: PortalPath.h:201
The basic structure defining a way "point" along a path through a navigation mesh. It consists of the navigation mesh edge to pass through and the node one should be in while heading to the edge.
Definition: WayPortal.h:64
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
Vector2 * _headings
The original direction to the way point.
Definition: PortalPath.h:230
unsigned int updateLocation(const Agents::BaseAgent *agent, const NavMeshPtr &navMesh, const NavMeshLocalizer *localizer, PathPlanner *planner)
Updates the location of the agent relative to the nav mesh.
Definition: PortalPath.cpp:141
Defines the goal classes for agent behaviors.
The base, abstract class defining goals.
Definition: Goal.h:110
void replan(const Vector2 &startPos, unsigned int startNode, unsigned int endNode, float minWidth, PathPlanner *planner)
Something has changed and the path has to replan.
Definition: PortalPath.cpp:302
virtual Vector2 getCentroid() const =0
Return the centroid of the goal.
size_t _currPortal
The index of the way portal currently serving as immediate goal. -1 means it's at the end...
Definition: PortalPath.h:212
Vector2 getGoalCentroid() const
Returns the centroid of the goal.
Definition: PortalPath.h:144
const WayPortal * getPortal(size_t i) const
Returns the ith portal.
Definition: PortalPath.h:183
The definition of a basic route through a navigation mesh.
Class for computing paths through a navigation mesh.
Definition: PathPlanner.h:133
PortalPath(const Vector2 &startPos, const BFSM::Goal *goal, const PortalRoute *route, float agentRadius)
Constructor.
Definition: PortalPath.cpp:56
The definition of a route through a navigation mesh from a start to an end node.
Definition: Route.h:60
unsigned int getEndNode() const
Returns the identifier for the destination node on the path.
Definition: PortalPath.h:151
WayPortal * getPortal(size_t i)
Gets the ith portal.
Definition: Route.h:111
unsigned int getNode() const
Reports the node the agent is currently in.
Definition: PortalPath.cpp:278
size_t getPortalCount() const
Reports the number of portals in the path)
Definition: PortalPath.h:175
const BFSM::Goal * getGoal() const
Returns the goal.
Definition: PortalPath.h:137
Vector2 getWayPoint(size_t i) const
Returns the position of the ith way point.
Definition: PortalPath.cpp:317
const BFSM::Goal * _goal
The ultimate goal.
Definition: PortalPath.h:206
void setWaypoints(size_t start, size_t end, const Vector2 &p0, const Vector2 &dir)
Set the waypoints for all of the indicated way portals.
Definition: PortalPath.cpp:337
Vector2 * _waypoints
The sequence of way points. Some way points will be duplicated.
Definition: PortalPath.h:225
The definition of a preferred velocity.
Definition: PrefVelocity.h:68
Defines the basic agent properties and functionality that all simulation agents share.
Definition: BaseAgent.h:123
The definition of a path through space comprising of a sequence of portals.
Definition: PortalPath.h:70
void computeCrossing(const Vector2 &startPos, float agentRadius)
Computes the crossing values for each portal.
Definition: PortalPath.cpp:288
~PortalPath()
Destructor.
Definition: PortalPath.cpp:62
Defines the classes which maintain the navigation mesh data.
The namespace that contains the basic simulation mechanisms.
size_t getCurrentPortal() const
Returns the index of the current portal (the portal the agent is currently headed towards...
Definition: PortalPath.h:168
size_t getPortalCount() const
Reports the number of portals on the route.
Definition: Route.h:94
size_t getWayPointCount() const
Reports the number of way points in the path (not including the goal)
Definition: PortalPath.h:122
unsigned int getEndNode() const
Returns the identifier for the destination node on the route.
Definition: Route.h:87