Box and Sphere components renamed to BoxShape and SphereShape
This commit is contained in:
@@ -6,9 +6,9 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Box : Component
|
struct BoxShape : Component
|
||||||
{
|
{
|
||||||
Box()
|
BoxShape()
|
||||||
: Width(1.f), Height(1.f), Depth(1.f){ }
|
: Width(1.f), Height(1.f), Depth(1.f){ }
|
||||||
|
|
||||||
float Width;
|
float Width;
|
||||||
@@ -6,9 +6,9 @@
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
|
|
||||||
struct Sphere : Component
|
struct SphereShape : Component
|
||||||
{
|
{
|
||||||
Sphere()
|
SphereShape()
|
||||||
: Radius(1.f){ }
|
: Radius(1.f){ }
|
||||||
|
|
||||||
float Radius;
|
float Radius;
|
||||||
+3
-7
@@ -21,7 +21,7 @@ void GameWorld::Initialize()
|
|||||||
transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f));
|
transform->Orientation = glm::quat(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
auto model = AddComponent<Components::Model>(ground, "Model");
|
auto model = AddComponent<Components::Model>(ground, "Model");
|
||||||
model->ModelFile = "Models/Placeholders/PhysicsTest/Cube.obj";
|
model->ModelFile = "Models/Placeholders/PhysicsTest/Cube.obj";
|
||||||
auto box = AddComponent<Components::Box>(ground, "Box");
|
auto box = AddComponent<Components::BoxShape>(ground, "BoxShape");
|
||||||
box->Width = 200;
|
box->Width = 200;
|
||||||
box->Height = 5;
|
box->Height = 5;
|
||||||
box->Depth = 200;
|
box->Depth = 200;
|
||||||
@@ -41,7 +41,7 @@ void GameWorld::Initialize()
|
|||||||
|
|
||||||
auto physics = AddComponent<Components::Physics>(jeep, "Physics");
|
auto physics = AddComponent<Components::Physics>(jeep, "Physics");
|
||||||
physics->Mass = 1200;
|
physics->Mass = 1200;
|
||||||
auto box = AddComponent<Components::Box>(jeep, "Box");
|
auto box = AddComponent<Components::BoxShape>(jeep, "BoxShape");
|
||||||
box->Width = 1.487f;
|
box->Width = 1.487f;
|
||||||
box->Height = 0.727f;
|
box->Height = 0.727f;
|
||||||
box->Depth = 2.594f;
|
box->Depth = 2.594f;
|
||||||
@@ -239,7 +239,7 @@ void GameWorld::Initialize()
|
|||||||
|
|
||||||
auto physics = AddComponent<Components::Physics>(cube, "Physics");
|
auto physics = AddComponent<Components::Physics>(cube, "Physics");
|
||||||
physics->Mass = 100;
|
physics->Mass = 100;
|
||||||
auto box = AddComponent<Components::Box>(cube, "Box");
|
auto box = AddComponent<Components::BoxShape>(cube, "BoxShape");
|
||||||
box->Width = 0.5f;
|
box->Width = 0.5f;
|
||||||
box->Height = 0.5f;
|
box->Height = 0.5f;
|
||||||
box->Depth = 0.5f;
|
box->Depth = 0.5f;
|
||||||
@@ -266,10 +266,6 @@ void GameWorld::RegisterComponents()
|
|||||||
{
|
{
|
||||||
m_ComponentFactory.Register("Transform", []() { return new Components::Transform(); });
|
m_ComponentFactory.Register("Transform", []() { return new Components::Transform(); });
|
||||||
m_ComponentFactory.Register("Template", []() { return new Components::Template(); });
|
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()
|
void GameWorld::RegisterSystems()
|
||||||
|
|||||||
+2
-2
@@ -27,8 +27,8 @@
|
|||||||
#include "Components/Transform.h"
|
#include "Components/Transform.h"
|
||||||
|
|
||||||
#include "Components/Physics.h"
|
#include "Components/Physics.h"
|
||||||
#include "Components/Sphere.h"
|
#include "Components/SphereShape.h"
|
||||||
#include "Components/Box.h"
|
#include "Components/BoxShape.h"
|
||||||
#include "Components/Vehicle.h"
|
#include "Components/Vehicle.h"
|
||||||
#include "Components/Wheel.h"
|
#include "Components/Wheel.h"
|
||||||
|
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ Systems::PhysicsSystem::PhysicsSystem(World* world) : System(world)
|
|||||||
void Systems::PhysicsSystem::RegisterComponents(ComponentFactory* cf)
|
void Systems::PhysicsSystem::RegisterComponents(ComponentFactory* cf)
|
||||||
{
|
{
|
||||||
cf->Register("Physics", []() { return new Components::Physics(); });
|
cf->Register("Physics", []() { return new Components::Physics(); });
|
||||||
cf->Register("Box", []() { return new Components::Box(); });
|
cf->Register("BoxShape", []() { return new Components::BoxShape(); });
|
||||||
cf->Register("Sphere", []() { return new Components::Sphere(); });
|
cf->Register("SphereShape", []() { return new Components::SphereShape(); });
|
||||||
cf->Register("Vehicle", []() { return new Components::Vehicle(); });
|
cf->Register("Vehicle", []() { return new Components::Vehicle(); });
|
||||||
cf->Register("Wheel", []() { return new Components::Wheel(); });
|
cf->Register("Wheel", []() { return new Components::Wheel(); });
|
||||||
}
|
}
|
||||||
@@ -181,8 +181,8 @@ void Systems::PhysicsSystem::OnEntityCommit( EntityID entity )
|
|||||||
if (!physicsComponent)
|
if (!physicsComponent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto sphereComponent = m_World->GetComponent<Components::Sphere >(entity, "Sphere");
|
auto sphereComponent = m_World->GetComponent<Components::SphereShape>(entity, "SphereShape");
|
||||||
auto boxComponent = m_World->GetComponent<Components::Box >(entity, "Box");
|
auto boxComponent = m_World->GetComponent<Components::BoxShape>(entity, "BoxShape");
|
||||||
|
|
||||||
|
|
||||||
hkpConvexShape* shape;
|
hkpConvexShape* shape;
|
||||||
@@ -285,8 +285,8 @@ void Systems::PhysicsSystem::SetUpPhysicsState(EntityID entity, EntityID parent)
|
|||||||
if (!physicsComponent)
|
if (!physicsComponent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto sphereComponent = m_World->GetComponent<Components::Sphere >(entity, "Sphere");
|
auto sphereComponent = m_World->GetComponent<Components::Sphere >(entity, "SphereShape");
|
||||||
auto boxComponent = m_World->GetComponent<Components::Box >(entity, "Box");
|
auto boxComponent = m_World->GetComponent<Components::Box >(entity, "BoxShape");
|
||||||
|
|
||||||
|
|
||||||
hkpConvexShape* shape;
|
hkpConvexShape* shape;
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
#include "System.h"
|
#include "System.h"
|
||||||
#include "Components/Transform.h"
|
#include "Components/Transform.h"
|
||||||
#include "Components/Physics.h"
|
#include "Components/Physics.h"
|
||||||
#include "Components/Sphere.h"
|
#include "Components/BoxShape.h"
|
||||||
#include "Components/Box.h"
|
#include "Components/SphereShape.h"
|
||||||
#include "Components/Vehicle.h"
|
#include "Components/Vehicle.h"
|
||||||
#include "Components/Input.h"
|
#include "Components/Input.h"
|
||||||
|
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
<ClInclude Include="..\..\src\Camera.h" />
|
<ClInclude Include="..\..\src\Camera.h" />
|
||||||
<ClInclude Include="..\..\src\Color.h" />
|
<ClInclude Include="..\..\src\Color.h" />
|
||||||
<ClInclude Include="..\..\src\Component.h" />
|
<ClInclude Include="..\..\src\Component.h" />
|
||||||
<ClInclude Include="..\..\src\Components\Box.h" />
|
<ClInclude Include="..\..\src\Components\BoxShape.h" />
|
||||||
<ClInclude Include="..\..\src\Components\Camera.h" />
|
<ClInclude Include="..\..\src\Components\Camera.h" />
|
||||||
<ClInclude Include="..\..\src\Components\DirectionalLight.h" />
|
<ClInclude Include="..\..\src\Components\DirectionalLight.h" />
|
||||||
<ClInclude Include="..\..\src\Components\FreeSteering.h" />
|
<ClInclude Include="..\..\src\Components\FreeSteering.h" />
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
<ClInclude Include="..\..\src\Components\Physics.h" />
|
<ClInclude Include="..\..\src\Components\Physics.h" />
|
||||||
<ClInclude Include="..\..\src\Components\PointLight.h" />
|
<ClInclude Include="..\..\src\Components\PointLight.h" />
|
||||||
<ClInclude Include="..\..\src\Components\SoundEmitter.h" />
|
<ClInclude Include="..\..\src\Components\SoundEmitter.h" />
|
||||||
<ClInclude Include="..\..\src\Components\Sphere.h" />
|
<ClInclude Include="..\..\src\Components\SphereShape.h" />
|
||||||
<ClInclude Include="..\..\src\Components\Sprite.h" />
|
<ClInclude Include="..\..\src\Components\Sprite.h" />
|
||||||
<ClInclude Include="..\..\src\Components\Template.h" />
|
<ClInclude Include="..\..\src\Components\Template.h" />
|
||||||
<ClInclude Include="..\..\src\Components\Transform.h" />
|
<ClInclude Include="..\..\src\Components\Transform.h" />
|
||||||
|
|||||||
@@ -215,12 +215,6 @@
|
|||||||
<ClInclude Include="..\..\src\Sound.h">
|
<ClInclude Include="..\..\src\Sound.h">
|
||||||
<Filter>Audio</Filter>
|
<Filter>Audio</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\Components\Box.h">
|
|
||||||
<Filter>Physics\Components</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\src\Components\Sphere.h">
|
|
||||||
<Filter>Physics\Components</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\src\Components\Vehicle.h">
|
<ClInclude Include="..\..\src\Components\Vehicle.h">
|
||||||
<Filter>Physics\Components</Filter>
|
<Filter>Physics\Components</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -230,6 +224,12 @@
|
|||||||
<ClInclude Include="..\..\src\Physics\VehicleSetup.h">
|
<ClInclude Include="..\..\src\Physics\VehicleSetup.h">
|
||||||
<Filter>Physics</Filter>
|
<Filter>Physics</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\Components\BoxShape.h">
|
||||||
|
<Filter>Physics\Components</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\Components\SphereShape.h">
|
||||||
|
<Filter>Physics\Components</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\..\src\Shaders\AABB.frag.glsl">
|
<None Include="..\..\src\Shaders\AABB.frag.glsl">
|
||||||
|
|||||||
Reference in New Issue
Block a user