Menge Plugin Examples
A Collection of Example Plugins for the Menge Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Formations::FormationModifier Class Reference

A velocity modifier which adapts agent preferred velocities so that they move in formations. More...

#include <FormationsModifier.h>

Inheritance diagram for Formations::FormationModifier:

Public Member Functions

 FormationModifier ()
 Constructor.
 
 FormationModifier (FormationPtr form)
 Constructor for given Formation. More...
 
BFSM::VelModifier * copy () const
 Creates a copy of this velocity modifier.
 
void adaptPrefVelocity (const Agents::BaseAgent *agent, Agents::PrefVelocity &pVel)
 Adapt the input preferred velocity according to the formation. More...
 
virtual BFSM::Task * getTask ()
 Provides the task the formation modifier uses to update formations. More...
 
void setFormation (FormationPtr form)
 Set the formation data. More...
 
void registerAgent (const Agents::BaseAgent *agent)
 Register an agent to be affected by this velocity modifier.
 
void unregisterAgent (const Agents::BaseAgent *agent)
 Unregister an agent from being affected by this velocity modifier.
 

Protected Member Functions

virtual ~FormationModifier ()
 Destructor.
 

Protected Attributes

FormationPtr _formation
 The underlying formation data.
 
ReadersWriterLock _lock
 Concurrency lock for _formation.
 

Friends

class FormationModifierFactory
 Provides a display context for interacting with this velocity modifier. More...
 

Detailed Description

A velocity modifier which adapts agent preferred velocities so that they move in formations.

Constructor & Destructor Documentation

Formations::FormationModifier::FormationModifier ( FormationPtr  form)

Constructor for given Formation.

Parameters
formA managed pointer to formation data

Member Function Documentation

void Formations::FormationModifier::adaptPrefVelocity ( const Agents::BaseAgent *  agent,
Agents::PrefVelocity &  pVel 
)

Adapt the input preferred velocity according to the formation.

Parameters
agentThe agent whose preferred velocity is provided.
pVelThe preferred velocity to modify – modified in place.
BFSM::Task * Formations::FormationModifier::getTask ( )
virtual

Provides the task the formation modifier uses to update formations.

Returns
A pointer to the supporting task. The caller is responsible to delete it.
void Formations::FormationModifier::setFormation ( FormationPtr  form)

Set the formation data.

Parameters
formA managed resource pointer to the underlying formation data.

Friends And Related Function Documentation

friend class FormationModifierFactory
friend

Provides a display context for interacting with this velocity modifier.

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

Returns
A pointer to a context for this velocity modifier

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