diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index f0e945d..4490f3f 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -1091,6 +1091,7 @@ void Engine::Render(float elapsedTime) { static irrklang::ISound* step; // Pour les sons de pas. static float pollTime = 0; static float bulletTime = 0; + static float gameTime = 0; static BlockType bloc = 1; if (elapsedTime > 0.1f) return; @@ -1196,9 +1197,11 @@ void Engine::Render(float elapsedTime) { } } + gameTime += elapsedTime * 10; - m_remotePlayer.ApplyPhysics(Vector3f(0,0,0), &m_world, elapsedTime); - //m_remotePlayer.ApplyTransformation(remotePlayer, false); + Vector3f dance = Vector3f(sin(gameTime), 0, cos(-gameTime)); + dance.Normalize(); + m_remotePlayer.ApplyPhysics(dance, &m_world, elapsedTime); m_world.Update(m_bullets, m_player.GetPosition(), m_blockinfo); m_renderer.UpdateMesh(&m_world, m_player.GetPosition(), m_blockinfo); m_remotePlayer.Render(m_animeAtlas, m_shader01, all, elapsedTime); @@ -1209,11 +1212,10 @@ void Engine::Render(float elapsedTime) { //glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); //m_remotePlayer.Render(m_textureAtlas, m_shader01, all, elapsedTime); + m_renderer.RenderWorld(&m_world, m_renderCount, m_player.GetPosition(), m_player.GetDirection(), all, m_shader01, m_textureAtlas); if (m_isSkybox) m_skybox.Render(skybox); - - DrawHud(elapsedTime, bloc); DisplayPovGun(); ProcessNotificationQueue();