Indentation style changed to Horstmann

This commit is contained in:
2014-04-11 21:53:05 +02:00
parent e70e18a27b
commit f2259f712d
61 changed files with 353 additions and 697 deletions
+9 -18
View File
@@ -3,26 +3,21 @@
#include "World.h"
void Systems::RenderSystem::OnComponentCreated(std::string type, std::shared_ptr<Component> component)
{
if(type == "Model")
{
auto modelComponent = std::static_pointer_cast<Components::Model>(component);
{ if(type == "Model")
{ auto modelComponent = std::static_pointer_cast<Components::Model>(component);
}
}
void Systems::RenderSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
{
auto transformComponent = m_World->GetComponent<Components::Transform>(entity, "Transform");
{ auto transformComponent = m_World->GetComponent<Components::Transform>(entity, "Transform");
if (transformComponent == nullptr)
return;
// Draw models
auto modelComponent = m_World->GetComponent<Components::Model>(entity, "Model");
if (modelComponent != nullptr)
{
if (m_CachedModels.find(modelComponent->ModelFile) == m_CachedModels.end())
{
m_CachedModels[modelComponent->ModelFile] = std::make_shared<Model>(OBJ(modelComponent->ModelFile));
{ if (m_CachedModels.find(modelComponent->ModelFile) == m_CachedModels.end())
{ m_CachedModels[modelComponent->ModelFile] = std::make_shared<Model>(OBJ(modelComponent->ModelFile));
}
auto model = m_CachedModels[modelComponent->ModelFile];
@@ -37,8 +32,7 @@ void Systems::RenderSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
auto collision = m_World->GetComponent<Components::Collision>(entity, "Collision");
auto bounds = m_World->GetComponent<Components::Bounds>(entity, "Bounds");
if (bounds != nullptr)
{
glm::vec3 origin = m_TransformSystem->AbsolutePosition(entity) + (transformComponent->Scale * bounds->Origin);
{ glm::vec3 origin = m_TransformSystem->AbsolutePosition(entity) + (transformComponent->Scale * bounds->Origin);
glm::vec3 volumeVector = transformComponent->Scale * bounds->VolumeVector;
m_Renderer->AddAABBToDraw(origin, volumeVector, (collision != nullptr && collision->CollidingEntities.size() > 0));
}
@@ -46,8 +40,7 @@ void Systems::RenderSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
auto pointLightComponent = m_World->GetComponent<Components::PointLight>(entity, "PointLight");
if (pointLightComponent != nullptr)
{
glm::vec3 position = m_TransformSystem->AbsolutePosition(entity);
{ glm::vec3 position = m_TransformSystem->AbsolutePosition(entity);
m_Renderer->AddPointLightToDraw(
position,
pointLightComponent->Specular,
@@ -60,8 +53,7 @@ void Systems::RenderSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
auto cameraComponent = m_World->GetComponent<Components::Camera>(entity, "Camera");
if (cameraComponent != nullptr)
{
m_Renderer->GetCamera()->Position(transformComponent->Position);
{ m_Renderer->GetCamera()->Position(transformComponent->Position);
m_Renderer->GetCamera()->Orientation(transformComponent->Orientation);
m_Renderer->GetCamera()->FOV(cameraComponent->FOV);
@@ -71,8 +63,7 @@ void Systems::RenderSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
}
void Systems::RenderSystem::Initialize()
{
m_TransformSystem = m_World->GetSystem<Systems::TransformSystem>("TransformSystem");
{ m_TransformSystem = m_World->GetSystem<Systems::TransformSystem>("TransformSystem");
}