Merge branch 'SQC-15_online' of https://github.com/CegepSTH/SQCSim2023 into SQC-15_online

This commit is contained in:
MarcEricMartel 2023-12-13 14:06:29 -05:00
commit 2dbaf84844

View File

@ -118,15 +118,16 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
int index = 0; int index = 0;
angle = -angle; angle = -angle;
Vector3f side = angleRemote.Cross(angleCam); Vector3f side = angleRemote.Cross(angleCam);
side = -side;
static float time = 0.f; static float time = 0.f;
static bool Shooting = false; static bool Shooting = false;
bool isLeft = side.y > 0; bool isLeft = side.y > 0;
time += elapsedTime; time += elapsedTime;
if (time >= 100) if (time >= 500)
{ {
time -= 100; time -= 500;
if (!current.states.shooting) if (!current.states.shooting)
Shooting = false; Shooting = false;
else else
@ -143,7 +144,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else else
index = 9; index = 9;
std::cout << "face" << std::endl;
} }
else if (current.states.jumpshot) { else if (current.states.jumpshot) {
if (Shooting) if (Shooting)
@ -156,6 +156,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 0; index = 0;
} }
else if (angle >= 0.25 && isLeft) //Frontleft else if (angle >= 0.25 && isLeft) //Frontleft
{ {
@ -165,7 +167,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else else
index = 10; index = 10;
std::cout << "Frontleft" << std::endl;
} }
else if (current.states.jumpshot) { else if (current.states.jumpshot) {
if (Shooting) if (Shooting)
@ -178,6 +179,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 1; index = 1;
} }
else if (angle >= -0.25 && isLeft) //ProfileLeft else if (angle >= -0.25 && isLeft) //ProfileLeft
{ {
@ -187,8 +189,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else else
index = 12; index = 12;
std::cout << "ProfileLeft" << std::endl;
} }
else if (current.states.jumpshot ) { else if (current.states.jumpshot ) {
if (Shooting) if (Shooting)
@ -201,6 +201,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 3; index = 3;
} }
else if (angle >= -0.75 && isLeft) //BackLeft else if (angle >= -0.75 && isLeft) //BackLeft
{ {
@ -210,7 +211,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else else
index = 14; index = 14;
std::cout << "BackLeft" << std::endl;
} }
else if (current.states.jumpshot) { else if (current.states.jumpshot) {
if (Shooting) if (Shooting)
@ -222,6 +222,8 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 30; index = 30;
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 5; index = 5;
} }
else if (angle < -0.75) //Dos - side négatif else if (angle < -0.75) //Dos - side négatif
{ {
@ -231,7 +233,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else else
index = 16; index = 16;
std::cout << "Dos" << std::endl;
} }
else if (current.states.jumpshot) { else if (current.states.jumpshot) {
if (Shooting) if (Shooting)
@ -244,6 +245,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 7; index = 7;
} }
else if (angle >= 0.25 && !isLeft) //FrontRight else if (angle >= 0.25 && !isLeft) //FrontRight
{ {
@ -252,8 +254,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 19; index = 19;
else else
index = 11; index = 11;
std::cout << "FrontRight" << std::endl;
} }
else if (current.states.jumpshot) { else if (current.states.jumpshot) {
if (Shooting) if (Shooting)
@ -266,6 +266,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 2; index = 2;
} }
else if (angle >= -0.25 && !isLeft) //ProfileRight else if (angle >= -0.25 && !isLeft) //ProfileRight
{ {
@ -274,8 +275,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
index = 21; index = 21;
else else
index = 13; index = 13;
std::cout << "ProfileRight" << std::endl;
} }
else if (current.states.jumpshot) { else if (current.states.jumpshot) {
if (Shooting) if (Shooting)
@ -288,6 +287,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 4; index = 4;
} }
else if (angle >= -0.75 && !isLeft) //BackRight else if (angle >= -0.75 && !isLeft) //BackRight
{ {
@ -297,9 +297,6 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else else
index = 15; index = 15;
std::cout << "BackRight" << std::endl;
} }
else if (current.states.jumpshot) { else if (current.states.jumpshot) {
if (Shooting) if (Shooting)
@ -312,6 +309,7 @@ void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tr
else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot) else if (!current.states.jumping && !current.states.shooting && !current.states.jumpshot)
index = 6; index = 6;
} }