#include <flock.h>
Public Member Functions | |
Flock (Group *grp, GroupTarget *tgt) | |
bool | done () |
void | init () |
void | tick (double dt) |
void | postProcess () |
virtual Command * | clone () |
int | closestToTarget (bool closest) |
int | mostMassive (bool massivest) |
Flock (Group *grp, GroupTarget *tgt) | |
bool | done () |
void | init () |
void | tick (double dt) |
void | postProcess () |
int | closestToTarget (bool closest) |
int | mostMassive (bool massivest) |
Flock (Group *grp, GroupTarget *tgt) | |
bool | done () |
void | init () |
void | tick (double dt) |
void | postProcess () |
int | closestToTarget (bool closest) |
int | mostMassive (bool massivest) |
Flock (Group *grp, GroupTarget *tgt) | |
bool | done () |
void | init () |
void | tick (double dt) |
void | postProcess () |
int | closestToTarget (bool closest) |
int | mostMassive (bool massivest) |
Flock (Group *grp, GroupTarget *tgt) | |
bool | done () |
void | init () |
void | tick (double dt) |
void | postProcess () |
int | closestToTarget (bool closest) |
int | mostMassive (bool massivest) |
Private Member Functions | |
bool | valid (Group *grp) |
Ogre::Vector3 | cohesion (int i) |
Ogre::Vector3 | alignment (int i) |
void | computeSeparation (int leaderIndex) |
void | applyForces (int leaderIndex) |
void | bringWithinNeighborhood () |
bool | valid (Group *grp) |
Ogre::Vector3 | cohesion (int i) |
Ogre::Vector3 | alignment (int i) |
void | computeSeparation (int leaderIndex) |
void | applyForces (int leaderIndex) |
void | bringWithinNeighborhood () |
bool | valid (Group *grp) |
Ogre::Vector3 | cohesion (int i) |
Ogre::Vector3 | alignment (int i) |
void | computeSeparation (int leaderIndex) |
void | applyForces (int leaderIndex) |
void | bringWithinNeighborhood () |
bool | valid (Group *grp) |
Ogre::Vector3 | cohesion (int i) |
Ogre::Vector3 | alignment (int i) |
void | computeSeparation (int leaderIndex) |
void | applyForces (int leaderIndex) |
void | bringWithinNeighborhood () |
bool | valid (Group *grp) |
Ogre::Vector3 | cohesion (int i) |
Ogre::Vector3 | alignment (int i) |
void | computeSeparation (int leaderIndex) |
void | applyForces (int leaderIndex) |
void | bringWithinNeighborhood () |
Private Attributes | |
Ogre::Vector3 | avgPos |
Ogre::Vector3 | avgVel |
Ogre::Vector3 | force |
float | CohesionParameter |
float | AlignmentParameter |
float | SeparationParameter |
float | SeparationThreshold |
float | maxSpeedByAngle [MaxEnts] |
Entity * | nonNeighbors [MaxEnts] |
int | nNonNeighbors |
Ogre::Vector3 | forces [MaxEnts] |
Entity ** | members |
int | nMembers |
int | nEnts |
DistanceMgr * | distanceMgr |
EntityMgr * | entityMgr |
Entity * | nonNeighbors [MaxEnts] |
Entity ** | members |
DistanceMgr * | distanceMgr |
EntityMgr * | entityMgr |
Entity * | nonNeighbors [MaxEnts] |
Entity ** | members |
DistanceMgr * | distanceMgr |
EntityMgr * | entityMgr |
Entity * | nonNeighbors [MaxEnts] |
Entity ** | members |
DistanceMgr * | distanceMgr |
EntityMgr * | entityMgr |
Entity * | nonNeighbors [MaxEnts] |
Entity ** | members |
DistanceMgr * | distanceMgr |
EntityMgr * | entityMgr |
Definition at line 24 of file flock.h.
FastEcslent::Flock::Flock | ( | Group * | grp, | |
GroupTarget * | tgt | |||
) |
FastEcslent::Flock::Flock | ( | Group * | grp, | |
GroupTarget * | tgt | |||
) |
FastEcslent::Flock::Flock | ( | Group * | grp, | |
GroupTarget * | tgt | |||
) |
FastEcslent::Flock::Flock | ( | Group * | grp, | |
GroupTarget * | tgt | |||
) |
FastEcslent::Flock::Flock | ( | Group * | grp, | |
GroupTarget * | tgt | |||
) |
bool FastEcslent::Flock::valid | ( | Group * | grp | ) | [inline, private] |
Ogre::Vector3 FastEcslent::Flock::cohesion | ( | int | i | ) | [inline, private] |
Definition at line 65 of file flock.cpp.
References avgPos, CohesionParameter, force, members, and FastEcslent::Entity::pos.
Referenced by tick().
Ogre::Vector3 FastEcslent::Flock::alignment | ( | int | i | ) | [inline, private] |
Definition at line 75 of file flock.cpp.
References AlignmentParameter, avgVel, force, members, and FastEcslent::Entity::vel.
Referenced by tick().
void FastEcslent::Flock::computeSeparation | ( | int | leaderIndex | ) | [inline, private] |
Definition at line 85 of file flock.cpp.
References FastEcslent::DistanceMgr::distance, distanceMgr, FastEcslent::Entity::entityId, entityMgr, FastEcslent::EntityMgr::ents, forces, FastEcslent::Identity::id, FastEcslent::Entity::mass, members, nEnts, nMembers, FastEcslent::DistanceMgr::normalizedDistanceVec, SeparationParameter, SeparationThreshold, and FastEcslent::Entity::speed.
Referenced by tick().
void FastEcslent::Flock::applyForces | ( | int | leaderIndex | ) | [inline, private] |
Definition at line 115 of file flock.cpp.
References FastEcslent::Entity::desiredHeading, FastEcslent::Entity::desiredSpeed, forces, maxSpeedByAngle, members, FastEcslent::Entity::minSpeed, nMembers, and FastEcslent::Entity::vel.
Referenced by tick().
void FastEcslent::Flock::bringWithinNeighborhood | ( | ) | [private] |
bool FastEcslent::Flock::done | ( | ) | [inline, virtual] |
void FastEcslent::Flock::init | ( | void | ) | [virtual] |
Implements FastEcslent::Command.
Definition at line 32 of file flock.cpp.
References AlignmentParameter, CohesionParameter, DEBUG, FastEcslent::Engine::distanceMgr, distanceMgr, FastEcslent::Group::engine, FastEcslent::Engine::entityMgr, entityMgr, FastEcslent::Tactic::group, FastEcslent::Group::leaderIndex, FastEcslent::Entity::maxSpeed, maxSpeedByAngle, FastEcslent::Group::members, members, FastEcslent::Entity::minSpeed, FastEcslent::Group::nEntitiesInGroup, FastEcslent::EntityMgr::nEnts, nEnts, nMembers, SeparationParameter, SeparationThreshold, and FastEcslent::Entity::uiname.
void FastEcslent::Flock::tick | ( | double | dt | ) | [inline, virtual] |
Implements FastEcslent::Command.
Definition at line 127 of file flock.cpp.
References alignment(), applyForces(), avgPos, avgVel, cohesion(), computeSeparation(), forces, FastEcslent::Tactic::group, FastEcslent::Group::leaderIndex, members, nMembers, FastEcslent::Entity::pos, and FastEcslent::Entity::vel.
void FastEcslent::Flock::postProcess | ( | ) | [inline, virtual] |
virtual Command* FastEcslent::Flock::clone | ( | ) | [inline, virtual] |
int FastEcslent::Flock::closestToTarget | ( | bool | closest | ) |
int FastEcslent::Flock::mostMassive | ( | bool | massivest | ) |
Reimplemented from FastEcslent::Tactic.
bool FastEcslent::Flock::valid | ( | Group * | grp | ) | [inline, private] |
Ogre::Vector3 FastEcslent::Flock::cohesion | ( | int | i | ) | [private] |
Ogre::Vector3 FastEcslent::Flock::alignment | ( | int | i | ) | [private] |
void FastEcslent::Flock::computeSeparation | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::applyForces | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::bringWithinNeighborhood | ( | ) | [private] |
bool FastEcslent::Flock::done | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::init | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::tick | ( | double | dt | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::postProcess | ( | ) | [inline, virtual] |
int FastEcslent::Flock::closestToTarget | ( | bool | closest | ) |
int FastEcslent::Flock::mostMassive | ( | bool | massivest | ) |
Reimplemented from FastEcslent::Tactic.
bool FastEcslent::Flock::valid | ( | Group * | grp | ) | [inline, private] |
Ogre::Vector3 FastEcslent::Flock::cohesion | ( | int | i | ) | [private] |
Ogre::Vector3 FastEcslent::Flock::alignment | ( | int | i | ) | [private] |
void FastEcslent::Flock::computeSeparation | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::applyForces | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::bringWithinNeighborhood | ( | ) | [private] |
bool FastEcslent::Flock::done | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::init | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::tick | ( | double | dt | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::postProcess | ( | ) | [inline, virtual] |
int FastEcslent::Flock::closestToTarget | ( | bool | closest | ) |
int FastEcslent::Flock::mostMassive | ( | bool | massivest | ) |
Reimplemented from FastEcslent::Tactic.
bool FastEcslent::Flock::valid | ( | Group * | grp | ) | [inline, private] |
Ogre::Vector3 FastEcslent::Flock::cohesion | ( | int | i | ) | [private] |
Ogre::Vector3 FastEcslent::Flock::alignment | ( | int | i | ) | [private] |
void FastEcslent::Flock::computeSeparation | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::applyForces | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::bringWithinNeighborhood | ( | ) | [private] |
bool FastEcslent::Flock::done | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::init | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::tick | ( | double | dt | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::postProcess | ( | ) | [inline, virtual] |
int FastEcslent::Flock::closestToTarget | ( | bool | closest | ) |
int FastEcslent::Flock::mostMassive | ( | bool | massivest | ) |
Reimplemented from FastEcslent::Tactic.
bool FastEcslent::Flock::valid | ( | Group * | grp | ) | [inline, private] |
Ogre::Vector3 FastEcslent::Flock::cohesion | ( | int | i | ) | [private] |
Ogre::Vector3 FastEcslent::Flock::alignment | ( | int | i | ) | [private] |
void FastEcslent::Flock::computeSeparation | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::applyForces | ( | int | leaderIndex | ) | [private] |
void FastEcslent::Flock::bringWithinNeighborhood | ( | ) | [private] |
bool FastEcslent::Flock::done | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::init | ( | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::tick | ( | double | dt | ) | [virtual] |
Implements FastEcslent::Command.
void FastEcslent::Flock::postProcess | ( | ) | [inline, virtual] |
int FastEcslent::Flock::closestToTarget | ( | bool | closest | ) |
int FastEcslent::Flock::mostMassive | ( | bool | massivest | ) |
Reimplemented from FastEcslent::Tactic.
Ogre::Vector3 FastEcslent::Flock::avgPos [private] |
Ogre::Vector3 FastEcslent::Flock::avgVel [private] |
Ogre::Vector3 FastEcslent::Flock::force [private] |
float FastEcslent::Flock::CohesionParameter [private] |
float FastEcslent::Flock::AlignmentParameter [private] |
float FastEcslent::Flock::SeparationParameter [private] |
float FastEcslent::Flock::SeparationThreshold [private] |
float FastEcslent::Flock::maxSpeedByAngle [private] |
Entity* FastEcslent::Flock::nonNeighbors[MaxEnts] [private] |
int FastEcslent::Flock::nNonNeighbors [private] |
Ogre::Vector3 FastEcslent::Flock::forces [private] |
Definition at line 45 of file flock.h.
Referenced by applyForces(), computeSeparation(), and tick().
Entity** FastEcslent::Flock::members [private] |
Definition at line 46 of file flock.h.
Referenced by alignment(), applyForces(), cohesion(), computeSeparation(), init(), and tick().
int FastEcslent::Flock::nMembers [private] |
Definition at line 47 of file flock.h.
Referenced by applyForces(), computeSeparation(), init(), and tick().
int FastEcslent::Flock::nEnts [private] |
DistanceMgr* FastEcslent::Flock::distanceMgr [private] |
EntityMgr* FastEcslent::Flock::entityMgr [private] |
Entity* FastEcslent::Flock::nonNeighbors[MaxEnts] [private] |
Entity** FastEcslent::Flock::members [private] |
DistanceMgr* FastEcslent::Flock::distanceMgr [private] |
EntityMgr* FastEcslent::Flock::entityMgr [private] |
Entity* FastEcslent::Flock::nonNeighbors[MaxEnts] [private] |
Entity** FastEcslent::Flock::members [private] |
DistanceMgr* FastEcslent::Flock::distanceMgr [private] |
EntityMgr* FastEcslent::Flock::entityMgr [private] |
Entity* FastEcslent::Flock::nonNeighbors[MaxEnts] [private] |
Entity** FastEcslent::Flock::members [private] |
DistanceMgr* FastEcslent::Flock::distanceMgr [private] |
EntityMgr* FastEcslent::Flock::entityMgr [private] |
Entity* FastEcslent::Flock::nonNeighbors[MaxEnts] [private] |
Entity** FastEcslent::Flock::members [private] |
DistanceMgr* FastEcslent::Flock::distanceMgr [private] |
EntityMgr* FastEcslent::Flock::entityMgr [private] |