#include <Aviary.h>
Public Methods | |
Aviary (BoidType m_boidType, char *modelFileName, char *textureFile, char *renderStyleSet, float scale, float mass, float maxVelocity, float maxAcceleration, bool circleDirection) | |
Constructor to set up an Aviary. More... | |
virtual | ~Aviary () |
void | Behave (HOBJECT hObject, float fFrameTime) |
Call this function on each frame from each boid. More... | |
LTRESULT | GenBoid (LTVector3f startPoint) |
Generate a boid in this aviary. More... | |
LTRESULT | KillBoid () |
Remove a boid from this aviary. More... | |
LTRESULT | KillBoid (CBoidModel *pBoid) |
Remove a specified boid from this aviary. More... | |
void | setSeekPoint (const LTVector3f &dest) |
void | getSeekPoint (LTVector3f *dest) |
void | setSeekPoint (BoidDestination which, LTVector3f &dest) |
Sets the vector associated with the specified destination. More... | |
void | getSeekPoint (BoidDestination which, LTVector3f *dest) |
LTVector3f | getSeekPoint (BoidDestination which) |
Returns the vector associated with the specified destination. More... | |
void | setSeekPointWeight (BoidDestination which, float weight) |
Sets the current weight associated with the specified destination. More... | |
float | getSeekPointWeight (BoidDestination which) |
Returns the current weight associated with the specified destination. More... | |
void | setRadius (float rad) |
Defines the radius of a boid in this aviary. More... | |
float | getRadius () |
Returns the defined radius of a boid in this aviary. More... | |
int | getNumBoids () |
Returns number of boids presently in this aviary. More... | |
void | setMaxSpeed (const float &x) |
void | setMaxForce (const float &x) |
float | getMaxSpeed () |
float | getMaxForce () |
void | populateDefaultAviary () |
Generates a prototype aviary with reasonable values. More... | |
Protected Methods | |
void | issueNewSeekPoint (LTVector3f *dest) |
Copy the next seekpoint into *dest. More... | |
BoidDestination | selectNewSeekPoint () |
Returns a new BoidDestination based on internal weights. More... | |
void | initInternalOCS (BoidType m_boidType, char *modelFileName, char *textureFile, char *renderStyleSet, float scale, float mass, float maxVelocity, float maxAcceleration) |
void | BirdHasReachedPoint (CBoidModel *pBoid) |
Updates the state machine for a boid's destination and behavior. More... | |
Protected Attributes | |
BoidBehavior | m_style |
Current behavior pursued by all boids in this aviary. More... | |
LTVector3f | m_seekPoints [AV_NUMSEEKPOINTS] |
An internal array of all possible destinations this aviary is concerned with. More... | |
float | m_seekPointWeights [AV_NUMSEEKPOINTS] |
Weights used for the random selection of next seekpoint. More... | |
float | m_maxSpeed |
float | m_maxForce |
float | m_birdRadius |
bool | m_bCircleDirection |
BoidType | m_boidType |
vector< CBoidModel * > | m_boids |
ObjectCreateStruct | m_ocs |
Object creation structure for all boids generated by this aviary. More... | |
float | m_weight |
For reasons of efficiency we prefer to store all the behavior state for a group of boids that behave identically in one place. This includes current destination and the list of objects to be avoided. This means we can change current destinations without having to iterate over all the boids in the engine.
|
Constructor to set up an Aviary. This is the full constructor used to create an aviary which may then spawn boids. Each aviary defines one style of boid and boid behavior, and remembers the modeltype associated with each type of boid so that new ones may be instantiated properly.
|
|
|
|
Call this function on each frame from each boid. This function alters the current velocity and orientation of a boid according to the appropriate logic and state.
|
|
Updates the state machine for a boid's destination and behavior. This function basically handles the state-machine gobbledygook of what happens when a boid gets to where it's going. It should only be called from inside Aviary::Behave
|
|
Generate a boid in this aviary. Creates a new boid within this aviary, with the same behaviour and model as all the other boids in this aviary.
|
|
|
|
|
|
Returns number of boids presently in this aviary.
|
|
Returns the defined radius of a boid in this aviary.
|
|
Returns the vector associated with the specified destination.
|
|
Retrieves the vector associated with the specified destination
|
|
Retrieves the first destination in the aviary
|
|
Returns the current weight associated with the specified destination.
|
|
Populates the internal ObjectCreateStruct Be extremely careful with this one. It's meant to be used by the constructor to set up the internal data structure that's used to generate all the boids that come from this aviary. |
|
Copy the next seekpoint into *dest.
|
|
Remove a specified boid from this aviary.
|
|
Remove a boid from this aviary. Removes an existing boid from this aviary. At the moment, the last boid that was created is the one that is removed. |
|
Generates a prototype aviary with reasonable values.
|
|
Returns a new BoidDestination based on internal weights. Intended to be called from within the Aviary, this function returns a random BoidDestination based on the internal probability weightings (which are presumably derived from the player ratings). This function does not have side effects; it simply rolls a die and returns an enum.
|
|
|
|
|
|
Defines the radius of a boid in this aviary.
|
|
Sets the vector associated with the specified destination.
|
|
Sets the first destination in the aviary
|
|
Sets the current weight associated with the specified destination.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Object creation structure for all boids generated by this aviary.
|
|
An internal array of all possible destinations this aviary is concerned with.
|
|
Weights used for the random selection of next seekpoint.
|
|
Current behavior pursued by all boids in this aviary.
|
|
|