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 Member Functions | Friends | List of all members
Menge::BFSM::VelComponent Class Referenceabstract

The base class for computing an agent's preferred velocity. More...

#include <VelComponent.h>

Inheritance diagram for Menge::BFSM::VelComponent:
Menge::Element Menge::BFSM::ConstVelComponent Menge::BFSM::ConstVelDirComponent Menge::BFSM::GoalVelComponent Menge::BFSM::NavMeshVelComponent Menge::BFSM::RoadMapVelComponent Menge::BFSM::VFVelComponent Menge::BFSM::ZeroVelComponent

Public Member Functions

 VelComponent ()
 Default constructor.
 
virtual void onEnter (Agents::BaseAgent *agent)
 Called when the agent enters the state which possesses this velocity component. More...
 
virtual void onExit (Agents::BaseAgent *agent)
 Called when the agent leaves the state which possesses this velocity component. More...
 
virtual void setPrefVelocity (const Agents::BaseAgent *agent, const Goal *goal, Agents::PrefVelocity &pVel)=0
 Computes and sets the agent's preferred velocity. More...
 
virtual VelCompContextgetContext ()
 Provides a display context for interacting with this velocity component. More...
 
- Public Member Functions inherited from Menge::Element
void destroy ()
 This supplants the destructor. More...
 
virtual BFSM::TaskgetTask ()
 Return an optional task associated with this element. More...
 
virtual SceneGraph::GLNodegetSGNode ()
 Returns an optional visualization element associated with the element. More...
 

Protected Member Functions

virtual ~VelComponent ()
 Virtual destructor.
 

Friends

class ElementFactory< VelComponent >
 

Detailed Description

The base class for computing an agent's preferred velocity.

Velocity components each have weights. The relative weights determine how multiple velocity components combine inside a single state. Their share is its own weight divided by the summed weight of all velocity components.

Member Function Documentation

VelCompContext * Menge::BFSM::VelComponent::getContext ( )
virtual

Provides a display context for interacting with this velocity component.

It is the responsibility of the caller to delete the provided context.

Returns
A pointer to a context for this vel component.

Reimplemented in Menge::BFSM::ZeroVelComponent, Menge::BFSM::ConstVelDirComponent, Menge::BFSM::NavMeshVelComponent, Menge::BFSM::RoadMapVelComponent, Menge::BFSM::VFVelComponent, Menge::BFSM::ConstVelComponent, and Menge::BFSM::GoalVelComponent.

virtual void Menge::BFSM::VelComponent::onEnter ( Agents::BaseAgent agent)
inlinevirtual

Called when the agent enters the state which possesses this velocity component.

Gives the velocity component to intialize any agent-specific data.

Parameters
agentThe agent who entered the state.
virtual void Menge::BFSM::VelComponent::onExit ( Agents::BaseAgent agent)
inlinevirtual

Called when the agent leaves the state which possesses this velocity component.

Gives the velocity component to restore any agent-specific data it might have changed.

Parameters
agentThe agent who left the state.

Reimplemented in Menge::BFSM::RoadMapVelComponent, and Menge::BFSM::NavMeshVelComponent.

virtual void Menge::BFSM::VelComponent::setPrefVelocity ( const Agents::BaseAgent agent,
const Goal goal,
Agents::PrefVelocity pVel 
)
pure virtual

Computes and sets the agent's preferred velocity.

The velocity component directly sets preferred velocity values in the the provided preferred velocity instance. See Agents::PrefVelocity for details. Rather than setting the agent's preferred velocity value directly, a reference to a preferred velocity instance is passed in to make the use more general. This allows the computation of the preferred velocity for the agent, without necessarily making changes to it.

Parameters
agentThe agent for which a preferred velocity is computed.
goalThe agent's goal (although this may be ignored).
pVelThe instance of Agents::PrefVelocity to set.

Implemented in Menge::BFSM::ZeroVelComponent, Menge::BFSM::ConstVelDirComponent, Menge::BFSM::NavMeshVelComponent, Menge::BFSM::RoadMapVelComponent, Menge::BFSM::VFVelComponent, Menge::BFSM::ConstVelComponent, and Menge::BFSM::GoalVelComponent.


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