pleurer en rotation
This commit is contained in:
		| @@ -1,13 +1,14 @@ | ||||
| #include "remoteplayer.h" | ||||
| #include <iostream> | ||||
| #include <cstring> | ||||
| #include "texture.h" | ||||
|  | ||||
| #include <thread> | ||||
| #include <queue> | ||||
|  | ||||
|  | ||||
|  | ||||
| RemotePlayer::RemotePlayer(netprot::PlayerInfo pinfo) : m_pinfo(pinfo), m_aminacc(0.0f), m_animstate(Anim::STILL), m_team_id(0), current(), previous(), m_texture_front(), Player(Vector3f(0, 0, 0), 0, 0) { | ||||
|  | ||||
| RemotePlayer::RemotePlayer(netprot::PlayerInfo pinfo) : m_pinfo(pinfo), m_aminacc(0.0f), m_animstate(Anim::STILL), m_team_id(0), current(), previous(), m_texture_front(), Player(Vector3f(0, 0, 0)){ | ||||
|  | ||||
| 	LoadTexture(m_texture_front, TEXTURE_PATH "AssetOtherPlayer/FinalPNGStanding/BlueFrontRight.png", false, false); | ||||
|  | ||||
| @@ -18,7 +19,7 @@ RemotePlayer::~RemotePlayer() | ||||
|  | ||||
| } | ||||
|  | ||||
| void RemotePlayer::Init()  | ||||
| void RemotePlayer::Init() | ||||
| { | ||||
| 	 | ||||
| } | ||||
| @@ -69,22 +70,36 @@ void RemotePlayer::Feed(const netprot::Output out) { | ||||
| 	previous.id = current.id; | ||||
| } | ||||
|  | ||||
| void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, float elapsedTime) | ||||
| void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, float elapsedTime, Player m_player) | ||||
| { | ||||
| 	shader.Use(); | ||||
| 	//m_texture_front.Bind(); | ||||
| 	// | ||||
| 	//Vector3f playerToQuad = m_player.GetPosition() - m_position; | ||||
| 	//playerToQuad.Normalize(); | ||||
| 	//Vector3f targetPosition = m_player.GetPosition() + playerToQuad * 10.0f; | ||||
| 	//Matrix4f rotationMatrix; | ||||
| 	//rotationMatrix.SetLookAt(m_position, targetPosition, Vector3f(0, 1, 0)); | ||||
| 	//glMultMatrixf(rotationMatrix.GetInternalValues()); | ||||
|  | ||||
|  | ||||
| 	//Pt override les collisions.. a ce point la je sais pas quoi faire | ||||
| 	 | ||||
| 	shader.Use(); | ||||
| 	float x = 0; | ||||
| 	float y = m_player.GetPosition().y; | ||||
| 	float z = 0; | ||||
| 	float size = 5.0f; | ||||
|  | ||||
| 	float u, v, w, h; | ||||
| 	atlas.Bind(); | ||||
| 	atlas.TextureIndexToCoord(0, u, v, w, h); | ||||
| 	glBegin(GL_QUADS); | ||||
| 	glTexCoord2f(u, v); glVertex3f(0, 50., 0); | ||||
| 	glTexCoord2f(u+w, v); glVertex3f(50., 50., 0); | ||||
| 	glTexCoord2f(u+w, v+h); glVertex3f(50., 0, 0); | ||||
| 	glTexCoord2f(u, v+h); glVertex3f(0, 0, 0); | ||||
| 	atlas.TextureIndexToCoord(0, u, v, w, h); | ||||
| 	glTexCoord2f(u, v); glVertex3f(x, y + size, z); | ||||
| 	glTexCoord2f(u + w, v); glVertex3f(x + size, y + size, z); | ||||
| 	glTexCoord2f(u + w, v + h); glVertex3f(x + size, y, z); | ||||
| 	glTexCoord2f(u, v + h); glVertex3f(x, y, z); | ||||
| 	glEnd(); | ||||
| 	shader.Disable(); | ||||
|  | ||||
| } | ||||
|  | ||||
| bool RemotePlayer::LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps, bool stopOnError) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user