Modifications dans Player
This commit is contained in:
parent
97ffc34e24
commit
b52c7528c8
@ -211,7 +211,7 @@ void Engine::Render(float elapsedTime) {
|
|||||||
// (donc l'objet ne bouge pas relativement au joueur, ce qui est pratique pour une skybox!).
|
// (donc l'objet ne bouge pas relativement au joueur, ce qui est pratique pour une skybox!).
|
||||||
|
|
||||||
glDisable(GL_LIGHT0);
|
glDisable(GL_LIGHT0);
|
||||||
//m_skybox.Render(skybox);
|
if (m_isSkybox) m_skybox.Render(skybox);
|
||||||
glEnable(GL_LIGHT0);
|
glEnable(GL_LIGHT0);
|
||||||
|
|
||||||
if (m_mouseL)
|
if (m_mouseL)
|
||||||
@ -317,7 +317,7 @@ void Engine::Render(float elapsedTime) {
|
|||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||||
|
|
||||||
if (m_player.GetPosition().y < -20.f)
|
if (m_player.GetPosition().y < -20.f)
|
||||||
m_player = Player(Vector3f(CHUNK_SIZE_X * WORLD_SIZE_X / 2, CHUNK_SIZE_Y + 1.8f, CHUNK_SIZE_Z * WORLD_SIZE_X / 2)); // Respawn si le bonho- joueur tombe en bas du monde.
|
m_player = Player(Vector3f(0, CHUNK_SIZE_Y + 1.8f, 0)); // Respawn si le bonho- joueur tombe en bas du monde.
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::KeyPressEvent(unsigned char key)
|
void Engine::KeyPressEvent(unsigned char key)
|
||||||
@ -387,7 +387,7 @@ void Engine::KeyReleaseEvent(unsigned char key)
|
|||||||
m_audio.ToggleMusicState();
|
m_audio.ToggleMusicState();
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
m_renderer = !m_renderer;
|
m_isSkybox = !m_isSkybox;
|
||||||
break;
|
break;
|
||||||
case 24: // Y
|
case 24: // Y
|
||||||
m_wireframe = !m_wireframe;
|
m_wireframe = !m_wireframe;
|
||||||
|
@ -41,7 +41,7 @@ private:
|
|||||||
void ChangeBlockAtCursor(BlockType blocktype);
|
void ChangeBlockAtCursor(BlockType blocktype);
|
||||||
|
|
||||||
bool m_wireframe = false;
|
bool m_wireframe = false;
|
||||||
bool m_renderer = false;
|
bool m_isSkybox = true;
|
||||||
|
|
||||||
int m_renderCount = 0;
|
int m_renderCount = 0;
|
||||||
int m_badHitCount = 0;
|
int m_badHitCount = 0;
|
||||||
@ -62,7 +62,7 @@ private:
|
|||||||
Shader m_shader01;
|
Shader m_shader01;
|
||||||
Audio m_audio = Audio(AUDIO_PATH "music01.wav");
|
Audio m_audio = Audio(AUDIO_PATH "music01.wav");
|
||||||
|
|
||||||
Player m_player = Player(Vector3f(CHUNK_SIZE_X * WORLD_SIZE_X / 2, CHUNK_SIZE_Y + 1.8f, CHUNK_SIZE_Z * WORLD_SIZE_X / 2));
|
Player m_player = Player(Vector3f(0, CHUNK_SIZE_Y + 1.8f, 0));
|
||||||
|
|
||||||
bool m_keyW = false;
|
bool m_keyW = false;
|
||||||
bool m_keyA = false;
|
bool m_keyA = false;
|
||||||
@ -79,10 +79,5 @@ private:
|
|||||||
bool m_block = false;
|
bool m_block = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
|
||||||
static bool EqualWithEpsilon(const T& v1, const T& v2, T epsilon = T(0.0001)) { return (fabs(v2 - v1) < epsilon); }
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
static bool InRangeWithEpsilon(const T& v, const T& vinf, const T& vsup, T epsilon = T(0.0001)) { return (v >= vinf - epsilon && v <= vsup + epsilon); }
|
|
||||||
|
|
||||||
#endif // ENGINE_H__
|
#endif // ENGINE_H__
|
||||||
|
BIN
SQCSim2021/media/chunks/0_0.chunk
Normal file
BIN
SQCSim2021/media/chunks/0_0.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/108_45.chunk
Normal file
BIN
SQCSim2021/media/chunks/108_45.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/113_20.chunk
Normal file
BIN
SQCSim2021/media/chunks/113_20.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/118_2.chunk
Normal file
BIN
SQCSim2021/media/chunks/118_2.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/118_3.chunk
Normal file
BIN
SQCSim2021/media/chunks/118_3.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/118_4.chunk
Normal file
BIN
SQCSim2021/media/chunks/118_4.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/118_5.chunk
Normal file
BIN
SQCSim2021/media/chunks/118_5.chunk
Normal file
Binary file not shown.
1
SQCSim2021/media/chunks/118_7.chunk
Normal file
1
SQCSim2021/media/chunks/118_7.chunk
Normal file
File diff suppressed because one or more lines are too long
BIN
SQCSim2021/media/chunks/11_100.chunk
Normal file
BIN
SQCSim2021/media/chunks/11_100.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/11_101.chunk
Normal file
BIN
SQCSim2021/media/chunks/11_101.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/11_102.chunk
Normal file
BIN
SQCSim2021/media/chunks/11_102.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/11_103.chunk
Normal file
BIN
SQCSim2021/media/chunks/11_103.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/11_105.chunk
Normal file
BIN
SQCSim2021/media/chunks/11_105.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/11_99.chunk
Normal file
BIN
SQCSim2021/media/chunks/11_99.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/12_103.chunk
Normal file
BIN
SQCSim2021/media/chunks/12_103.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/16_5.chunk
Normal file
BIN
SQCSim2021/media/chunks/16_5.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/17_5.chunk
Normal file
BIN
SQCSim2021/media/chunks/17_5.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/1_6.chunk
Normal file
BIN
SQCSim2021/media/chunks/1_6.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/1_7.chunk
Normal file
BIN
SQCSim2021/media/chunks/1_7.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/20_111.chunk
Normal file
BIN
SQCSim2021/media/chunks/20_111.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/23_97.chunk
Normal file
BIN
SQCSim2021/media/chunks/23_97.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/23_98.chunk
Normal file
BIN
SQCSim2021/media/chunks/23_98.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/24_97.chunk
Normal file
BIN
SQCSim2021/media/chunks/24_97.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/28_94.chunk
Normal file
BIN
SQCSim2021/media/chunks/28_94.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/28_96.chunk
Normal file
BIN
SQCSim2021/media/chunks/28_96.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/39_64.chunk
Normal file
BIN
SQCSim2021/media/chunks/39_64.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/41_75.chunk
Normal file
BIN
SQCSim2021/media/chunks/41_75.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/42_75.chunk
Normal file
BIN
SQCSim2021/media/chunks/42_75.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/42_76.chunk
Normal file
BIN
SQCSim2021/media/chunks/42_76.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/43_76.chunk
Normal file
BIN
SQCSim2021/media/chunks/43_76.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/45_37.chunk
Normal file
BIN
SQCSim2021/media/chunks/45_37.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/45_38.chunk
Normal file
BIN
SQCSim2021/media/chunks/45_38.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/45_75.chunk
Normal file
BIN
SQCSim2021/media/chunks/45_75.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/46_39.chunk
Normal file
BIN
SQCSim2021/media/chunks/46_39.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/46_75.chunk
Normal file
BIN
SQCSim2021/media/chunks/46_75.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/47_74.chunk
Normal file
BIN
SQCSim2021/media/chunks/47_74.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/47_75.chunk
Normal file
BIN
SQCSim2021/media/chunks/47_75.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/49_52.chunk
Normal file
BIN
SQCSim2021/media/chunks/49_52.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/53_65.chunk
Normal file
BIN
SQCSim2021/media/chunks/53_65.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/53_66.chunk
Normal file
BIN
SQCSim2021/media/chunks/53_66.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/54_61.chunk
Normal file
BIN
SQCSim2021/media/chunks/54_61.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/54_62.chunk
Normal file
BIN
SQCSim2021/media/chunks/54_62.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/54_64.chunk
Normal file
BIN
SQCSim2021/media/chunks/54_64.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/54_68.chunk
Normal file
BIN
SQCSim2021/media/chunks/54_68.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/54_69.chunk
Normal file
BIN
SQCSim2021/media/chunks/54_69.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/55_57.chunk
Normal file
BIN
SQCSim2021/media/chunks/55_57.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/55_58.chunk
Normal file
BIN
SQCSim2021/media/chunks/55_58.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/55_68.chunk
Normal file
BIN
SQCSim2021/media/chunks/55_68.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/55_70.chunk
Normal file
BIN
SQCSim2021/media/chunks/55_70.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/56_67.chunk
Normal file
BIN
SQCSim2021/media/chunks/56_67.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/57_64.chunk
Normal file
BIN
SQCSim2021/media/chunks/57_64.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/57_74.chunk
Normal file
BIN
SQCSim2021/media/chunks/57_74.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/58_64.chunk
Normal file
BIN
SQCSim2021/media/chunks/58_64.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/59_63.chunk
Normal file
BIN
SQCSim2021/media/chunks/59_63.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/59_64.chunk
Normal file
BIN
SQCSim2021/media/chunks/59_64.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/59_75.chunk
Normal file
BIN
SQCSim2021/media/chunks/59_75.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/5_25.chunk
Normal file
BIN
SQCSim2021/media/chunks/5_25.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/5_43.chunk
Normal file
BIN
SQCSim2021/media/chunks/5_43.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/5_44.chunk
Normal file
BIN
SQCSim2021/media/chunks/5_44.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/5_46.chunk
Normal file
BIN
SQCSim2021/media/chunks/5_46.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/5_50.chunk
Normal file
BIN
SQCSim2021/media/chunks/5_50.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/5_51.chunk
Normal file
BIN
SQCSim2021/media/chunks/5_51.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/5_52.chunk
Normal file
BIN
SQCSim2021/media/chunks/5_52.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_121.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_121.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_122.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_122.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_123.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_123.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_124.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_124.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_125.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_125.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_127.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_127.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_62.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_62.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/60_63.chunk
Normal file
BIN
SQCSim2021/media/chunks/60_63.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/62_107.chunk
Normal file
BIN
SQCSim2021/media/chunks/62_107.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/62_109.chunk
Normal file
BIN
SQCSim2021/media/chunks/62_109.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/62_76.chunk
Normal file
BIN
SQCSim2021/media/chunks/62_76.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/63_105.chunk
Normal file
BIN
SQCSim2021/media/chunks/63_105.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/63_106.chunk
Normal file
BIN
SQCSim2021/media/chunks/63_106.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/63_107.chunk
Normal file
BIN
SQCSim2021/media/chunks/63_107.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/63_64.chunk
Normal file
BIN
SQCSim2021/media/chunks/63_64.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/63_76.chunk
Normal file
BIN
SQCSim2021/media/chunks/63_76.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/64_104.chunk
Normal file
BIN
SQCSim2021/media/chunks/64_104.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/64_105.chunk
Normal file
BIN
SQCSim2021/media/chunks/64_105.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/64_69.chunk
Normal file
BIN
SQCSim2021/media/chunks/64_69.chunk
Normal file
Binary file not shown.
Binary file not shown.
BIN
SQCSim2021/media/chunks/65_102.chunk
Normal file
BIN
SQCSim2021/media/chunks/65_102.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/65_103.chunk
Normal file
BIN
SQCSim2021/media/chunks/65_103.chunk
Normal file
Binary file not shown.
1
SQCSim2021/media/chunks/65_62.chunk
Normal file
1
SQCSim2021/media/chunks/65_62.chunk
Normal file
File diff suppressed because one or more lines are too long
BIN
SQCSim2021/media/chunks/66_41.chunk
Normal file
BIN
SQCSim2021/media/chunks/66_41.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/66_76.chunk
Normal file
BIN
SQCSim2021/media/chunks/66_76.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/67_100.chunk
Normal file
BIN
SQCSim2021/media/chunks/67_100.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/67_81.chunk
Normal file
BIN
SQCSim2021/media/chunks/67_81.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/67_99.chunk
Normal file
BIN
SQCSim2021/media/chunks/67_99.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/68_125.chunk
Normal file
BIN
SQCSim2021/media/chunks/68_125.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/68_126.chunk
Normal file
BIN
SQCSim2021/media/chunks/68_126.chunk
Normal file
Binary file not shown.
1
SQCSim2021/media/chunks/68_63.chunk
Normal file
1
SQCSim2021/media/chunks/68_63.chunk
Normal file
File diff suppressed because one or more lines are too long
BIN
SQCSim2021/media/chunks/69_121.chunk
Normal file
BIN
SQCSim2021/media/chunks/69_121.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/69_122.chunk
Normal file
BIN
SQCSim2021/media/chunks/69_122.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/69_123.chunk
Normal file
BIN
SQCSim2021/media/chunks/69_123.chunk
Normal file
Binary file not shown.
BIN
SQCSim2021/media/chunks/69_124.chunk
Normal file
BIN
SQCSim2021/media/chunks/69_124.chunk
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user