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 | Public Attributes | Protected Member Functions | List of all members
OpenSteer::Agent Class Reference

The agent definition for the OpenSteer model. More...

#include <OpenSteerAgent.h>

Inheritance diagram for OpenSteer::Agent:

Public Member Functions

 Agent ()
 Default constructor.
 
 ~Agent ()
 Destroys this agent instance.
 
void computeNewVelocity ()
 Computes the new velocity of this agent.
 

Public Attributes

float _tau
 The time horizon for predicting agent collisions.
 
float _tauObst
 The time horizon for predicting obstacle collisions.
 

Protected Member Functions

bool steerToAvoidObstacles (const Vector2 &forward, Vector2 &avoidForce, const float maxForce)
 Determine steering force to avoid obstacles. More...
 
bool steerToAvoidNeighbors (const Vector2 &forward, Vector2 &avoidForce)
 Determine steering force to avoid agents. More...
 
Vector2 calcBoidAccel (Vector2 &force, const Vector2 &forward)
 Clamp acceleration according to OpenSteer rules. More...
 

Detailed Description

The agent definition for the OpenSteer model.

Member Function Documentation

Vector2 OpenSteer::Agent::calcBoidAccel ( Vector2 &  force,
const Vector2 &  forward 
)
protected

Clamp acceleration according to OpenSteer rules.

This function converts the force into a mass by processing it according to constraints and then dividing it by the agent's mass.

Parameters
forceThe accelerating force computed.
forwardThe agent's facing direction.
Returns
The acceleration the agent should experience.
bool OpenSteer::Agent::steerToAvoidNeighbors ( const Vector2 &  forward,
Vector2 &  avoidForce 
)
protected

Determine steering force to avoid agents.

Parameters
forwardThe forward direction of the agent
avoidForceThe avoidance force will be placed in this parameter.
Returns
True if steering is required and the value in avoidForce is meaningful. Otherwise, false, and avoidForce's value should be ignored.
bool OpenSteer::Agent::steerToAvoidObstacles ( const Vector2 &  forward,
Vector2 &  avoidForce,
const float  maxForce 
)
protected

Determine steering force to avoid obstacles.

Parameters
forwardThe forward direction of the agent
avoidForceThe avoidance force will be placed in this parameter.
maxForceThe maximum allowable magnitude for the avoidance force.
Returns
True if steering is required and the value in avoidForce is meaningful. Otherwise, false, and avoidForce's value should be ignored.

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