SQC-15_online #1
| @@ -1,6 +1,6 @@ | |||||||
| #include "booster.h"; | #include "booster.h"; | ||||||
|  |  | ||||||
| void Booster::RenderBillboard(const Vector3f pos, TextureAtlas& textureAtlas, TextureAtlas::TextureIndex idx, Shader& shader, Transformation tran) | void Booster::RenderBillboard(const Vector3f pos, TextureAtlas& textureAtlas,  Shader& shader, Transformation tran) | ||||||
| { | { | ||||||
| 	// | 	// | ||||||
| 	//Vector3f playerToQuad = m_player.GetPosition() - m_position; | 	//Vector3f playerToQuad = m_player.GetPosition() - m_position; | ||||||
| @@ -31,7 +31,7 @@ void Booster::RenderBillboard(const Vector3f pos, TextureAtlas& textureAtlas, Te | |||||||
| 	//glDisable(GL_DEPTH_TEST); | 	//glDisable(GL_DEPTH_TEST); | ||||||
| 	shader.Use(); | 	shader.Use(); | ||||||
| 	textureAtlas.Bind(); | 	textureAtlas.Bind(); | ||||||
| 	textureAtlas.TextureIndexToCoord(idx, u, v, w, h); | 	textureAtlas.TextureIndexToCoord(8, u, v, w, h); | ||||||
| 	//glLoadIdentity(); | 	//glLoadIdentity(); | ||||||
| 	glLoadMatrixf(tran.GetMatrix().GetInternalValues()); | 	glLoadMatrixf(tran.GetMatrix().GetInternalValues()); | ||||||
| 	glBegin(GL_QUADS); | 	glBegin(GL_QUADS); | ||||||
|   | |||||||
| @@ -9,6 +9,6 @@ | |||||||
|  |  | ||||||
| class Booster { | class Booster { | ||||||
| public: | public: | ||||||
| 	void RenderBillboard(const Vector3f pos, TextureAtlas& textureAtlas, TextureAtlas::TextureIndex idx, Shader& shader, Transformation tran); | 	void RenderBillboard(const Vector3f pos, TextureAtlas& textureAtlas,  Shader& shader, Transformation tran); | ||||||
| }; | }; | ||||||
| #endif | #endif | ||||||
|   | |||||||
| @@ -1091,6 +1091,7 @@ void Engine::Render(float elapsedTime) { | |||||||
| 		static irrklang::ISound* step; // Pour les sons de pas. | 		static irrklang::ISound* step; // Pour les sons de pas. | ||||||
| 		static float pollTime = 0; | 		static float pollTime = 0; | ||||||
| 		static float bulletTime = 0; | 		static float bulletTime = 0; | ||||||
|  | 		static float gameTime = 0; | ||||||
| 		static BlockType bloc = 1; | 		static BlockType bloc = 1; | ||||||
|  |  | ||||||
| 		if (elapsedTime > 0.1f) return; | 		if (elapsedTime > 0.1f) return; | ||||||
| @@ -1196,24 +1197,25 @@ void Engine::Render(float elapsedTime) { | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		gameTime += elapsedTime * 10; | ||||||
|  |  | ||||||
| 		m_remotePlayer.ApplyPhysics(Vector3f(0,0,0), &m_world, elapsedTime); | 		Vector3f dance = Vector3f(sin(gameTime), 0, cos(-gameTime)); | ||||||
| 		//m_remotePlayer.ApplyTransformation(remotePlayer, false);	 | 		dance.Normalize(); | ||||||
|  | 		m_remotePlayer.ApplyPhysics(dance, &m_world, elapsedTime); | ||||||
| 		m_world.Update(m_bullets, m_player.GetPosition(), m_blockinfo); | 		m_world.Update(m_bullets, m_player.GetPosition(), m_blockinfo); | ||||||
| 		m_renderer.UpdateMesh(&m_world, m_player.GetPosition(), m_blockinfo); | 		m_renderer.UpdateMesh(&m_world, m_player.GetPosition(), m_blockinfo); | ||||||
| 		m_remotePlayer.Render(m_textureAtlas, m_shader01, all, elapsedTime); | 		m_remotePlayer.Render(m_animeAtlas, m_shader01, all, elapsedTime); | ||||||
| 		m_booster.RenderBillboard({ 120,20,120 }, m_textureAtlas, texBoostHeal, m_shader01, all); | 		m_booster.RenderBillboard({ 195,16,195 }, m_textureAtlas, m_shader01, all); | ||||||
|  |  | ||||||
| 		if (m_isSkybox) m_renderer.RenderWorld(&m_world, m_renderCount, m_player.GetPosition(), m_player.GetDirection(), all, m_shader01, m_textureAtlas); | 		if (m_isSkybox) m_renderer.RenderWorld(&m_world, m_renderCount, m_player.GetPosition(), m_player.GetDirection(), all, m_shader01, m_textureAtlas); | ||||||
|  |  | ||||||
| 		//glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); | 		//glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); | ||||||
| 		//m_remotePlayer.Render(m_textureAtlas, m_shader01, all, elapsedTime); | 		//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); | 		if (m_isSkybox) m_skybox.Render(skybox); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| 		DrawHud(elapsedTime, bloc); | 		DrawHud(elapsedTime, bloc); | ||||||
| 		DisplayPovGun(); | 		DisplayPovGun(); | ||||||
| 		ProcessNotificationQueue(); | 		ProcessNotificationQueue(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user