AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Aire::BoidManager Class Reference

Manager for the boids. More...

#include <ai.h>

Public Member Functions

 BoidManager (Model *model, Terrain *terrain, RigidbodyHandler *rigidbodyHandler)
 Create a new boid manager.
 
 BoidManager (Animator *animator, Terrain *terrain, RigidbodyHandler *rigidbodyHandler)
 Create a new boid manager.
 
 ~BoidManager ()
 Destroy all boids.
 
TerraingetTerrain ()
 Get the terrain associated with the boids.
 
void setTrackPlayer (bool trackPlayer)
 Make the boids track the player.
 
void addBoid ()
 Add a new boid to the list of boids.
 
void addBoids (int numBoids)
 Add a nmber of new boids.
 
std::vector< Boid * > & getBoids ()
 
void setModel ()
 Manually set the model for the boids.
 
ModelgetModel ()
 
bool hasModel ()
 
void setAnimator ()
 Manually set the animator for the boids.
 
AnimatorgetAnimator ()
 
bool hasAnimator ()
 
void updateBoids (float deltaTime, glm::vec3 playerPosition)
 Update the position of the boids.
 
void renderBoids (ShaderProgram &shader, Aire::Camera &camera)
 Render all boids.
 

Detailed Description

Manager for the boids.

Constructor & Destructor Documentation

◆ BoidManager() [1/2]

Aire::BoidManager::BoidManager ( Model * model,
Terrain * terrain,
RigidbodyHandler * rigidbodyHandler )
inline

Create a new boid manager.

Parameters
modelThe model to associate with the boids
terrainTerrain to link the boids to
rigidbodyHandlerA pointer to the rigidbody handler

◆ BoidManager() [2/2]

Aire::BoidManager::BoidManager ( Animator * animator,
Terrain * terrain,
RigidbodyHandler * rigidbodyHandler )
inline

Create a new boid manager.

Parameters
animatorThe animator to associate with the boids
terrainTerrain to link the boids to
rigidbodyHandlerA pointer to the rigidbody handler

Member Function Documentation

◆ addBoids()

void BoidManager::addBoids ( int numBoids)

Add a nmber of new boids.

Parameters
numBoidsThe number of boids to add
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAnimator()

Animator * Aire::BoidManager::getAnimator ( )
inline
Returns
The animator associated with the boids

◆ getBoids()

std::vector< Boid * > & Aire::BoidManager::getBoids ( )
inline
Returns
The list of all boids associated with the manager
Here is the caller graph for this function:

◆ getModel()

Model * Aire::BoidManager::getModel ( )
inline
Returns
The model used for the boids

◆ getTerrain()

Terrain * Aire::BoidManager::getTerrain ( )
inline

Get the terrain associated with the boids.

Returns
The terrain associated with the boids

◆ hasAnimator()

bool Aire::BoidManager::hasAnimator ( )
inline
Returns
True if the boids have an animator associated with them
Here is the caller graph for this function:

◆ hasModel()

bool Aire::BoidManager::hasModel ( )
inline
Returns
True if the boids have a model associated with them
Here is the caller graph for this function:

◆ renderBoids()

void BoidManager::renderBoids ( ShaderProgram & shader,
Aire::Camera & camera )

Render all boids.

Parameters
shaderShader program to render the animation
cameraThe camera associated with the player
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTrackPlayer()

void Aire::BoidManager::setTrackPlayer ( bool trackPlayer)
inline

Make the boids track the player.

Parameters
trackPlayerTrue if the boids should track the player
Here is the caller graph for this function:

◆ updateBoids()

void BoidManager::updateBoids ( float deltaTime,
glm::vec3 playerPosition )

Update the position of the boids.

Parameters
deltaTimeThe time delta to advance the boid simulation
playerPositionThe current position of the player in the world
Here is the call graph for this function:
Here is the caller graph for this function:

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