45 #ifndef __PEDVO_AGENT_CONTEXT_H__
46 #define __PEDVO_AGENT_CONTEXT_H__
48 #include "../Orca/ORCATypeAgentContext.h"
78 glPushAttrib( GL_POINT_BIT );
81 glColor3f( 0.2f, 0.2f, 1.f );
88 Vector2 n( -prefDir.y(), prefDir.x() );
89 float vx = agent->
_velNew * prefDir;
92 glColor3f( 1.f, 0.1f, 1.f );
94 glVertex3f( agent->
_pos.
x() + vx, Y, agent->
_pos.
y() + vy );
97 writeTextRadially(
" v_new^x", agent->
_pos + vn, vn,
true );
121 bool rotated =
false;
124 Vector2 n( prefDir.y(), prefDir.x() );
132 float px = p * prefDir;
134 float dx = d * prefDir;
140 px = line.
_point * prefDir;
150 drawHalfPlane( lAffine, agent->
_pos, 1.f, 0.5f, 0.f, Y );
151 if ( ! _showOrcaLines ) drawHalfPlane( lEuclid, agent->
_pos, 1.f, 0.f, 0.f, Y );
153 drawHalfPlane( lAffine, agent->
_pos, 0.5f, 0.5f, 0.5f, Y );
154 if ( ! _showOrcaLines ) drawHalfPlane( lEuclid, agent->
_pos, 0.75f, 0.75f, 0.75f, Y );
158 drawHalfPlane( lEuclid, agent->
_pos, 1.f, 0.f, 0.f, Y );
160 drawHalfPlane( lEuclid, agent->
_pos, 0.75f, 0.75f, 0.75f, Y );
166 drawHalfPlane( line, agent->
_pos, 1.f, 0.f, 0.f, Y );
168 drawHalfPlane( line, agent->
_pos, 0.75f, 0.75f, 0.75f, Y );
173 #endif // __PEDVO_AGENT_CONTEXT_H__
PrefVelocity _velPref
The 2D preferred velocity of the agent.
Definition: BaseAgent.h:218
void drawORCALine(const Agent *agent, const Menge::Math::Line &line, bool isAgent) const
Draws the given ORCA line for the given agent.
Definition: ORCATypeAgentContext.h:500
ORCATypeAgentContext< Agent > PedVOAgentContext
Declaration of ORCA-type agent context for PedVO agents.
Definition: PedVOAgentContext.h:55
Context class for displaying various aspects of the ORCA-type agent computation.
Definition: ORCATypeAgentContext.h:62
Vector2 _pos
The current 2D position of the agent.
Definition: BaseAgent.h:208
MENGE_API const float EPS
Suitably small number for testing for functional zero values.
Definition: geomQuery.cpp:52
Contains the specification of the pedestrian model based on Pedestrian Velocity Obstacles.
Definition: PedVOAgent.cpp:46
Vector2 _direction
The direction of the directed line.
Definition: Line.h:91
void set(Type x, Type y)
Set the x- and y-values from scalar values.
Definition: Vector2.h:121
virtual std::string contextName() const
Returns the name of the context for display.
Definition: ORCATypeAgentContext.h:77
Vector2 _velNew
The new velocity computed in computeNewVelocity.
Definition: BaseAgent.h:226
Contains the PedVOAgent class.
float _turningBias
Turning bias.
Definition: PedVOAgent.h:163
Defines an agent in the simulation.
Definition: PedVOAgent.h:54
float getSpeed() const
Returns the speed of the preferred velocity.
Definition: PrefVelocity.h:145
Vector2 getPreferred() const
Returns the preferred direction of the span.
Definition: PrefVelocity.h:129
Defines a directed line.
Definition: Line.h:57
void drawOptVelocity(Agent *agent) const
Draw the optimized velocity for the current set of orca lines.
Definition: ORCATypeAgentContext.h:511
Type x() const
Get the x-value.
Definition: Vector2.h:106
void computeNewVelocity()
Computes the new velocity of this agent.
Definition: PedVOAgent.cpp:562
Type y() const
Get the y-value.
Definition: Vector2.h:113
Vector2 _point
A point on the directed line.
Definition: Line.h:86