Merge branch 'master' of github.com:sippeangelo/Escape-the-Dawn

Conflicts:
	Escape-the-Dawn/Escape-the-Dawn.vcxproj.filters
	Escape-the-Dawn/GameWorld.cpp
	Escape-the-Dawn/Renderer.cpp
	Escape-the-Dawn/Systems/RenderSystem.cpp
This commit is contained in:
Tobias Dahl
2014-03-12 15:34:25 +01:00
7 changed files with 25 additions and 467 deletions
+9 -22
View File
@@ -1,5 +1,6 @@
#include "GameWorld.h"
void GameWorld::Initialize()
{
World::Initialize();
@@ -18,24 +19,14 @@ void GameWorld::Initialize()
std::shared_ptr<Components::Camera> camera;
EntityID ent;
// Camera
ent = CreateEntity();
SetProperty(ent, "Name", std::string("Camera"));
transform = AddComponent<Components::Transform>(ent, "Transform");
AddComponent<Components::Input>(ent, "Input");
transform->Position = glm::vec3(0.f, 2.f, 10.f);
camera = AddComponent<Components::Camera>(ent, "Camera");
camera->FOV = 45.f;
camera->FarClip = 1000.f;
camera->NearClip = 0.01f;
transform->Orientation = glm::angleAxis<float>(glm::radians(25.0f),glm::vec3(1,0,0));
// Fucking lights
ent = CreateEntity();
transform = AddComponent<Components::Transform>(ent, "Transform");
transform->Position = glm::vec3(0.f, 4.f, 0.f);
transform->Position = glm::vec3(10.f, 2.f, 5.f);
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
pointLight->Diffuse = glm::vec3(1.0, 1.0, 1.0);
pointLight->Diffuse = glm::vec3(1.0, 1.0, 5.0);
pointLight->constantAttenuation = 0.f;
pointLight->linearAttenuation = 1.f;
@@ -45,8 +36,11 @@ void GameWorld::Initialize()
model->ModelFile = "sphere.obj";
ent = CreateEntity();
transform = AddComponent<Components::Transform>(ent, "Transform");
transform->Position = glm::vec3(10.f, 4.f, 0.f);
transform->Position = glm::vec3(0.f, 2.f, 5.f);
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
pointLight->Specular = glm::vec3(1.0, 1.0, 1.0);
pointLight->Diffuse = glm::vec3(1.0, 1.0, 1.0);
pointLight->Specular = glm::vec3(3.0, 3.0, 3.0);
pointLight->Diffuse = glm::vec3(3.0, 0.0, 0.0);
pointLight->constantAttenuation = 0.f;
@@ -57,9 +51,11 @@ void GameWorld::Initialize()
model->ModelFile = "sphere.obj";
ent = CreateEntity();
transform = AddComponent<Components::Transform>(ent, "Transform");
transform->Position = glm::vec3(0.f, -4.f, 0.f);
transform->Position = glm::vec3(-10.f, 2.f, 5.f);
pointLight = AddComponent<Components::PointLight>(ent, "PointLight");
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;
@@ -87,14 +83,6 @@ void GameWorld::Initialize()
transform->Position = glm::vec3(10.f, 0.f, 0.f);
model = AddComponent<Components::Model>(ent, "Model");
model->ModelFile = "ship.obj";
auto soundEmitter = AddComponent<Components::SoundEmitter>(ent, "SoundEmitter");
soundEmitter->Gain = 0.1f;
soundEmitter->MaxDistance = FLT_MAX;
soundEmitter->ReferenceDistance = 10;
soundEmitter->Loop = true;
soundEmitter->Pitch = 0;
//GetSystem<Systems::SoundSystem>("SoundSystem")->PlaySound(soundEmitter, "Sounds/hallelujah.wav");
}
void GameWorld::Update(double dt)
@@ -129,5 +117,4 @@ void GameWorld::RegisterSystems()
m_SystemFactory.Register("PlayerSystem", [this]() { return new Systems::PlayerSystem(this); });
m_SystemFactory.Register("SoundSystem", [this]() { return new Systems::SoundSystem(this); });
m_SystemFactory.Register("RenderSystem", [this]() { return new Systems::RenderSystem(this, m_Renderer); });
}
}