Fixat med ljus

This commit is contained in:
Tobias Dahl
2014-03-13 03:52:19 +01:00
parent 7991efedf8
commit 461a039d87
8 changed files with 53 additions and 29 deletions
@@ -24,6 +24,7 @@ void Systems::LevelGenerationSystem::SpawnObstacle()
bounds = m_World->AddComponent<Components::Bounds>(ent, "Bounds");
collision = m_World->AddComponent<Components::Collision>(ent, "Collision");
model = m_World->AddComponent<Components::Model>(ent, "Model");
//pointLight = m_World->AddComponent<Components::PointLight>(ent, "PointLight");
positionRandom = -500 + (rand() % 1000);
@@ -47,6 +48,13 @@ void Systems::LevelGenerationSystem::SpawnObstacle()
transform->Position = glm::vec3( positionRandom, startyz); // fix position
bounds->VolumeVector = glm::vec3(1, 1, 1);
bounds->Origin = glm::vec3(0,1,0);
// pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
// pointLight->Diffuse = glm::vec3(1.0, 1.0, 1.0);
// pointLight->Diffuse = glm::vec3(0.0, 3.0, 0.0);
// pointLight->constantAttenuation = 0.f;
// pointLight->linearAttenuation = 1.f;
// pointLight->quadraticAttenuation = 0.f;
// pointLight->spotExponent = 0.0f;
model->ModelFile = "Models/obstacle_cube_1.obj";
break;
@@ -7,6 +7,7 @@
#include "Components/Bounds.h"
#include "Components/Collision.h"
#include "Components/Model.h"
#include "Components/PointLight.h"
namespace Systems
@@ -34,6 +35,7 @@ namespace Systems
std::shared_ptr<Components::Bounds> bounds;
std::shared_ptr<Components::Collision> collision;
std::shared_ptr<Components::Model> model;
std::shared_ptr<Components::PointLight> pointLight;
};
}
+1 -3
View File
@@ -3,6 +3,7 @@
Systems::PlayerSystem::PlayerSystem( World* world ) : System(world)
{
speed = 20;
}
void Systems::PlayerSystem::Update(double dt)
@@ -18,8 +19,6 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
if (input == nullptr)
return;
float speed = 20.0f;
auto name = m_World->GetProperty<std::string>(entity, "Name");
if (name == "Camera") {
@@ -60,7 +59,6 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
// TOUCHING THIS CODE MIGHT COUSE THE UNIVERSE TO IMPLODE, ALSO DRAGONS
}
}
name = m_World->GetProperty<std::string>(entity, "Name");
if (name == "PlayerShip")
{
+1 -1
View File
@@ -20,7 +20,7 @@ namespace Systems
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
private:
float speed;
};
}