oooooooooo

This commit is contained in:
MarcEricMartel
2023-12-18 14:24:43 -05:00
parent f1bb7447f9
commit 25b5c1e492
5 changed files with 23 additions and 18 deletions

View File

@@ -244,14 +244,11 @@ void Renderer::UpdateMesh(World* origin, const Vector3f& player, BlockInfo* bloc
}
}
void Renderer::RenderBooster(TextureAtlas& textureAtlas, Shader& shader, Transformation tran, Player player, Booster booster)
{
if (booster.GetAvailability() == true)
{
void Renderer::RenderBooster(TextureAtlas& textureAtlas, Shader& shader, Transformation tran, Player player, Booster* booster) {
float width = 1.f;
float height = 1.f;
Vector3f DiffCam = booster.GetPosition() - player.GetPosition();
Vector3f DiffCam = booster->GetPosition() - player.GetPosition();
Vector3f UpCam = Vector3f(0.f, 1.f, 0.f);
Vector3f CrossA = DiffCam.Cross(UpCam);
@@ -260,7 +257,7 @@ void Renderer::RenderBooster(TextureAtlas& textureAtlas, Shader& shader, Transfo
CrossA.Normalize();
CrossB.Normalize();
Vector3f playerPosition = booster.GetPosition() + Vector3f(0.f, -.75f, 0.f);
Vector3f playerPosition = booster->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);
@@ -268,7 +265,7 @@ void Renderer::RenderBooster(TextureAtlas& textureAtlas, Shader& shader, Transfo
Vector3f v4 = (playerPosition - CrossA * 0.5 * width - CrossB * 0.5 * height);
int index;
BOOST_TYPE type = booster.GetType();
BOOST_TYPE type = booster->GetType();
switch (type)
{
@@ -312,11 +309,8 @@ void Renderer::RenderBooster(TextureAtlas& textureAtlas, Shader& shader, Transfo
glDisable(GL_BLEND);
shader.Disable();
}
}
void Renderer::RenderPlayer(Player* player, Transformation tran) const {
}