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

Represents a 3D scene environment. More...

#include <scene.h>

Public Member Functions

 Scene (Window *window, Camera &camera, TextureManager &texManager, MeshManager &meshManager, Clock &clock, RigidbodyHandler *rigidbodyHandler, HUD *hudManager)
 Constructor.
 
 ~Scene ()
 Destructor.
 
void setTerrainShader (ShaderProgram &shader)
 Sets the shader for rendering terrain.
 
void setModelShader (ShaderProgram &shader)
 Sets the shader for rendering models.
 
void setAnimationShader (ShaderProgram &shader)
 Sets the shader for animation rendering.
 
void setBillboardShader (ShaderProgram &shader)
 Sets the shader for rendering billboards.
 
void setBoidManager (BoidManager *boidManager)
 Sets the BoidManager for handling AI boid behaviors.
 
BoidManagergetBoidManager ()
 Retrieves the BoidManager used in the scene.
 
void setParticleGenerator (ParticleGenerator *particleGenerator)
 Sets the ParticleGenerator for handling particle effects.
 
ParticleGeneratorgetParticleGenerator ()
 Retrieves the ParticleGenerator used in the scene.
 
void setAudioEngine (AudioEngine *audioEngine)
 Sets the AudioEngine for handling audio playback.
 
AudioEnginegetAudioEngine ()
 Retrieves the AudioEngine used in the scene.
 
void setBoidSounds (const std::string &soundPath)
 Sets the audio sources vector for boid sounds.
 
void updateBoidSounds (const std::string &soundPath)
 Updates the audio sources vector for boid sounds.
 
void setSkybox (Skybox *skybox)
 Sets the skybox for the scene.
 
void setDirectionalLight (Light &light)
 Sets the directional light for the scene.
 
void setPointLights (std::vector< Light > &lights)
 Sets the point lights for the scene.
 
void addPointLight (Light &light)
 Adds a point light to the scene.
 
void enableDirectionalShadows ()
 Enables directional light shadow mapping.
 
void enablePointShadows ()
 Enables point light shadow mapping.
 
void addTerrain (Terrain *terrain)
 Adds a terrain to the scene. The first terrain loaded is automatically bound to the rigidbody.
 
std::vector< Terrain * > getTerrains ()
 Retrieves all terrains in the scene.
 
TerraingetTerrain (int index)
 Retrieves a specific terrain in the scene by index.
 
void addModel (Model *model)
 Adds a model to the scene.
 
std::vector< Model * > getModels ()
 Retrieves all models in the scene.
 
ModelgetModel (int index)
 Retrieves a specific model in the scene by index.
 
void addAnimator (Animator *animator)
 Adds an animator to the scene.
 
std::vector< Animator * > getAnimators ()
 Retrieves all animators in the scene.
 
AnimatorgetAnimator (int index)
 Retrieves a specific animator in the scene by index.
 
void addBillboard (Billboard *billboard)
 Adds a billboard to the scene.
 
std::vector< Billboard * > getBillboards ()
 Retrieves all billboards in the scene.
 
BillboardgetBillboard (int index)
 Retrieves a specific billboard in the scene by index.
 
void bindTerrainToRigidbody (int index)
 Binds a terrain to the RigidbodyHandler based on its index.
 
void load (const char *scenePath)
 Loads scene data from a JSON file.
 
void render (bool debug, bool pause)
 Renders the scene.
 
void update ()
 Updates the scene animations and physics.
 
void computeBillboardInstances (std::vector< Billboard * > billboards, Terrain *terrain, int numBillboards)
 Computes random locations and billboard textures and saves them in the billboardInstances vector.
 
void renderBillboards (ShaderProgram &shader, Camera &camera)
 Renders the billboards in the scene using the billboard instances.
 

Detailed Description

Represents a 3D scene environment.

Constructor & Destructor Documentation

◆ Scene()

Scene::Scene ( Window * window,
Camera & camera,
TextureManager & texManager,
MeshManager & meshManager,
Clock & clock,
RigidbodyHandler * rigidbodyHandler,
HUD * hudManager )

Constructor.

Parameters
windowPointer to the game window.
cameraReference to the scene camera.
texManagerReference to the texture manager.
meshManagerReference to the mesh manager.
clockReference to the game clock.
rigidbodyHandlerPointer to the rigidbody handler.
hudManagerPointer to the HUD manager.
Here is the call graph for this function:

Member Function Documentation

◆ addAnimator()

void Aire::Scene::addAnimator ( Animator * animator)
inline

Adds an animator to the scene.

Parameters
animatorPointer to the Animator instance to add.
Here is the caller graph for this function:

◆ addBillboard()

void Aire::Scene::addBillboard ( Billboard * billboard)
inline

Adds a billboard to the scene.

Parameters
billboardPointer to the Billboard instance to add.
Here is the caller graph for this function:

◆ addModel()

void Aire::Scene::addModel ( Model * model)
inline

Adds a model to the scene.

Parameters
modelPointer to the Model instance to add.
Here is the caller graph for this function:

◆ addPointLight()

void Aire::Scene::addPointLight ( Light & light)
inline

Adds a point light to the scene.

Parameters
lightReference to the point Light instance to add.

◆ addTerrain()

void Scene::addTerrain ( Terrain * terrain)

Adds a terrain to the scene. The first terrain loaded is automatically bound to the rigidbody.

Parameters
terrainPointer to the Terrain instance to add.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bindTerrainToRigidbody()

void Scene::bindTerrainToRigidbody ( int index)

Binds a terrain to the RigidbodyHandler based on its index.

Parameters
indexThe index of the terrain to bind to the RigidbodyHandler. Must be a valid index within the terrains vector.
Here is the call graph for this function:

◆ computeBillboardInstances()

void Scene::computeBillboardInstances ( std::vector< Billboard * > billboards,
Terrain * terrain,
int numBillboards )

Computes random locations and billboard textures and saves them in the billboardInstances vector.

Parameters
billboardsVector of billboards to use.
terrainPointer to the terrain to use.
numBillboardsNumber of billboards to generate.
Here is the call graph for this function:

◆ getAnimator()

Animator * Scene::getAnimator ( int index)

Retrieves a specific animator in the scene by index.

Parameters
indexIndex of the animator to retrieve. Must be a valid index within the animators vector.
Returns
Pointer to the Animator instance.

◆ getAnimators()

std::vector< Animator * > Aire::Scene::getAnimators ( )
inline

Retrieves all animators in the scene.

Returns
Vector of Animator pointers.

◆ getAudioEngine()

AudioEngine * Aire::Scene::getAudioEngine ( )
inline

Retrieves the AudioEngine used in the scene.

Returns
Pointer to the AudioEngine instance.

◆ getBillboard()

Billboard * Scene::getBillboard ( int index)

Retrieves a specific billboard in the scene by index.

Parameters
indexIndex of the billboard to retrieve. Must be a valid index within the billboards vector.
Returns
Pointer to the Billboard instance.

◆ getBillboards()

std::vector< Billboard * > Aire::Scene::getBillboards ( )
inline

Retrieves all billboards in the scene.

Returns
Vector of Billboard pointers.

◆ getBoidManager()

BoidManager * Aire::Scene::getBoidManager ( )
inline

Retrieves the BoidManager used in the scene.

Returns
Pointer to the BoidManager instance.

◆ getModel()

Model * Scene::getModel ( int index)

Retrieves a specific model in the scene by index.

Parameters
indexIndex of the model to retrieve. Must be a valid index within the models vector.
Returns
Pointer to the Model instance.

◆ getModels()

std::vector< Model * > Aire::Scene::getModels ( )
inline

Retrieves all models in the scene.

Returns
Vector of Model pointers.

◆ getParticleGenerator()

ParticleGenerator * Aire::Scene::getParticleGenerator ( )
inline

Retrieves the ParticleGenerator used in the scene.

Returns
Pointer to the ParticleGenerator instance.

◆ getTerrain()

Terrain * Scene::getTerrain ( int index)

Retrieves a specific terrain in the scene by index.

Parameters
indexIndex of the terrain to retrieve. Must be a valid index within the terrains vector.
Returns
Pointer to the Terrain instance.

◆ getTerrains()

std::vector< Terrain * > Aire::Scene::getTerrains ( )
inline

Retrieves all terrains in the scene.

Returns
Vector of Terrain pointers.

◆ load()

void Scene::load ( const char * scenePath)

Loads scene data from a JSON file.

Parameters
scenePathPath to the scene JSON file.
Here is the call graph for this function:

◆ render()

void Scene::render ( bool debug,
bool pause )

Renders the scene.

This function handles rendering of the scene based on provided flags and settings.

Parameters
debug- Flag indicating whether debug mode is enabled.
pause- Flag indicating whether the scene is paused.
Here is the call graph for this function:

◆ renderBillboards()

void Scene::renderBillboards ( ShaderProgram & shader,
Camera & camera )

Renders the billboards in the scene using the billboard instances.

Parameters
shaderReference to the shader program to use for rendering.
cameraReference to the camera to use for rendering.
Here is the caller graph for this function:

◆ setAnimationShader()

void Aire::Scene::setAnimationShader ( ShaderProgram & shader)
inline

Sets the shader for animation rendering.

Parameters
shaderThe shader program to use for animation rendering.

◆ setAudioEngine()

void Aire::Scene::setAudioEngine ( AudioEngine * audioEngine)
inline

Sets the AudioEngine for handling audio playback.

Parameters
audioEnginePointer to the AudioEngine instance.

◆ setBillboardShader()

void Aire::Scene::setBillboardShader ( ShaderProgram & shader)
inline

Sets the shader for rendering billboards.

Parameters
shaderThe shader program to use for billboard rendering.

◆ setBoidManager()

void Aire::Scene::setBoidManager ( BoidManager * boidManager)
inline

Sets the BoidManager for handling AI boid behaviors.

Parameters
boidManagerPointer to the BoidManager instance.

◆ setBoidSounds()

void Scene::setBoidSounds ( const std::string & soundPath)

Sets the audio sources vector for boid sounds.

Parameters
soundPathPath to the audio file.
Here is the call graph for this function:

◆ setDirectionalLight()

void Aire::Scene::setDirectionalLight ( Light & light)
inline

Sets the directional light for the scene.

Parameters
lightReference to the directional Light instance.
Here is the caller graph for this function:

◆ setModelShader()

void Aire::Scene::setModelShader ( ShaderProgram & shader)
inline

Sets the shader for rendering models.

Parameters
shaderThe shader program to use for model rendering.

◆ setParticleGenerator()

void Aire::Scene::setParticleGenerator ( ParticleGenerator * particleGenerator)
inline

Sets the ParticleGenerator for handling particle effects.

Parameters
particleGeneratorPointer to the ParticleGenerator instance.

◆ setPointLights()

void Aire::Scene::setPointLights ( std::vector< Light > & lights)
inline

Sets the point lights for the scene.

Parameters
lightsVector of point lights.
Here is the caller graph for this function:

◆ setSkybox()

void Aire::Scene::setSkybox ( Skybox * skybox)
inline

Sets the skybox for the scene.

Parameters
skyboxPointer to the Skybox instance.
Here is the caller graph for this function:

◆ setTerrainShader()

void Aire::Scene::setTerrainShader ( ShaderProgram & shader)
inline

Sets the shader for rendering terrain.

Parameters
shaderThe shader program to use for terrain rendering.

◆ updateBoidSounds()

void Scene::updateBoidSounds ( const std::string & soundPath)

Updates the audio sources vector for boid sounds.

Parameters
soundPathPath to the audio file.
Here is the call graph for this function:

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