5#include "../utils/rigidbodyHandler.h"
6#include "../utils/ai.h"
8#include "../rendering/shaderProgram.h"
9#include "../rendering/camera.h"
10#include "../rendering/shadows.h"
11#include "../rendering/skybox.h"
12#include "../rendering/billboard.h"
13#include "../rendering/water.h"
14#include "../rendering/hud.h"
15#include "../rendering/particle.h"
17#include "../audio/audioEngine.h"
18#include "../audio/audioSource.h"
21#include "texManager.h"
22#include "meshManager.h"
297 void load(
const char* scenePath);
307 void render(
bool debug,
bool pause);
343 std::vector<Aire::AudioSource*> boidSounds;
348 float currentFrame = 0.0f;
349 float deltaTime = 0.0f;
350 float lastFrame = 0.0f;
365 Light directionalLight =
Light{ glm::vec3(1.f, 1.f, 1.f), glm::vec3(1, 1, 1) };
366 std::vector<Light> pointLights;
369 std::vector<Rigidbody*> obstacles;
370 std::vector<Rigidbody*> enemies;
375 Model* sphere =
nullptr;
376 Model* box =
nullptr;
378 std::vector<Terrain*> terrains;
379 std::vector<Model*> models;
380 std::vector<Animator*> animators;
381 std::vector<Billboard*> billboards;
382 std::vector<BillboardInstance> billboardInstances;
387 bool dirShadowsEnabled =
false;
388 bool pointShadowsEnabled =
false;
Class for playing the animation.
Definition animator.h:18
The AudioEngine class manages the audio system.
Definition audioEngine.h:20
Class for billboard rendering.
Definition billboard.h:15
Manager for the boids.
Definition ai.h:159
Simple clock class.
Definition clock.h:6
Class to handle directional light shadows using shadow mapping with a depth map.
Definition shadows.h:57
Class to render HUD elements on the screen.
Definition hud.h:15
Mesh manager. Handles mesh creation, storage, and deletion.
Definition meshManager.h:28
Class to handle point light shadows using shadow mapping with cubemaps.
Definition shadows.h:15
A singleton class used to handle all rigid bodies in the scene.
Definition rigidbodyHandler.h:13
Represents a 3D scene environment.
Definition scene.h:33
void enablePointShadows()
Enables point light shadow mapping.
Definition scene.cpp:95
void setModelShader(ShaderProgram &shader)
Sets the shader for rendering models.
Definition scene.h:68
void setBillboardShader(ShaderProgram &shader)
Sets the shader for rendering billboards.
Definition scene.h:82
std::vector< Model * > getModels()
Retrieves all models in the scene.
Definition scene.h:227
void renderBillboards(ShaderProgram &shader, Camera &camera)
Renders the billboards in the scene using the billboard instances.
Definition scene.cpp:1068
void setSkybox(Skybox *skybox)
Sets the skybox for the scene.
Definition scene.h:153
void setAnimationShader(ShaderProgram &shader)
Sets the shader for animation rendering.
Definition scene.h:75
void setAudioEngine(AudioEngine *audioEngine)
Sets the AudioEngine for handling audio playback.
Definition scene.h:123
~Scene()
Destructor.
Definition scene.cpp:40
void setBoidManager(BoidManager *boidManager)
Sets the BoidManager for handling AI boid behaviors.
Definition scene.h:91
std::vector< Terrain * > getTerrains()
Retrieves all terrains in the scene.
Definition scene.h:203
Terrain * getTerrain(int index)
Retrieves a specific terrain in the scene by index.
Definition scene.cpp:138
ParticleGenerator * getParticleGenerator()
Retrieves the ParticleGenerator used in the scene.
Definition scene.h:114
void addBillboard(Billboard *billboard)
Adds a billboard to the scene.
Definition scene.h:266
void addPointLight(Light &light)
Adds a point light to the scene.
Definition scene.h:174
void setPointLights(std::vector< Light > &lights)
Sets the point lights for the scene.
Definition scene.h:167
std::vector< Animator * > getAnimators()
Retrieves all animators in the scene.
Definition scene.h:250
void bindTerrainToRigidbody(int index)
Binds a terrain to the RigidbodyHandler based on its index.
Definition scene.cpp:178
Billboard * getBillboard(int index)
Retrieves a specific billboard in the scene by index.
Definition scene.cpp:168
BoidManager * getBoidManager()
Retrieves the BoidManager used in the scene.
Definition scene.h:98
void addAnimator(Animator *animator)
Adds an animator to the scene.
Definition scene.h:243
void addTerrain(Terrain *terrain)
Adds a terrain to the scene. The first terrain loaded is automatically bound to the rigidbody.
Definition scene.cpp:118
Animator * getAnimator(int index)
Retrieves a specific animator in the scene by index.
Definition scene.cpp:158
void setParticleGenerator(ParticleGenerator *particleGenerator)
Sets the ParticleGenerator for handling particle effects.
Definition scene.h:107
void render(bool debug, bool pause)
Renders the scene.
Definition scene.cpp:745
Scene(Window *window, Camera &camera, TextureManager &texManager, MeshManager &meshManager, Clock &clock, RigidbodyHandler *rigidbodyHandler, HUD *hudManager)
Constructor.
Definition scene.cpp:6
void update()
Updates the scene animations and physics.
Definition scene.cpp:1016
void updateBoidSounds(const std::string &soundPath)
Updates the audio sources vector for boid sounds.
Definition scene.cpp:1094
void load(const char *scenePath)
Loads scene data from a JSON file.
Definition scene.cpp:215
Model * getModel(int index)
Retrieves a specific model in the scene by index.
Definition scene.cpp:148
AudioEngine * getAudioEngine()
Retrieves the AudioEngine used in the scene.
Definition scene.h:130
std::vector< Billboard * > getBillboards()
Retrieves all billboards in the scene.
Definition scene.h:273
void addModel(Model *model)
Adds a model to the scene.
Definition scene.h:220
void setDirectionalLight(Light &light)
Sets the directional light for the scene.
Definition scene.h:160
void setBoidSounds(const std::string &soundPath)
Sets the audio sources vector for boid sounds.
Definition scene.cpp:1075
void enableDirectionalShadows()
Enables directional light shadow mapping.
Definition scene.cpp:78
void computeBillboardInstances(std::vector< Billboard * > billboards, Terrain *terrain, int numBillboards)
Computes random locations and billboard textures and saves them in the billboardInstances vector.
Definition scene.cpp:1036
void setTerrainShader(ShaderProgram &shader)
Sets the shader for rendering terrain.
Definition scene.h:61
A linked OpenGL program.
Definition shaderProgram.h:16
A class that represents a terrain object.
Definition terrain.h:28
Texture manager. Handles texture creation, storage, and deletion.
Definition texManager.h:20
Class to display text on the screen.
Definition hud.h:47
A point light.
Definition light.h:7