From df0a142b12450f2db3d692546fdafb3bdb48813b Mon Sep 17 00:00:00 2001 From: Claudel-D-Roy <112507354+Claudel-D-Roy@users.noreply.github.com> Date: Sat, 2 Dec 2023 15:19:46 -0500 Subject: [PATCH 1/6] ishhh --- SQCSim2021/engine.cpp | 6 +++-- SQCSim2021/remoteplayer.cpp | 49 ++++++++++++++++++++----------------- SQCSim2021/remoteplayer.h | 2 +- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index f30b4bc..8338d17 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -394,7 +394,7 @@ void Engine::Init() { m_world.SetSeed(seed); m_startTime = std::chrono::high_resolution_clock::now(); - + m_remotePlayer.SetPosition(Vector3f(.5, CHUNK_SIZE_Y + 10., .5)); // Gestion de souris. CenterMouse(); HideCursor(); @@ -1249,6 +1249,8 @@ void Engine::Render(float elapsedTime) { m_renderer.UpdateMesh(&m_world, m_player.GetPosition(), m_blockinfo); //m_booster.RenderBillboard({ 195,16,195 }, m_textureAtlas, m_shader01, all); + m_remotePlayer.ApplyPhysics(Vector3f(0, 0, 0), &m_world, elapsedTime); + m_remotePlayer.Render(m_animeAtlas, m_shader01, all ,elapsedTime , m_player); m_renderer.RenderWorld(&m_world, m_renderCount, m_player.GetPosition(), m_player.GetDirection(), all, m_shader01, m_textureAtlas); @@ -1377,7 +1379,7 @@ void Engine::Render(float elapsedTime) { for (auto& [key, player] : m_players) { RemotePlayer* rt = static_cast(player); glClear(GL_STENCIL_BUFFER_BIT); - rt->Render(m_animeAtlas, m_shader01, all, elapsedTime); + rt->Render(m_animeAtlas, m_shader01, all, elapsedTime, m_player); m_otherplayerpos = player->GetPosition(); // Aller chercher GetPosition des deux façon, voir si ça chie. } glEnable(GL_CULL_FACE); diff --git a/SQCSim2021/remoteplayer.cpp b/SQCSim2021/remoteplayer.cpp index d203fb0..bd03e34 100644 --- a/SQCSim2021/remoteplayer.cpp +++ b/SQCSim2021/remoteplayer.cpp @@ -81,31 +81,37 @@ void RemotePlayer::Feed(const netprot::Output out) { //m_position = current.position; } -void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime) + + + +void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime, Player& camera) { - float x = GetPosition().x; - float y = GetPosition().y; - float z = GetPosition().z; + float width = 1.f; float height = 1.7f; + + Matrix4 mat4 = tran.GetMatrix(); + + Vector3f CameraRight = Vector3f(mat4.Get11(), mat4.Get21(), mat4.Get31()); + Vector3f CameraUp = Vector3f(mat4.Get12(), mat4.Get22(), mat4.Get32()); + + Vector3f playerPosition = GetPosition() + Vector3f(0.f, 0.f, 0.f); + + //Vector3f postionCamera = camera.GetPosition(); + + Vector3f v3 = (playerPosition + CameraRight * -0.5 * width + CameraUp * -0.5 * height); + Vector3f v1 = (playerPosition + CameraRight * 0.5 * width + CameraUp * -0.5 * height); + Vector3f v2 = (playerPosition + CameraRight * 0.5 * width + CameraUp * 0.5 * height); + Vector3f v4 = (playerPosition + CameraRight * -0.5 * width + CameraUp * 0.5 * height); + - //Matrix4 mat4 = tran.GetMatrix(); - //mat4 VP = pMatrix * vMatrix; - //Vector3f CameraRight = Vector3f(mat4.Get11(), mat4.Get21(), mat4.Get31()); - //Vector3f CameraUp = Vector3f(mat4.Get12(), mat4.Get22(), mat4.Get32()); - //Vector3f v1 = (m_position + CameraRight * 0.5 * width + CameraUp * -0.5 * width); - //Vector3f v2 = (m_position + CameraRight * 0.5 * width + CameraUp * 0.5 * width); - //Vector3f v4 = (m_position + CameraRight * -0.5 * width + CameraUp * -0.5 * width); - //Vector3f v3 = (m_position + CameraRight * -0.5 * width + CameraUp * 0.5 * width); - //tran.ApplyTranslation(m_position); float u, v, w, h; - //glDisable(GL_DEPTH_TEST); + shader.Use(); atlas.Bind(); atlas.TextureIndexToCoord(0, u, v, w, h); - //glLoadIdentity(); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -113,20 +119,19 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr glLoadMatrixf(tran.GetMatrix().GetInternalValues()); glBegin(GL_QUADS); - glTexCoord2f(u, v); glVertex3f(x - width/2., y - height, z); //glVertex3f(v4.x, v4.y, v4.z);//glVertex3f(0, 50, 0); - glTexCoord2f(u + w, v); glVertex3f(x+width/2., y - height, z); //glVertex3f(v3.x, v3.y, v3.z); //glVertex3f(50,50, 0); - glTexCoord2f(u + w, v + h); glVertex3f(x+width/2., y, z); //glVertex3f(v2.x, v2.y, v2.z); //glVertex3f(50, 0, 0); - glTexCoord2f(u, v + h); glVertex3f(x-width/2., y, z); //glVertex3f(v1.x, v1.y, v1.z);// glVertex3f(0, 0, 0); - glEnd(); + glTexCoord2f(u, v); glVertex3f(v1.x, v1.y, v1.z); + glTexCoord2f(u + w, v); glVertex3f(v2.x, v2.y, v2.z); + glTexCoord2f(u + w, v + h); glVertex3f(v3.x, v3.y, v3.z); + glTexCoord2f(u, v + h); glVertex3f(v4.x, v4.y, v4.z); + glEnd(); glBlendFunc(GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR); glBlendEquation(GL_FUNC_SUBTRACT); glDisable(GL_BLEND); shader.Disable(); - //tran.ApplyTranslation(-m_position); - //glEnable(GL_DEPTH_TEST); + } bool RemotePlayer::LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps, bool stopOnError) diff --git a/SQCSim2021/remoteplayer.h b/SQCSim2021/remoteplayer.h index e782000..fcd5626 100644 --- a/SQCSim2021/remoteplayer.h +++ b/SQCSim2021/remoteplayer.h @@ -21,7 +21,7 @@ public: void Init(); void Feed(const netprot::Output out); - void Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime); + void Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime, Player& camera); bool LoadTexture(Texture& texture, const std::string& filename, bool useMipmaps, bool stopOnError); void SetPosition(Vector3f pos) { m_position = pos; } From e6e93ef6d05597af862fe36440440649680521a2 Mon Sep 17 00:00:00 2001 From: Claudel-D-Roy <112507354+Claudel-D-Roy@users.noreply.github.com> Date: Mon, 4 Dec 2023 16:45:46 -0500 Subject: [PATCH 2/6] YAY --- SQCSim-common/player.cpp | 8 ++++---- SQCSim2021/remoteplayer.cpp | 27 ++++++++++++++------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/SQCSim-common/player.cpp b/SQCSim-common/player.cpp index 6e18197..063e5e7 100644 --- a/SQCSim-common/player.cpp +++ b/SQCSim-common/player.cpp @@ -204,11 +204,11 @@ Player::Sound Player::ApplyPhysics(Vector3f input, World* world, float elapsedTi void Player::ApplyTransformation(Transformation& transformation, bool rel, bool rot) const { transformation.ApplyRotation(-m_rotX, 1, 0, 0); transformation.ApplyRotation(-m_rotY, 0, 1, 0); + + if (rel) transformation.ApplyTranslation(-GetPOV()); - if (!rot) { - transformation.ApplyRotation(-m_rotX, 1, 0, 0); - transformation.ApplyRotation(-m_rotY, 0, 1, 0); - } + + } void Player::GetBooster(Booster boosttype) diff --git a/SQCSim2021/remoteplayer.cpp b/SQCSim2021/remoteplayer.cpp index bd03e34..f9bb98e 100644 --- a/SQCSim2021/remoteplayer.cpp +++ b/SQCSim2021/remoteplayer.cpp @@ -10,13 +10,13 @@ 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); + } RemotePlayer::RemotePlayer(netprot::PlayerInfo pinfo, const Vector3f& pos) : m_pinfo(pinfo), m_aminacc(0.0f), m_animstate(Anim::STILL), m_team_id(0), current(), previous(), m_texture_front(), Player(pos) { - LoadTexture(m_texture_front, TEXTURE_PATH "AssetOtherPlayer/FinalPNGStanding/BlueFrontRight.png", false, false); + } @@ -89,23 +89,24 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr float width = 1.f; float height = 1.7f; - + Matrix4 mat4 = tran.GetMatrix(); + + Vector3f DiffCam = GetPosition() - camera.GetPosition(); + Vector3f UpCam = Vector3f(mat4.Get12(), mat4.Get22(), mat4.Get32()); - Vector3f CameraRight = Vector3f(mat4.Get11(), mat4.Get21(), mat4.Get31()); - Vector3f CameraUp = Vector3f(mat4.Get12(), mat4.Get22(), mat4.Get32()); + Vector3f CrossA = DiffCam.Cross(UpCam); + Vector3f CrossB = DiffCam.Cross(CrossA); + CrossA.Normalize(); + CrossB.Normalize(); Vector3f playerPosition = GetPosition() + Vector3f(0.f, 0.f, 0.f); - //Vector3f postionCamera = camera.GetPosition(); - - Vector3f v3 = (playerPosition + CameraRight * -0.5 * width + CameraUp * -0.5 * height); - Vector3f v1 = (playerPosition + CameraRight * 0.5 * width + CameraUp * -0.5 * height); - Vector3f v2 = (playerPosition + CameraRight * 0.5 * width + CameraUp * 0.5 * height); - Vector3f v4 = (playerPosition + CameraRight * -0.5 * width + CameraUp * 0.5 * height); - - + Vector3f v1 = (playerPosition + CrossA * 0.5 * width + CrossB * 0.5 * height); + Vector3f v2 = (playerPosition - CrossA * 0.5 * width + CrossB * 0.5 * height); + Vector3f v3 = (playerPosition + CrossA * 0.5 * width - CrossB * 0.5 * height); + Vector3f v4 = (playerPosition - CrossA * 0.5 * width - CrossB * 0.5 * height); float u, v, w, h; From e98bd03192f8dce727d69c232df29615b05c7ace Mon Sep 17 00:00:00 2001 From: Claudel-D-Roy <112507354+Claudel-D-Roy@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:02:15 -0500 Subject: [PATCH 3/6] GG EN ROTATION --- SQCSim2021/remoteplayer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SQCSim2021/remoteplayer.cpp b/SQCSim2021/remoteplayer.cpp index f9bb98e..b6fa499 100644 --- a/SQCSim2021/remoteplayer.cpp +++ b/SQCSim2021/remoteplayer.cpp @@ -93,18 +93,18 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr Matrix4 mat4 = tran.GetMatrix(); Vector3f DiffCam = GetPosition() - camera.GetPosition(); - Vector3f UpCam = Vector3f(mat4.Get12(), mat4.Get22(), mat4.Get32()); + Vector3f UpCam = Vector3f(0.f, 1.f, 0.f); Vector3f CrossA = DiffCam.Cross(UpCam); Vector3f CrossB = DiffCam.Cross(CrossA); CrossA.Normalize(); CrossB.Normalize(); - Vector3f playerPosition = GetPosition() + Vector3f(0.f, 0.f, 0.f); + Vector3f playerPosition = GetPosition() + Vector3f(0.f, -.75f, 0.f); - Vector3f v1 = (playerPosition + CrossA * 0.5 * width + CrossB * 0.5 * height); - Vector3f v2 = (playerPosition - CrossA * 0.5 * width + CrossB * 0.5 * height); + Vector3f v2 = (playerPosition + CrossA * 0.5 * width + CrossB * 0.5 * height); + Vector3f v1 = (playerPosition - CrossA * 0.5 * width + CrossB * 0.5 * height); Vector3f v3 = (playerPosition + CrossA * 0.5 * width - CrossB * 0.5 * height); Vector3f v4 = (playerPosition - CrossA * 0.5 * width - CrossB * 0.5 * height); From 16e9f6aefed88b4b5e93f7c2e40525a14c4a21b4 Mon Sep 17 00:00:00 2001 From: Claudel-D-Roy <112507354+Claudel-D-Roy@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:05:36 -0500 Subject: [PATCH 4/6] GG le push --- SQCSim2021/engine.cpp | 16 +++++++-------- SQCSim2021/remoteplayer.cpp | 41 +++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 8338d17..a63664f 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -462,14 +462,14 @@ void Engine::LoadResource() { //AJOUTER LES TEXTURES DANS L'ORDRE DE L'ÉNUM //STILL//STANDING - TextureAtlas::TextureIndex StillFront = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueFrontRight.png"); - //TextureAtlas::TextureIndex StillQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeft.png"); - //TextureAtlas::TextureIndex StillQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRight.png"); - //TextureAtlas::TextureIndex StillProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilLeft.png"); - //TextureAtlas::TextureIndex StillProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilRight.png"); - //TextureAtlas::TextureIndex StillQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeftBack.png"); - //TextureAtlas::TextureIndex StillQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRightBack.png"); - //TextureAtlas::TextureIndex StillBack = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueBackRight.png"); + TextureAtlas::TextureIndex StillFront = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueFrontRight.png"); //0 + TextureAtlas::TextureIndex StillQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeft.png"); //1 + TextureAtlas::TextureIndex StillQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRight.png"); //2 + TextureAtlas::TextureIndex StillProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilLeft.png"); //3 + TextureAtlas::TextureIndex StillProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilRight.png"); //4 + TextureAtlas::TextureIndex StillQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeftBack.png"); //5 + TextureAtlas::TextureIndex StillQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRightBack.png"); //6 + TextureAtlas::TextureIndex StillBack = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueBackRight.png"); //7 //SHOOTINGSTILL SANS TIRER //TextureAtlas::TextureIndex StillFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png"); diff --git a/SQCSim2021/remoteplayer.cpp b/SQCSim2021/remoteplayer.cpp index b6fa499..9a29ae3 100644 --- a/SQCSim2021/remoteplayer.cpp +++ b/SQCSim2021/remoteplayer.cpp @@ -89,30 +89,55 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr float width = 1.f; float height = 1.7f; - - Matrix4 mat4 = tran.GetMatrix(); - + Vector3f DiffCam = GetPosition() - camera.GetPosition(); Vector3f UpCam = Vector3f(0.f, 1.f, 0.f); - Vector3f CrossA = DiffCam.Cross(UpCam); Vector3f CrossB = DiffCam.Cross(CrossA); CrossA.Normalize(); CrossB.Normalize(); - Vector3f playerPosition = GetPosition() + Vector3f(0.f, -.75f, 0.f); - - Vector3f v2 = (playerPosition + CrossA * 0.5 * width + CrossB * 0.5 * height); Vector3f v1 = (playerPosition - CrossA * 0.5 * width + CrossB * 0.5 * height); Vector3f v3 = (playerPosition + CrossA * 0.5 * width - CrossB * 0.5 * height); Vector3f v4 = (playerPosition - CrossA * 0.5 * width - CrossB * 0.5 * height); + Vector3f angleRemote = GetDirection(); + Vector3f angleCam = Vector3f(v2.z, 0, -v2.x); + angleCam.y = 0; + angleRemote.y = 0; + angleCam.Normalize(); + angleRemote.Normalize(); + + float angle = angleRemote.Dot(angleCam); + angle *= 100; + int index = 0; + + if (angle >= -0.125 && angle <= 0.125) + index = 0; + else if (angle >= 0.125 && angle <= 0.375) + index = 1; + else if (angle >= 0.375 && angle <= 0.625) + index = 3; + else if (angle >= 0.625 && angle <= 0.875) + index = 5; + else if (angle >= 0.875 && angle <= -0.875) + index = 7; + else if (angle >= -0.875 && angle <= -0.625) + index = 6; + else if (angle >= -0.625 && angle <= -0.375) + index = 4; + else if (angle >= -0.375 && angle <= -0.125) + index = 2; + + + std::cout << "angle: " << angle << std::endl; + float u, v, w, h; shader.Use(); atlas.Bind(); - atlas.TextureIndexToCoord(0, u, v, w, h); + atlas.TextureIndexToCoord(index, u, v, w, h); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); From 0856f913d23f8248ef66e43f9b571a37aa6875de Mon Sep 17 00:00:00 2001 From: Claudel-D-Roy <112507354+Claudel-D-Roy@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:48:04 -0500 Subject: [PATCH 5/6] yay --- SQCSim2021/remoteplayer.cpp | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/SQCSim2021/remoteplayer.cpp b/SQCSim2021/remoteplayer.cpp index 9a29ae3..f0ac72f 100644 --- a/SQCSim2021/remoteplayer.cpp +++ b/SQCSim2021/remoteplayer.cpp @@ -103,33 +103,39 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr Vector3f v4 = (playerPosition - CrossA * 0.5 * width - CrossB * 0.5 * height); Vector3f angleRemote = GetDirection(); - Vector3f angleCam = Vector3f(v2.z, 0, -v2.x); + Vector3f angleCam = (v1 - v2).Cross(v3 - v2); angleCam.y = 0; angleRemote.y = 0; angleCam.Normalize(); angleRemote.Normalize(); float angle = angleRemote.Dot(angleCam); - angle *= 100; + //angle *= 100; + //angle /= 57.2958; int index = 0; + + Vector3f side = angleRemote.Cross(angleCam); - if (angle >= -0.125 && angle <= 0.125) + //std::cout << "trying: " << trying.y << std::endl; + bool isLeft = side.y > 0; + if (angle >= 0.75 ) //Face //side positif index = 0; - else if (angle >= 0.125 && angle <= 0.375) + else if (angle >= 0.25 && isLeft) //Frontleft index = 1; - else if (angle >= 0.375 && angle <= 0.625) + else if (angle >= -0.25 && isLeft) //ProfileLeft index = 3; - else if (angle >= 0.625 && angle <= 0.875) + else if (angle >= -0.75 && isLeft) //BackLeft index = 5; - else if (angle >= 0.875 && angle <= -0.875) + else if (angle < -0.75) //Dos //side négatif index = 7; - else if (angle >= -0.875 && angle <= -0.625) - index = 6; - else if (angle >= -0.625 && angle <= -0.375) - index = 4; - else if (angle >= -0.375 && angle <= -0.125) + else if (angle >= 0.25 && !isLeft) //FrontRight index = 2; + else if (angle >= -0.25 && !isLeft) //ProfileRight + index = 4; + else if (angle >= -0.75 && !isLeft) //BackRight + index = 6; + std::cout << index << std::endl; std::cout << "angle: " << angle << std::endl; From 7a7dc1fad6260807ad8d493f80fe3a6850d8bf1b Mon Sep 17 00:00:00 2001 From: Claudel-D-Roy <112507354+Claudel-D-Roy@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:16:30 -0500 Subject: [PATCH 6/6] DomoAriGato --- SQCSim2021/engine.cpp | 88 ++++++++++++++++++------------------- SQCSim2021/remoteplayer.cpp | 4 +- 2 files changed, 45 insertions(+), 47 deletions(-) diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index a63664f..c35abf9 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -472,57 +472,57 @@ void Engine::LoadResource() { TextureAtlas::TextureIndex StillBack = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueBackRight.png"); //7 //SHOOTINGSTILL SANS TIRER - //TextureAtlas::TextureIndex StillFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png"); - //TextureAtlas::TextureIndex StillQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png"); - //TextureAtlas::TextureIndex StillQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueRightShootingRight.png"); - //TextureAtlas::TextureIndex StillProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingLeft.png"); - //TextureAtlas::TextureIndex StillProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingRight.png"); - //TextureAtlas::TextureIndex StillQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackLeftShootingLeft.png"); - //TextureAtlas::TextureIndex StillQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackRightShootingRight.png"); - //TextureAtlas::TextureIndex StillBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueShootingBackRight.png"); + //TextureAtlas::TextureIndex StillFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png"); ////9 + //TextureAtlas::TextureIndex StillQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png"); ////10 + //TextureAtlas::TextureIndex StillQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueRightShootingRight.png"); ////11 + //TextureAtlas::TextureIndex StillProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingLeft.png"); ////12 + //TextureAtlas::TextureIndex StillProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingRight.png"); ////13 + //TextureAtlas::TextureIndex StillQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackLeftShootingLeft.png"); ////14 + //TextureAtlas::TextureIndex StillQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackRightShootingRight.png"); ////15 + //TextureAtlas::TextureIndex StillBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueShootingBackRight.png"); ////16 //SHOOTINGSTILL TIRER - //TextureAtlas::TextureIndex StillFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueFrontRightShootingRightShoot1.png"); - //TextureAtlas::TextureIndex StillQuarterFrontLeftFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueLeftShootingLeftShoot1.png"); - //TextureAtlas::TextureIndex StillQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueRightShootingRightShoot1.png"); - //TextureAtlas::TextureIndex StillProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingLeftShoot1.png"); - //TextureAtlas::TextureIndex StillProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingRightShoot1.png"); - //TextureAtlas::TextureIndex StillQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackLeftShootingLeftShoot1.png"); - //TextureAtlas::TextureIndex StillQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackRightShootingRightShoot1.png"); - //TextureAtlas::TextureIndex StillBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueShootingBackRightShoot1.png"); + //TextureAtlas::TextureIndex StillFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueFrontRightShootingRightShoot1.png"); ////17 + //TextureAtlas::TextureIndex StillQuarterFrontLeftFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueLeftShootingLeftShoot1.png"); ////18 + //TextureAtlas::TextureIndex StillQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueRightShootingRightShoot1.png"); ////19 + //TextureAtlas::TextureIndex StillProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingLeftShoot1.png"); ////20 + //TextureAtlas::TextureIndex StillProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingRightShoot1.png"); ////21 + //TextureAtlas::TextureIndex StillQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackLeftShootingLeftShoot1.png"); ////22 + //TextureAtlas::TextureIndex StillQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackRightShootingRightShoot1.png"); ////23 + //TextureAtlas::TextureIndex StillBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueShootingBackRightShoot1.png"); ////24 //JUMP - //TextureAtlas::TextureIndex JumpFront = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueFrontJumpRight.png"); - //TextureAtlas::TextureIndex JumpQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftFrontJumpLeft.png"); - //TextureAtlas::TextureIndex JumpQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightFrontJumpRight.png"); - //TextureAtlas::TextureIndex JumpProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpLeft.png"); - //TextureAtlas::TextureIndex JumpProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpRight.png"); - //TextureAtlas::TextureIndex JumpQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBackJumpLeft.png"); - //TextureAtlas::TextureIndex JumpQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBackJumpRight.png"); - //TextureAtlas::TextureIndex JumpBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackJumpRight.png"); + //TextureAtlas::TextureIndex JumpFront = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueFrontJumpRight.png"); ////25 + //TextureAtlas::TextureIndex JumpQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftFrontJumpLeft.png"); ////26 + //TextureAtlas::TextureIndex JumpQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightFrontJumpRight.png"); ////27 + //TextureAtlas::TextureIndex JumpProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpLeft.png"); ////28 + //TextureAtlas::TextureIndex JumpProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpRight.png"); ////29 + //TextureAtlas::TextureIndex JumpQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBackJumpLeft.png"); ////30 + //TextureAtlas::TextureIndex JumpQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBackJumpRight.png"); ////31 + //TextureAtlas::TextureIndex JumpBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackJumpRight.png"); ////32 - //SHOOTINGJUMP SANS TIRER - //TextureAtlas::TextureIndex JumpFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontJumpRightShootingRight.png"); - //TextureAtlas::TextureIndex JumpQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontLeftJumpLeftShootingLeft.png"); - //TextureAtlas::TextureIndex JumpQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontRightJumpRightShootingRight.png"); - //TextureAtlas::TextureIndex JumpProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueProfilLeftJumpLeftShootingLeft.png"); - //TextureAtlas::TextureIndex JumpProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BluerProfilRightJumprightShootingRight.png"); - //TextureAtlas::TextureIndex JumpQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackLeftJumpLeftShootingLeft.png"); - //TextureAtlas::TextureIndex JumpQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackRightJumpRightShootingRight.png"); - //TextureAtlas::TextureIndex JumpBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackJumpRightShootingRight.png"); - + //SHOOTINGJUMP SANS TIRER + //TextureAtlas::TextureIndex JumpFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontJumpRightShootingRight.png"); ////33 + //TextureAtlas::TextureIndex JumpQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontLeftJumpLeftShootingLeft.png"); ////34 + //TextureAtlas::TextureIndex JumpQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontRightJumpRightShootingRight.png"); ////35 + //TextureAtlas::TextureIndex JumpProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueProfilLeftJumpLeftShootingLeft.png"); ////36 + //TextureAtlas::TextureIndex JumpProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BluerProfilRightJumprightShootingRight.png"); ////37 + //TextureAtlas::TextureIndex JumpQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackLeftJumpLeftShootingLeft.png"); ////38 + //TextureAtlas::TextureIndex JumpQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackRightJumpRightShootingRight.png"); ////39 + //TextureAtlas::TextureIndex JumpBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackJumpRightShootingRight.png"); ////40 + //SHOOTINGJUMP TIRER - //TextureAtlas::TextureIndex JumpFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontJumpRightShootingRightShoot1.png"); - //TextureAtlas::TextureIndex JumpQuarterFrontLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontLeftJumpLeftShootingLeftShoot1.png"); - //TextureAtlas::TextureIndex JumpQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontRightJumpRightShootingRightShoot1.png"); - //TextureAtlas::TextureIndex JumpProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueProfilLeftJumpLeftShootingLeftShoot1.png"); - //TextureAtlas::TextureIndex JumpProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BluerProfilRightJumprightShootingRightShoot1.png"); - //TextureAtlas::TextureIndex JumpQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackLeftJumpLeftShootingLeftShoot1.png"); - //TextureAtlas::TextureIndex JumpQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackRightJumpRightShootingRightShoot1.png"); - //TextureAtlas::TextureIndex JumpBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackJumpRightShootingRightShoot1.png"); + //TextureAtlas::TextureIndex JumpFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontJumpRightShootingRightShoot1.png"); ////41 + //TextureAtlas::TextureIndex JumpQuarterFrontLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontLeftJumpLeftShootingLeftShoot1.png"); ////42 + //TextureAtlas::TextureIndex JumpQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontRightJumpRightShootingRightShoot1.png"); ////43 + //TextureAtlas::TextureIndex JumpProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueProfilLeftJumpLeftShootingLeftShoot1.png"); ////44 + //TextureAtlas::TextureIndex JumpProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BluerProfilRightJumprightShootingRightShoot1.png"); ////45 + //TextureAtlas::TextureIndex JumpQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackLeftJumpLeftShootingLeftShoot1.png"); ////46 + //TextureAtlas::TextureIndex JumpQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackRightJumpRightShootingRightShoot1.png"); ////47 + //TextureAtlas::TextureIndex JumpBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackJumpRightShootingRightShoot1.png"); ////48 @@ -1249,8 +1249,8 @@ void Engine::Render(float elapsedTime) { m_renderer.UpdateMesh(&m_world, m_player.GetPosition(), m_blockinfo); //m_booster.RenderBillboard({ 195,16,195 }, m_textureAtlas, m_shader01, all); - m_remotePlayer.ApplyPhysics(Vector3f(0, 0, 0), &m_world, elapsedTime); - m_remotePlayer.Render(m_animeAtlas, m_shader01, all ,elapsedTime , m_player); + /* m_remotePlayer.ApplyPhysics(Vector3f(0, 0, 0), &m_world, elapsedTime); + m_remotePlayer.Render(m_animeAtlas, m_shader01, all ,elapsedTime , m_player);*/ m_renderer.RenderWorld(&m_world, m_renderCount, m_player.GetPosition(), m_player.GetDirection(), all, m_shader01, m_textureAtlas); diff --git a/SQCSim2021/remoteplayer.cpp b/SQCSim2021/remoteplayer.cpp index f0ac72f..fb30c3e 100644 --- a/SQCSim2021/remoteplayer.cpp +++ b/SQCSim2021/remoteplayer.cpp @@ -110,13 +110,11 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr angleRemote.Normalize(); float angle = angleRemote.Dot(angleCam); - //angle *= 100; - //angle /= 57.2958; int index = 0; Vector3f side = angleRemote.Cross(angleCam); - //std::cout << "trying: " << trying.y << std::endl; + bool isLeft = side.y > 0; if (angle >= 0.75 ) //Face //side positif index = 0;