From 3378e75313d749d0590f86945f2901660ec69c99 Mon Sep 17 00:00:00 2001 From: ViktorLjung Date: Fri, 14 Mar 2014 00:00:36 +0100 Subject: [PATCH] Powerup FOV fixed --- Escape-the-Dawn/Models/plane.mtl | 2 +- Escape-the-Dawn/Models/planetexture.png | Bin 0 -> 6952 bytes .../Systems/LevelGenerationSystem.cpp | 2 +- Escape-the-Dawn/Systems/PlayerSystem.cpp | 13 ++++++++++--- 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 Escape-the-Dawn/Models/planetexture.png diff --git a/Escape-the-Dawn/Models/plane.mtl b/Escape-the-Dawn/Models/plane.mtl index 2961836..28df6eb 100644 --- a/Escape-the-Dawn/Models/plane.mtl +++ b/Escape-the-Dawn/Models/plane.mtl @@ -9,4 +9,4 @@ Ks 0.500000 0.500000 0.500000 Ni 1.000000 d 1.000000 illum 2 -map_Kd ObstacleTexture.png +map_Kd planetexture.png diff --git a/Escape-the-Dawn/Models/planetexture.png b/Escape-the-Dawn/Models/planetexture.png new file mode 100644 index 0000000000000000000000000000000000000000..6766b13687f00ca520be4c54e86d6a2b55ac33bc GIT binary patch literal 6952 zcmeAS@N?(olHy`uVBq!ia0y~yVA%k|985rw6lawgK#IM@)7O>#9y70)g`mkgGfSY5 zc!_I7NpOBzNqJ&XDucU^3(y#aveY64V?C3?)+G;tN;pai{M>;u#y~cMSA(WJkYY)9 z^mSxl*x1kgCy^D%XG`*ScVYMsf(!O8pUl7@)$Hlw7*a9k&2>dapb-ZQeu*CwV*aRm z@NGJf?=kB=$gnyICkBQF4QCDp27y!#p!gylMFs|kDT*u%3>`)-Kox;)0t^farv!kW zaFHBUJQ^CKX=5~}j1~o>1>= 5 && typeRandom < 8) { m_World->SetProperty(ent, "Name", std::string("Obstacle")); - float scale = (float)(rand() % 1000) / 100; + float scale = 1.f + (float)(rand() % 1000) / 100; transform->Scale = glm::vec3(scale); bounds->VolumeVector = glm::vec3(1, 1, 1); bounds->Origin = glm::vec3(0,1,0); diff --git a/Escape-the-Dawn/Systems/PlayerSystem.cpp b/Escape-the-Dawn/Systems/PlayerSystem.cpp index 8080fa5..070b355 100644 --- a/Escape-the-Dawn/Systems/PlayerSystem.cpp +++ b/Escape-the-Dawn/Systems/PlayerSystem.cpp @@ -162,6 +162,9 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa //powerup + auto cameraEntity = m_World->GetProperty(entity, "Camera"); + auto cameracamera = m_World->GetComponent(cameraEntity, "Camera"); + auto collisionComponent = m_World->GetComponent(entity, "Collision"); for(auto ent : collisionComponent->CollidingEntities) { @@ -171,25 +174,29 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa auto powerupComp = m_World->GetComponent(ent, "PowerUp"); transform->Velocity.z = powerupComp->Speed; m_poweruptimeleft = 3.f; - m_World->RemoveEntity(ent); + m_World->RemoveEntity(ent); + + + cameracamera->FOV = 55.f; } } if(m_poweruptimeleft <= 0) { transform->Velocity.z = m_basespeed; + cameracamera->FOV = 45.f; } - //fixa FOV // Update camera if(! freecamEnabled) { - auto cameraEntity = m_World->GetProperty(entity, "Camera"); auto cameraTransform = m_World->GetComponent(cameraEntity, "Transform"); if (cameraTransform) { cameraTransform->Position = transform->Position + m_CameraOffset; cameraTransform->Orientation = m_CameraOrientation; } + + } } }