diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 2d25f4c..d2ef226 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -30,7 +30,7 @@ void Engine::Init() glEnable(GL_CULL_FACE); // Light - /*GLfloat light0Pos[4] = { 0.0f, CHUNK_SIZE_Y, 0.0f, 1.0f }; + GLfloat light0Pos[4] = { 0.0f, CHUNK_SIZE_Y, 0.0f, 1.0f }; GLfloat light0Amb[4] = { 0.2f, 0.2f, 0.2f, 1.f }; GLfloat light0Diff[4] = { 1.f, 1.f, 1.f, 1.f }; GLfloat light0Spec[4] = { 0.2f, 0.2f, 0.2f, 1.0f }; @@ -39,7 +39,7 @@ void Engine::Init() glLightfv(GL_LIGHT0, GL_POSITION, light0Pos); glLightfv(GL_LIGHT0, GL_AMBIENT, light0Amb); glLightfv(GL_LIGHT0, GL_DIFFUSE, light0Diff); - glLightfv(GL_LIGHT0, GL_SPECULAR, light0Spec);*/ + glLightfv(GL_LIGHT0, GL_SPECULAR, light0Spec); // Objet de skybox avec sa propre texture et son propre shader! m_skybox.Init(0.00013f); @@ -48,7 +48,7 @@ void Engine::Init() m_audio.ToggleMusicState(); // Init Chunks - for (int chx = 0; chx < VIEW_DISTANCE; ++chx) + for (int chx = 0; chx < VIEW_DISTANCE; ++chx) // Un beau gros monde de VIEW_DISTANCE Chunks par VIEW_DISTANCE Chunks. for (int chy = 0; chy < VIEW_DISTANCE; ++chy) m_world.GetChunks().Set(chx, chy, new Chunk(chx, chy)); @@ -230,7 +230,7 @@ void Engine::Render(float elapsedTime) { glLoadIdentity(); m_player.ApplyPhysics(m_player.GetInput(m_keyW, m_keyS, m_keyA, m_keyD, m_keySpace, m_keylshift, elapsedTime), m_world, elapsedTime); - m_audio.Update3DAudio(m_player.GetPosition(), m_player.GetDirection(), m_player.GetVelocity()); // Ajustement du positionnement 3D avec les coordonnées du joueur et + m_audio.Update3DAudio(m_player.GetPOV(), m_player.GetDirection(), m_player.GetVelocity()); // Ajustement du positionnement 3D avec les coordonnées du joueur et // son vecteur de vélocité (pour l'effet Doppler) m_player.ApplyTransformation(all); m_player.ApplyTransformation(skybox, false); // Version d'ApplyTransformation qui ne tient compte que de la rotation @@ -249,7 +249,8 @@ void Engine::Render(float elapsedTime) { all.Use(); if (m_world.GetChunks().Get(chx, chy)->IsDirty()) m_world.GetChunks().Get(chx, chy)->Update(m_blockinfo, &m_world); - m_world.GetChunks().Get(chx, chy)->Render(); + + m_world.GetChunks().Get(chx, chy)->Render(); all.ApplyTranslation(-chx * CHUNK_SIZE_X, 0, -chy * CHUNK_SIZE_Z); } @@ -261,8 +262,7 @@ void Engine::Render(float elapsedTime) { if (m_wireframe) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - if (m_player.GetPosition().y < -10.f) m_player = Player(Vector3f(VIEW_DISTANCE * CHUNK_SIZE_X / 2, CHUNK_SIZE_Y / 2, VIEW_DISTANCE * CHUNK_SIZE_Z / 2)); // Respawn si le bonho- joueur tombe en bas du monde. + if (m_player.GetPosition().y < -20.f) m_player = Player(Vector3f(VIEW_DISTANCE * CHUNK_SIZE_X / 2, CHUNK_SIZE_Y / 2, VIEW_DISTANCE * CHUNK_SIZE_Z / 2)); // Respawn si le bonho- joueur tombe en bas du monde. } void Engine::KeyPressEvent(unsigned char key) diff --git a/SQCSim2021/media/textures/metal.png b/SQCSim2021/media/textures/metal.png index fcdf693..29f7c18 100644 Binary files a/SQCSim2021/media/textures/metal.png and b/SQCSim2021/media/textures/metal.png differ diff --git a/SQCSim2021/media/textures/metal1.png b/SQCSim2021/media/textures/metal1.png index 29e3500..705ce35 100644 Binary files a/SQCSim2021/media/textures/metal1.png and b/SQCSim2021/media/textures/metal1.png differ diff --git a/SQCSim2021/media/textures/metal2.png b/SQCSim2021/media/textures/metal2.png index 79eee1b..cdd0ff3 100644 Binary files a/SQCSim2021/media/textures/metal2.png and b/SQCSim2021/media/textures/metal2.png differ diff --git a/SQCSim2021/media/textures/metal3.png b/SQCSim2021/media/textures/metal3.png index e3b03ab..d4f436c 100644 Binary files a/SQCSim2021/media/textures/metal3.png and b/SQCSim2021/media/textures/metal3.png differ diff --git a/SQCSim2021/media/textures/metal4.png b/SQCSim2021/media/textures/metal4.png index 3e3a429..c341243 100644 Binary files a/SQCSim2021/media/textures/metal4.png and b/SQCSim2021/media/textures/metal4.png differ