A class that implements the virtual AI world which keeps track of the AI characters active at any given time. It contains a linked list of AI characters, obstactle data and unique name for each character. It also updates each characters state. The AI characters can also be added to the world as flocks.
void add_flock(Flock *flock)¶
This function adds all the AI characters in the Flock object to the AICharPool. This function allows adding the AI characetrs as part of a flock.
void add_obstacle(NodePath obstacle)¶
This function adds the nodepath as an obstacle that is needed by the obstacle avoidance behavior.
void flock_off(unsigned int flock_id)¶
This function turns off the flock behavior temporarily. Similar to pausing the behavior.
void flock_on(unsigned int flock_id)¶
This function turns on the flock behavior.
Flock get_flock(unsigned int flock_id)¶
This function returns a handle to the Flock whose id is passed.
This function prints the names of the AI characters that have been added to the
AIWorld. Useful for debugging purposes.
void remove_ai_char(std::string name)¶
void remove_flock(unsigned int flock_id)¶
This function removes the flock behavior completely.
void remove_obstacle(NodePath obstacle)¶
This function removes the nodepath from the obstacles list that is needed by the obstacle avoidance behavior.
- void add_flock(Flock *flock)¶