From 586f8d438c6e8678f48249a60ba750e6d1c2c958 Mon Sep 17 00:00:00 2001 From: viktorljung Date: Fri, 11 Sep 2015 11:04:22 +0100 Subject: [PATCH] changed box size/scale --- include/Core/Engine.h | 2 +- src/game/Physics/PhysicsSystem.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/Core/Engine.h b/include/Core/Engine.h index 2a8576a..1126c43 100644 --- a/include/Core/Engine.h +++ b/include/Core/Engine.h @@ -101,7 +101,7 @@ public: auto ent = m_World->CreateEntity(); std::shared_ptr transform = m_World->AddComponent(ent); transform->Position = glm::vec3(0.f, -3.f, -9.f); - transform->Scale = glm::vec3(2.f, 0.5f, 1.f); + transform->Scale = glm::vec3(8.f, 0.5f, 1.f); transform->Orientation = glm::rotate(transform->Orientation, glm::radians(25.f), glm::vec3(0, 0, -1)); std::shared_ptr sprite = m_World->AddComponent(ent); diff --git a/src/game/Physics/PhysicsSystem.cpp b/src/game/Physics/PhysicsSystem.cpp index 9905cbd..8303f0f 100644 --- a/src/game/Physics/PhysicsSystem.cpp +++ b/src/game/Physics/PhysicsSystem.cpp @@ -147,7 +147,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity) auto boxComponent = m_World->GetComponent(entity); if (boxComponent) { b2PolygonShape* bShape = new b2PolygonShape(); - bShape->SetAsBox(absoluteTransform.Scale.x/4, absoluteTransform.Scale.y/4); //TODO: THIS SUCKS DUDE 4?!?!?!? + bShape->SetAsBox(absoluteTransform.Scale.x/2, absoluteTransform.Scale.y/2); //TODO: THIS SUCKS DUDE 4?!?!?!? pShape = bShape; } else { auto circleComponent = m_World->GetComponent(entity); @@ -159,7 +159,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity) if (absoluteTransform.Scale.x != absoluteTransform.Scale.y && absoluteTransform.Scale.y != absoluteTransform.Scale.z) { LOG_WARNING("Circles has to be of uniform scale."); } - pShape->m_radius = absoluteTransform.Scale.x/4; //TODO: THIS ALSO SUCKS 4 WTH + pShape->m_radius = absoluteTransform.Scale.x/2; //TODO: THIS ALSO SUCKS 4 WTH } }