diff --git a/level.cc b/level.cc index 574d5cd..f9abdcb 100644 --- a/level.cc +++ b/level.cc @@ -19,6 +19,7 @@ Level::~Level() { } for(unsigned int i = 0; irender(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); + waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); } else { objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs); @@ -319,3 +321,7 @@ void Level::forceMove(float x, float y, float z, unsigned indice){ void Level::activateEndgame(){ physics.activateEndgame(); } + +void Level::setWaterPlane(Object* water) { + this->waterPlane = water; +} diff --git a/level.hh b/level.hh index 7d55e9d..5811b9e 100644 --- a/level.hh +++ b/level.hh @@ -39,6 +39,7 @@ class Level { glm::vec4 getFogColourNight(); void setSkydomeSize(float size); float getSkydomeSize(); + void setWaterPlane(Object* water); Skydome* getSkydome(); std::vector* getObjects(); std::vector* getPhysicsObjects(); @@ -76,6 +77,7 @@ class Level { std::vector physicsObjects; std::vector lights; std::vector triggers; + Object* waterPlane; glm::vec3 ambientLight; glm::vec4 fogColourDay; glm::vec4 fogColourRise; diff --git a/loader.cc b/loader.cc index b9b588c..e2a3bf6 100644 --- a/loader.cc +++ b/loader.cc @@ -147,7 +147,7 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa water_vao->attachAllAttributes(water_ab); Material water_material = Material(waterTexture, 0.1f, 0.2f, 0.8f, 5.0f, true); Object* water_object = new Object(water_vao, water_material, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), true); - level->addObject(water_object); + level->setWaterPlane(water_object); } //load lighting parameters