Les vertices entre les Chunks ne sont plus dessinées!
This commit is contained in:
@@ -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);
|
||||
@@ -248,7 +248,7 @@ void Engine::Render(float elapsedTime) {
|
||||
all.ApplyTranslation(chx * CHUNK_SIZE_X, 0, chy * CHUNK_SIZE_Z);
|
||||
all.Use();
|
||||
if (m_world.GetChunks().Get(chx, chy)->IsDirty())
|
||||
m_world.GetChunks().Get(chx, chy)->Update(m_blockinfo);
|
||||
m_world.GetChunks().Get(chx, chy)->Update(m_blockinfo, &m_world);
|
||||
m_world.GetChunks().Get(chx, chy)->Render();
|
||||
all.ApplyTranslation(-chx * CHUNK_SIZE_X, 0, -chy * CHUNK_SIZE_Z);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ void Engine::Render(float elapsedTime) {
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
|
||||
|
||||
if (m_player.GetPosition().y < -10.f) m_player = Player(Vector3f(64, 34, 64)); // Respawn si le bonho- joueur tombe en bas du monde.
|
||||
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.
|
||||
}
|
||||
|
||||
void Engine::KeyPressEvent(unsigned char key)
|
||||
|
Reference in New Issue
Block a user