![]() |
AireEngine
A 3D Open-World Game Engine
|
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. | |
| BoidManager * | getBoidManager () |
| Retrieves the BoidManager used in the scene. | |
| void | setParticleGenerator (ParticleGenerator *particleGenerator) |
| Sets the ParticleGenerator for handling particle effects. | |
| ParticleGenerator * | getParticleGenerator () |
| Retrieves the ParticleGenerator used in the scene. | |
| void | setAudioEngine (AudioEngine *audioEngine) |
| Sets the AudioEngine for handling audio playback. | |
| AudioEngine * | getAudioEngine () |
| 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. | |
| Terrain * | getTerrain (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. | |
| Model * | getModel (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. | |
| Animator * | getAnimator (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. | |
| Billboard * | getBillboard (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. | |
Represents a 3D scene environment.
| Scene::Scene | ( | Window * | window, |
| Camera & | camera, | ||
| TextureManager & | texManager, | ||
| MeshManager & | meshManager, | ||
| Clock & | clock, | ||
| RigidbodyHandler * | rigidbodyHandler, | ||
| HUD * | hudManager ) |
Constructor.
| window | Pointer to the game window. |
| camera | Reference to the scene camera. |
| texManager | Reference to the texture manager. |
| meshManager | Reference to the mesh manager. |
| clock | Reference to the game clock. |
| rigidbodyHandler | Pointer to the rigidbody handler. |
| hudManager | Pointer to the HUD manager. |

Adds an animator to the scene.
| animator | Pointer to the Animator instance to add. |

Adds a billboard to the scene.
| billboard | Pointer to the Billboard instance to add. |

Adds a model to the scene.
| model | Pointer to the Model instance to add. |

Adds a point light to the scene.
| light | Reference to the point Light instance to add. |
Adds a terrain to the scene. The first terrain loaded is automatically bound to the rigidbody.
| terrain | Pointer to the Terrain instance to add. |


Binds a terrain to the RigidbodyHandler based on its index.
| index | The index of the terrain to bind to the RigidbodyHandler. Must be a valid index within the terrains vector. |

| void Scene::computeBillboardInstances | ( | std::vector< Billboard * > | billboards, |
| Terrain * | terrain, | ||
| int | numBillboards ) |
Computes random locations and billboard textures and saves them in the billboardInstances vector.
| billboards | Vector of billboards to use. |
| terrain | Pointer to the terrain to use. |
| numBillboards | Number of billboards to generate. |

Retrieves a specific animator in the scene by index.
| index | Index of the animator to retrieve. Must be a valid index within the animators vector. |
|
inline |
Retrieves all animators in the scene.
|
inline |
Retrieves the AudioEngine used in the scene.
Retrieves a specific billboard in the scene by index.
| index | Index of the billboard to retrieve. Must be a valid index within the billboards vector. |
|
inline |
Retrieves all billboards in the scene.
|
inline |
Retrieves the BoidManager used in the scene.
Retrieves a specific model in the scene by index.
| index | Index of the model to retrieve. Must be a valid index within the models vector. |
|
inline |
Retrieves all models in the scene.
|
inline |
Retrieves the ParticleGenerator used in the scene.
Retrieves a specific terrain in the scene by index.
| index | Index of the terrain to retrieve. Must be a valid index within the terrains vector. |
|
inline |
Retrieves all terrains in the scene.
Loads scene data from a JSON file.
| scenePath | Path to the scene JSON file. |

Renders the scene.
This function handles rendering of the scene based on provided flags and settings.
| debug | - Flag indicating whether debug mode is enabled. |
| pause | - Flag indicating whether the scene is paused. |

| void Scene::renderBillboards | ( | ShaderProgram & | shader, |
| Camera & | camera ) |
Renders the billboards in the scene using the billboard instances.
| shader | Reference to the shader program to use for rendering. |
| camera | Reference to the camera to use for rendering. |

|
inline |
Sets the shader for animation rendering.
| shader | The shader program to use for animation rendering. |
|
inline |
Sets the AudioEngine for handling audio playback.
| audioEngine | Pointer to the AudioEngine instance. |
|
inline |
Sets the shader for rendering billboards.
| shader | The shader program to use for billboard rendering. |
|
inline |
Sets the BoidManager for handling AI boid behaviors.
| boidManager | Pointer to the BoidManager instance. |
Sets the audio sources vector for boid sounds.
| soundPath | Path to the audio file. |

Sets the directional light for the scene.
| light | Reference to the directional Light instance. |

|
inline |
Sets the shader for rendering models.
| shader | The shader program to use for model rendering. |
|
inline |
Sets the ParticleGenerator for handling particle effects.
| particleGenerator | Pointer to the ParticleGenerator instance. |
Sets the point lights for the scene.
| lights | Vector of point lights. |

Sets the skybox for the scene.
| skybox | Pointer to the Skybox instance. |

|
inline |
Sets the shader for rendering terrain.
| shader | The shader program to use for terrain rendering. |
Updates the audio sources vector for boid sounds.
| soundPath | Path to the audio file. |
