The context for displaying the computational aspects of the Zanlungo model (see Agents::Zanlungo::Agent).
More...
#include <ZanlungoAgentContext.h>
|
bool | _showTTI |
| Determines whether the time to interaction is displayed.
|
|
int | _ttiObject |
| The id of the time to interaction structure shown. If zero, all agents, if positive, a single agent if negative, an obstacle.
|
|
bool | _showForce |
| Determines if the force vectors are drawn.
|
|
The context for displaying the computational aspects of the Zanlungo model (see Agents::Zanlungo::Agent).
Zanlungo::AgentContext::AgentContext |
( |
VisAgent ** |
agents, |
|
|
unsigned int |
agtCount |
|
) |
| |
Constructor.
- Parameters
-
agents | An array of pointers to VisAgent instances for Zanlungo agents. |
agtCount | The number of agents contained in the array. |
std::string Zanlungo::AgentContext::agentText |
( |
const Agents::BaseAgent * |
agent | ) |
const |
|
protectedvirtual |
Creates a formatted string to be printed in the context for a particular agent.
- Parameters
-
agent | The agent whose data is to be displayed. |
- Returns
- A formatted string for display in the context's 2D gui.
virtual std::string Zanlungo::AgentContext::contextName |
( |
| ) |
const |
|
inlinevirtual |
Returns the name of the context for display.
- Returns
- The name of this context.
Reimplemented from Menge::BaseAgentContext.
void Zanlungo::AgentContext::draw3DGL |
( |
bool |
select = false | ) |
|
|
protectedvirtual |
Draw context elements into the 3D world.
- Parameters
-
select | Defines if the drawing is being done for selection purposes (true) or visualization (false). |
Reimplemented from Menge::BaseAgentContext.
void Zanlungo::AgentContext::drawForce |
( |
const Agent * |
agt | ) |
|
|
protected |
Function for drawing the force vectors acting on agt.
- Parameters
-
agt | The agent whose forces are displayed. |
void Zanlungo::AgentContext::drawOrientationFan |
( |
const Agent * |
agt | ) |
|
|
protected |
Draws the orientation of the agent.
- Parameters
-
agt | The agent whose orientation displayed. |
void Zanlungo::AgentContext::drawTTI |
( |
const Agent * |
agt | ) |
|
|
protected |
Function for illustrating time to interaction computation.
- Parameters
-
agt | The agent whose time to interaction is displayed. |
SceneGraph::ContextResult Zanlungo::AgentContext::handleKeyboard |
( |
SDL_Event & |
e | ) |
|
|
virtual |
Give the context the opportunity to respond to a keyboard event.
- Parameters
-
e | The SDL event with the keyboard event data. |
- Returns
- A ContextResult instance reporting if the event was handled and if redrawing is necessary.
Reimplemented from Menge::BaseAgentContext.
void Zanlungo::AgentContext::singleAgentForce |
( |
const Agent * |
agt, |
|
|
const Agent * |
other, |
|
|
float |
TTI |
|
) |
| |
|
protected |
Draw the force vector from srcAgent acting on agt.
- Parameters
-
agt | The agent on which the force is acting |
other | The agent imparting the force |
TTI | Time to interaction |
The documentation for this class was generated from the following files: