Ajouté checks de fin de monde pour que le bonhomme puisse sauter dans le vide et ne pas avoir d'exception avant!
This commit is contained in:
		| @@ -182,7 +182,6 @@ void Engine::Render(float elapsedTime) { | ||||
|  | ||||
| 	Transformation all; | ||||
| 	Transformation skybox; | ||||
|  | ||||
| 	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | ||||
|  | ||||
| 	// Transformations initiales | ||||
| @@ -193,11 +192,16 @@ void Engine::Render(float elapsedTime) { | ||||
| 	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) | ||||
| 	m_player.ApplyTransformation(all); | ||||
|  | ||||
| 	m_player.ApplyTransformation(skybox, false); // Version d'ApplyTransformation qui ne tient compte que de la rotation  | ||||
| 												// (donc l'objet ne bouge pas relativement au joueur, ce qui est pratique pour une skybox!). | ||||
| 	glDisable(GL_LIGHT0); | ||||
| 	m_skybox.Render(skybox); | ||||
|  | ||||
|  | ||||
| 	 | ||||
|  | ||||
|  | ||||
| 	// Chunks | ||||
| 	all.Use(); | ||||
| 	glEnable(GL_LIGHT0); | ||||
| @@ -210,7 +214,9 @@ void Engine::Render(float elapsedTime) { | ||||
|  | ||||
| 	for (int chx = cx - CHUNK_SIZE_X * 6; chx < cx + CHUNK_SIZE_X * 6; chx+= CHUNK_SIZE_X) | ||||
| 		for (int chy = cy - CHUNK_SIZE_Z * 6; chy < cy + CHUNK_SIZE_Z * 6; chy += CHUNK_SIZE_Z) { | ||||
| 			if (!m_world.ChunkAt(chx, 1, chy)) { | ||||
| 			if (chx / CHUNK_SIZE_X < VIEW_DISTANCE && chy / CHUNK_SIZE_Z < VIEW_DISTANCE &&  | ||||
| 				chx >= 0 && chy >= 0) | ||||
| 				if (!m_world.ChunkAt(chx, 1, chy)) { | ||||
|  | ||||
| 				m_world.GetChunks().Set(chx / CHUNK_SIZE_X, chy / CHUNK_SIZE_Z, new Chunk(chx / CHUNK_SIZE_X, chy / CHUNK_SIZE_Z)); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user