Changements pour v143 et autres corrections.

This commit is contained in:
MarcEricMartel
2022-04-02 15:26:55 -04:00
parent a226d95923
commit 16a67035d0
57 changed files with 2655 additions and 364 deletions

View File

@@ -186,12 +186,14 @@ int Engine::GetFps(float elapsedTime) const { return 1 / elapsedTime; }
void Engine::Render(float elapsedTime) {
static float gameTime = elapsedTime;
static float pollTime = 0;
static float bulletTime = 0;
static BlockType bloc = 1;
if (elapsedTime > 0.1f) return;
gameTime += elapsedTime;
pollTime += elapsedTime;
Transformation all;
Transformation skybox;
@@ -205,9 +207,13 @@ void Engine::Render(float elapsedTime) {
if (bulletTime > 0.f) bulletTime -= elapsedTime;
if (bulletTime < 0.f) bulletTime = 0.f;
if (pollTime >= .005f) {
m_player.ApplyPhysics(m_player.GetInput(m_keyW, m_keyS, m_keyA, m_keyD, m_keySpace, (bloc == BTYPE_LAST && bulletTime <= 0.f && m_mouseL), elapsedTime), m_world, elapsedTime, &m_audio);
m_audio.Update3DAudio(m_player.GetPOV(), m_player.GetDirection(), m_player.GetVelocity()); // Ajustement du positionnement 3D avec les coordonn<6E>es du joueur et
// son vecteur de v<>locit<69> (pour l'effet Doppler)
pollTime = 0;
}
m_player.ApplyTransformation(all);
m_player.ApplyTransformation(skybox, false); // Version d'ApplyTransformation qui ne tient compte que de la rotation
@@ -252,7 +258,7 @@ void Engine::Render(float elapsedTime) {
m_bullets[x] = nullptr;
}
m_world.Update(m_renderCount, m_bullets, m_player, all, m_shader01, m_textureAtlas, m_perlin, m_blockinfo);
m_world.Update(m_renderCount, m_bullets, m_player, all, m_shader01, m_textureAtlas, m_blockinfo);
if (m_isSkybox) m_skybox.Render(skybox);