Powerup FOV fixed
This commit is contained in:
@@ -9,4 +9,4 @@ Ks 0.500000 0.500000 0.500000
|
|||||||
Ni 1.000000
|
Ni 1.000000
|
||||||
d 1.000000
|
d 1.000000
|
||||||
illum 2
|
illum 2
|
||||||
map_Kd ObstacleTexture.png
|
map_Kd planetexture.png
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -55,7 +55,7 @@ void Systems::LevelGenerationSystem::SpawnObstacle()
|
|||||||
else if(typeRandom >= 5 && typeRandom < 8)
|
else if(typeRandom >= 5 && typeRandom < 8)
|
||||||
{
|
{
|
||||||
m_World->SetProperty(ent, "Name", std::string("Obstacle"));
|
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);
|
transform->Scale = glm::vec3(scale);
|
||||||
bounds->VolumeVector = glm::vec3(1, 1, 1);
|
bounds->VolumeVector = glm::vec3(1, 1, 1);
|
||||||
bounds->Origin = glm::vec3(0,1,0);
|
bounds->Origin = glm::vec3(0,1,0);
|
||||||
|
|||||||
@@ -162,6 +162,9 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
|
|||||||
|
|
||||||
|
|
||||||
//powerup
|
//powerup
|
||||||
|
auto cameraEntity = m_World->GetProperty<EntityID>(entity, "Camera");
|
||||||
|
auto cameracamera = m_World->GetComponent<Components::Camera>(cameraEntity, "Camera");
|
||||||
|
|
||||||
auto collisionComponent = m_World->GetComponent<Components::Collision>(entity, "Collision");
|
auto collisionComponent = m_World->GetComponent<Components::Collision>(entity, "Collision");
|
||||||
for(auto ent : collisionComponent->CollidingEntities)
|
for(auto ent : collisionComponent->CollidingEntities)
|
||||||
{
|
{
|
||||||
@@ -171,25 +174,29 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
|
|||||||
auto powerupComp = m_World->GetComponent<Components::PowerUp>(ent, "PowerUp");
|
auto powerupComp = m_World->GetComponent<Components::PowerUp>(ent, "PowerUp");
|
||||||
transform->Velocity.z = powerupComp->Speed;
|
transform->Velocity.z = powerupComp->Speed;
|
||||||
m_poweruptimeleft = 3.f;
|
m_poweruptimeleft = 3.f;
|
||||||
m_World->RemoveEntity(ent);
|
m_World->RemoveEntity(ent);
|
||||||
|
|
||||||
|
|
||||||
|
cameracamera->FOV = 55.f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(m_poweruptimeleft <= 0)
|
if(m_poweruptimeleft <= 0)
|
||||||
{
|
{
|
||||||
transform->Velocity.z = m_basespeed;
|
transform->Velocity.z = m_basespeed;
|
||||||
|
cameracamera->FOV = 45.f;
|
||||||
}
|
}
|
||||||
//fixa FOV
|
|
||||||
|
|
||||||
|
|
||||||
// Update camera
|
// Update camera
|
||||||
if(! freecamEnabled)
|
if(! freecamEnabled)
|
||||||
{
|
{
|
||||||
auto cameraEntity = m_World->GetProperty<EntityID>(entity, "Camera");
|
|
||||||
auto cameraTransform = m_World->GetComponent<Components::Transform>(cameraEntity, "Transform");
|
auto cameraTransform = m_World->GetComponent<Components::Transform>(cameraEntity, "Transform");
|
||||||
if (cameraTransform) {
|
if (cameraTransform) {
|
||||||
cameraTransform->Position = transform->Position + m_CameraOffset;
|
cameraTransform->Position = transform->Position + m_CameraOffset;
|
||||||
cameraTransform->Orientation = m_CameraOrientation;
|
cameraTransform->Orientation = m_CameraOrientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user