diff --git a/src/Components/Box.h b/src/Components/BoxShape.h similarity index 85% rename from src/Components/Box.h rename to src/Components/BoxShape.h index b9ddea7..dc836ec 100644 --- a/src/Components/Box.h +++ b/src/Components/BoxShape.h @@ -6,9 +6,9 @@ namespace Components { -struct Box : Component +struct BoxShape : Component { - Box() + BoxShape() : Width(1.f), Height(1.f), Depth(1.f){ } float Width; diff --git a/src/Components/Sphere.h b/src/Components/SphereShape.h similarity index 80% rename from src/Components/Sphere.h rename to src/Components/SphereShape.h index 2d089dd..afc717b 100644 --- a/src/Components/Sphere.h +++ b/src/Components/SphereShape.h @@ -6,9 +6,9 @@ namespace Components { -struct Sphere : Component +struct SphereShape : Component { - Sphere() + SphereShape() : Radius(1.f){ } float Radius; diff --git a/src/GameWorld.cpp b/src/GameWorld.cpp index 7926dcb..da3c1c8 100755 --- a/src/GameWorld.cpp +++ b/src/GameWorld.cpp @@ -21,7 +21,7 @@ void GameWorld::Initialize() transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f)); auto model = AddComponent(ground, "Model"); model->ModelFile = "Models/Placeholders/PhysicsTest/Cube.obj"; - auto box = AddComponent(ground, "Box"); + auto box = AddComponent(ground, "BoxShape"); box->Width = 200; box->Height = 5; box->Depth = 200; @@ -41,7 +41,7 @@ void GameWorld::Initialize() auto physics = AddComponent(jeep, "Physics"); physics->Mass = 1200; - auto box = AddComponent(jeep, "Box"); + auto box = AddComponent(jeep, "BoxShape"); box->Width = 1.487f; box->Height = 0.727f; box->Depth = 2.594f; @@ -239,7 +239,7 @@ void GameWorld::Initialize() auto physics = AddComponent(cube, "Physics"); physics->Mass = 100; - auto box = AddComponent(cube, "Box"); + auto box = AddComponent(cube, "BoxShape"); box->Width = 0.5f; box->Height = 0.5f; box->Depth = 0.5f; @@ -266,10 +266,6 @@ void GameWorld::RegisterComponents() { m_ComponentFactory.Register("Transform", []() { return new Components::Transform(); }); m_ComponentFactory.Register("Template", []() { return new Components::Template(); }); - m_ComponentFactory.Register("Sphere", []() { return new Components::Sphere(); }); - m_ComponentFactory.Register("Box", []() { return new Components::Box (); }); - m_ComponentFactory.Register("Vehicle", []() { return new Components::Vehicle(); }); - m_ComponentFactory.Register("Wheel", []() { return new Components::Wheel(); }); } void GameWorld::RegisterSystems() diff --git a/src/GameWorld.h b/src/GameWorld.h index 1e0f4a1..673358c 100755 --- a/src/GameWorld.h +++ b/src/GameWorld.h @@ -27,8 +27,8 @@ #include "Components/Transform.h" #include "Components/Physics.h" -#include "Components/Sphere.h" -#include "Components/Box.h" +#include "Components/SphereShape.h" +#include "Components/BoxShape.h" #include "Components/Vehicle.h" #include "Components/Wheel.h" diff --git a/src/Systems/PhysicsSystem.cpp b/src/Systems/PhysicsSystem.cpp index b4f8200..1f27e69 100644 --- a/src/Systems/PhysicsSystem.cpp +++ b/src/Systems/PhysicsSystem.cpp @@ -63,8 +63,8 @@ Systems::PhysicsSystem::PhysicsSystem(World* world) : System(world) void Systems::PhysicsSystem::RegisterComponents(ComponentFactory* cf) { cf->Register("Physics", []() { return new Components::Physics(); }); - cf->Register("Box", []() { return new Components::Box(); }); - cf->Register("Sphere", []() { return new Components::Sphere(); }); + cf->Register("BoxShape", []() { return new Components::BoxShape(); }); + cf->Register("SphereShape", []() { return new Components::SphereShape(); }); cf->Register("Vehicle", []() { return new Components::Vehicle(); }); cf->Register("Wheel", []() { return new Components::Wheel(); }); } @@ -181,8 +181,8 @@ void Systems::PhysicsSystem::OnEntityCommit( EntityID entity ) if (!physicsComponent) return; - auto sphereComponent = m_World->GetComponent(entity, "Sphere"); - auto boxComponent = m_World->GetComponent(entity, "Box"); + auto sphereComponent = m_World->GetComponent(entity, "SphereShape"); + auto boxComponent = m_World->GetComponent(entity, "BoxShape"); hkpConvexShape* shape; @@ -285,8 +285,8 @@ void Systems::PhysicsSystem::SetUpPhysicsState(EntityID entity, EntityID parent) if (!physicsComponent) return; - auto sphereComponent = m_World->GetComponent(entity, "Sphere"); - auto boxComponent = m_World->GetComponent(entity, "Box"); + auto sphereComponent = m_World->GetComponent(entity, "SphereShape"); + auto boxComponent = m_World->GetComponent(entity, "BoxShape"); hkpConvexShape* shape; diff --git a/src/Systems/PhysicsSystem.h b/src/Systems/PhysicsSystem.h index f5ca539..5d1af28 100644 --- a/src/Systems/PhysicsSystem.h +++ b/src/Systems/PhysicsSystem.h @@ -4,8 +4,8 @@ #include "System.h" #include "Components/Transform.h" #include "Components/Physics.h" -#include "Components/Sphere.h" -#include "Components/Box.h" +#include "Components/BoxShape.h" +#include "Components/SphereShape.h" #include "Components/Vehicle.h" #include "Components/Input.h" diff --git a/vs11/Returngeance/Returngeance.vcxproj b/vs11/Returngeance/Returngeance.vcxproj index 65ee872..8d90c02 100755 --- a/vs11/Returngeance/Returngeance.vcxproj +++ b/vs11/Returngeance/Returngeance.vcxproj @@ -121,7 +121,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/vs11/Returngeance/Returngeance.vcxproj.filters b/vs11/Returngeance/Returngeance.vcxproj.filters index dfd85bb..9d5ff23 100755 --- a/vs11/Returngeance/Returngeance.vcxproj.filters +++ b/vs11/Returngeance/Returngeance.vcxproj.filters @@ -215,12 +215,6 @@ Audio - - Physics\Components - - - Physics\Components - Physics\Components @@ -230,6 +224,12 @@ Physics + + Physics\Components + + + Physics\Components +