47 #ifndef __NAV_MESH_EDGE_H__
48 #define __NAV_MESH_EDGE_H__
51 #include "mengeCommon.h"
408 #endif // __NAV_MESH_EDGE_H__
Vector2 getPoint(float t) const
Selects a point along the edge.
Definition: NavMeshEdge.h:217
void setPoint(const Vector2 &p)
Sets the edge's point value.
Definition: NavMeshEdge.h:175
Vector2 getP1() const
Returns the second edge point.
Definition: NavMeshEdge.h:104
NavMeshNode * getFirstNode() const
Returns the first attached NavMeshNode.
Definition: NavMeshEdge.h:126
Vector2 _point
The point that defines the portal geometry. The portal is defined as p(t) = _point + t * _dir...
Definition: NavMeshEdge.h:371
The core namespace. All elements of Menge are contained in this namespace.
Definition: AgentGenerator.cpp:43
Vector2 getP1(float dist) const
Returns a point inset from the second end point.
Definition: NavMeshEdge.h:112
NavMeshNode * _node0
A pointer to the first nav mesh node connected by this edge. When standing in this node...
Definition: NavMeshEdge.h:397
NavMeshEdge()
Constructor.
Definition: NavMeshEdge.cpp:57
bool loadFromAscii(std::ifstream &f, Vector2 *vertices)
Sets the edge properties from an edge definition in the given ascii file stream.
Definition: NavMeshEdge.cpp:143
void setWidth(float w)
Sets the edge's width value.
Definition: NavMeshEdge.h:190
The navigation mesh adjacency graph node. It corresponds to a convex polygon in the navigation mesh...
Definition: NavMeshNode.h:64
float getWidth() const
Reports the width of the edge.
Definition: NavMeshEdge.h:197
NavMeshNode * getOtherByPtr(const NavMeshNode *node)
Returns a pointer to the node on the opposite end of the edge from the given node (by pointer)...
Definition: NavMeshEdge.cpp:78
NavMeshNode * _node1
A pointer to the second nav mesh node connected by this edge. When standing in this node...
Definition: NavMeshEdge.h:404
float getNodeDistance() const
Return the Euclidian distance between the two nodes this edge connects.
Definition: NavMeshEdge.h:327
void set(Type x, Type y)
Set the x- and y-values from scalar values.
Definition: Vector2.h:121
The navigation mesh adjacency graph edge.
Definition: NavMeshEdge.h:72
float _width
The width of the portal.
Definition: NavMeshEdge.h:382
void setNodes(NavMeshNode *n0, NavMeshNode *n1)
Sets the connected node pointers.
Definition: NavMeshEdge.h:205
float getDist(const Vector2 &pt) const
Reports the distance to the edge from the given point.
Definition: NavMeshEdge.h:307
NavMeshNode * getOtherByID(unsigned int id) const
Returns a pointer to the node on the opposite end of the edge from the given node (by id)...
Definition: NavMeshEdge.cpp:67
float getSqDist(const Vector2 &pt) const
Reports the squared distance to the edge from the given point.
Definition: NavMeshEdge.cpp:100
bool pointOnLeft(unsigned int id) const
Reports if _point in this edge is on the left for the node with the given id.
Definition: NavMeshEdge.cpp:513
Vector2 targetPoint(const Vector2 &pos, float radius) const
Computes a target point with respect to this edge. The target point is a point along the line of the ...
Definition: NavMeshEdge.cpp:181
The class for defining a navigation mesh. A decomposition of the free space into a connected mesh of ...
Definition: NavMesh.h:120
void setDirection(const Vector2 &d)
Sets the edge's direction value.
Definition: NavMeshEdge.h:183
Vector2 getClearDirection(const Vector2 &pos, float radius, const Vector2 &dir) const
Computes the collision-free velocity towards the portal based on the agent radius and the preferred d...
Definition: NavMeshEdge.cpp:244
The definition of a preferred velocity.
Definition: PrefVelocity.h:68
bool pointClear(const Vector2 &pos, float radius, float param) const
Reports if the point q = _point + param * _dir is clear for an agent with the given radius positioned...
Definition: NavMeshEdge.cpp:166
The namespace that contains the basic simulation mechanisms.
~NavMeshEdge()
Destructor.
Definition: NavMeshEdge.cpp:62
Vector2 _dir
The unit-length direction of the portal. See _point for how the portal is defined w...
Definition: NavMeshEdge.h:377
Vector2 getP0() const
Returns the first edge point.
Definition: NavMeshEdge.h:89
void setClearDirections(const Vector2 &pos, float radius, const Vector2 &dir, Agents::PrefVelocity &pVel) const
Sets the directions of a preferred velocity that passes through the edge biased towards the indicated...
Definition: NavMeshEdge.cpp:385
float _distance
The "distance" between the two nodes connected by this edge. Used to estimate the cost of a path (the...
Definition: NavMeshEdge.h:389
Vector2 getDirection() const
Returns the direction of the edge.
Definition: NavMeshEdge.h:119
Vector2 getP0(float dist) const
Returns a point inset from the first end point.
Definition: NavMeshEdge.h:97