OverSim
|
(Abstract) MovementGenerator class More...
#include <MovementGenerator.h>
Public Member Functions | |
MovementGenerator (double areaDimension, double speed, NeighborMap *Neighbors, GlobalCoordinator *coordinator, CollisionList *CollisionRect) | |
Initialize the generator with the movement area dimensions and node movement speed. | |
virtual | ~MovementGenerator () |
virtual void | move ()=0 |
Defined in subclasses only. | |
Vector2D | getPosition () |
Get the nodes current position. |
Protected Member Functions | |
bool | testBounds () |
Prevents the node from leaving the defined area and checks for obstacle hits. | |
void | flock () |
Simple flocking algorithm. | |
void | generateScenery (unsigned int seed) |
Generates scenery objects. |
Protected Attributes | |
double | areaDimension |
double | speed |
Vector2D | direction |
Vector2D | position |
Vector2D | target |
NeighborMap * | Neighbors |
NeighborMap::iterator | itNeighbors |
GlobalCoordinator * | coordinator |
CollisionList * | CollisionRect |
(Abstract) MovementGenerator class
An interface for different movement generation set-ups.
Definition at line 52 of file MovementGenerator.h.
MovementGenerator::MovementGenerator | ( | double | areaDimension, |
double | speed, | ||
NeighborMap * | Neighbors, | ||
GlobalCoordinator * | coordinator, | ||
CollisionList * | CollisionRect | ||
) |
Initialize the generator with the movement area dimensions and node movement speed.
@param areaDimension Movement range from [-areaDimension, -areaDimension] to [areaDimension, areaDimension]. @param speed Movement speed in units per movement.
Definition at line 31 of file MovementGenerator.cc.
|
inlinevirtual |
Definition at line 61 of file MovementGenerator.h.
|
protected |
Simple flocking algorithm.
Definition at line 120 of file MovementGenerator.cc.
Referenced by greatGathering::move(), traverseRoaming::move(), randomRoaming::move(), groupRoaming::move(), and hotspotRoaming::move().
|
protected |
Generates scenery objects.
Definition at line 147 of file MovementGenerator.cc.
Referenced by MovementGenerator().
Vector2D MovementGenerator::getPosition | ( | ) |
Get the nodes current position.
@return Returns the current node position.
Definition at line 49 of file MovementGenerator.cc.
Referenced by SimpleGameClient::updatePosition().
|
pure virtual |
Defined in subclasses only.
Implemented in hotspotRoaming, greatGathering, groupRoaming, randomRoaming, traverseRoaming, and realWorldRoaming.
Referenced by SimpleGameClient::updatePosition().
|
protected |
Prevents the node from leaving the defined area and checks for obstacle hits.
Definition at line 54 of file MovementGenerator.cc.
Referenced by greatGathering::move(), traverseRoaming::move(), randomRoaming::move(), groupRoaming::move(), and hotspotRoaming::move().
|
protected |
Definition at line 71 of file MovementGenerator.h.
Referenced by generateScenery(), hotspotRoaming::getDistanceFromHotspot(), groupRoaming::move(), randomRoaming::move(), hotspotRoaming::move(), MovementGenerator(), testBounds(), and traverseRoaming::traverseRoaming().
|
protected |
Definition at line 82 of file MovementGenerator.h.
Referenced by generateScenery(), MovementGenerator(), and testBounds().
|
protected |
Definition at line 81 of file MovementGenerator.h.
Referenced by groupRoaming::move(), traverseRoaming::move(), hotspotRoaming::move(), and MovementGenerator().
|
protected |
Definition at line 72 of file MovementGenerator.h.
Referenced by flock(), groupRoaming::move(), traverseRoaming::move(), randomRoaming::move(), greatGathering::move(), hotspotRoaming::move(), MovementGenerator(), testBounds(), and traverseRoaming::traverseRoaming().
|
protected |
Definition at line 80 of file MovementGenerator.h.
Referenced by flock().
|
protected |
Definition at line 79 of file MovementGenerator.h.
Referenced by flock(), and MovementGenerator().
|
protected |
Definition at line 72 of file MovementGenerator.h.
Referenced by flock(), hotspotRoaming::getDistanceFromHotspot(), getPosition(), traverseRoaming::move(), groupRoaming::move(), randomRoaming::move(), greatGathering::move(), hotspotRoaming::move(), MovementGenerator(), realWorldRoaming::setPosition(), testBounds(), and traverseRoaming::traverseRoaming().
|
protected |
Definition at line 71 of file MovementGenerator.h.
Referenced by greatGathering::move(), groupRoaming::move(), randomRoaming::move(), traverseRoaming::move(), hotspotRoaming::move(), and MovementGenerator().
|
protected |
Definition at line 72 of file MovementGenerator.h.
Referenced by flock(), greatGathering::greatGathering(), groupRoaming::groupRoaming(), hotspotRoaming::hotspotRoaming(), randomRoaming::move(), traverseRoaming::move(), groupRoaming::move(), hotspotRoaming::move(), randomRoaming::randomRoaming(), and traverseRoaming::traverseRoaming().