Removed unused components
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
#ifndef Components_Bounds_h__
|
|
||||||
#define Components_Bounds_h__
|
|
||||||
|
|
||||||
#include "Component.h"
|
|
||||||
|
|
||||||
namespace Components
|
|
||||||
{
|
|
||||||
|
|
||||||
struct Bounds : Component
|
|
||||||
{
|
|
||||||
//Axis Aligned Bounding Box
|
|
||||||
glm::vec3 Origin;
|
|
||||||
glm::vec3 VolumeVector; //The vector that defines the volume of the BB, it goes from one corner to the opposite one
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif // !Components_Bounds_h__
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#ifndef Components_Collision_h__
|
|
||||||
#define Components_Collision_h__
|
|
||||||
|
|
||||||
#include "Entity.h"
|
|
||||||
#include "Component.h"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace Components
|
|
||||||
{
|
|
||||||
|
|
||||||
struct Collision : Component
|
|
||||||
{
|
|
||||||
Collision() : Phantom(false), Interested(false) { }
|
|
||||||
|
|
||||||
bool Phantom;
|
|
||||||
bool Interested;
|
|
||||||
std::vector<EntityID> CollidingEntities;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif // !Components_Collision_h__
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#ifndef Components_PowerUp_h__
|
|
||||||
#define Components_PowerUp_h__
|
|
||||||
|
|
||||||
#include "Component.h"
|
|
||||||
|
|
||||||
namespace Components
|
|
||||||
{
|
|
||||||
|
|
||||||
struct PowerUp : Component
|
|
||||||
{
|
|
||||||
float Speed;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif // !Components_PowerUp_h__
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#ifndef Components_Stat_h__
|
|
||||||
#define Components_Stat_h__
|
|
||||||
|
|
||||||
#include "Component.h"
|
|
||||||
|
|
||||||
namespace Components
|
|
||||||
{
|
|
||||||
|
|
||||||
struct Stat : Component
|
|
||||||
{
|
|
||||||
float Health;
|
|
||||||
bool Destroyable;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif // !Components_Stat_h__
|
|
||||||
@@ -113,9 +113,7 @@ void GameWorld::Update(double dt)
|
|||||||
|
|
||||||
void GameWorld::RegisterComponents()
|
void GameWorld::RegisterComponents()
|
||||||
{
|
{
|
||||||
m_ComponentFactory.Register("Bounds", []() { return new Components::Bounds(); });
|
|
||||||
m_ComponentFactory.Register("Camera", []() { return new Components::Camera(); });
|
m_ComponentFactory.Register("Camera", []() { return new Components::Camera(); });
|
||||||
m_ComponentFactory.Register("Collision", []() { return new Components::Collision(); });
|
|
||||||
m_ComponentFactory.Register("DirectionalLight", []() { return new Components::DirectionalLight(); });
|
m_ComponentFactory.Register("DirectionalLight", []() { return new Components::DirectionalLight(); });
|
||||||
m_ComponentFactory.Register("Input", []() { return new Components::Input(); });
|
m_ComponentFactory.Register("Input", []() { return new Components::Input(); });
|
||||||
m_ComponentFactory.Register("Model", []() { return new Components::Model(); });
|
m_ComponentFactory.Register("Model", []() { return new Components::Model(); });
|
||||||
|
|||||||
@@ -15,18 +15,14 @@
|
|||||||
#include "Systems/SoundSystem.h"
|
#include "Systems/SoundSystem.h"
|
||||||
#include "Systems/PhysicsSystem.h"
|
#include "Systems/PhysicsSystem.h"
|
||||||
|
|
||||||
#include "Components/Bounds.h"
|
|
||||||
#include "Components/Camera.h"
|
#include "Components/Camera.h"
|
||||||
#include "Components/Collision.h"
|
|
||||||
#include "Components/DirectionalLight.h"
|
#include "Components/DirectionalLight.h"
|
||||||
#include "Components/Input.h"
|
#include "Components/Input.h"
|
||||||
#include "Components/Model.h"
|
#include "Components/Model.h"
|
||||||
#include "Components/ParticleEmitter.h"
|
#include "Components/ParticleEmitter.h"
|
||||||
#include "Components/PointLight.h"
|
#include "Components/PointLight.h"
|
||||||
#include "Components/PowerUp.h"
|
|
||||||
#include "Components/SoundEmitter.h"
|
#include "Components/SoundEmitter.h"
|
||||||
#include "Components/Sprite.h"
|
#include "Components/Sprite.h"
|
||||||
#include "Components/Stat.h"
|
|
||||||
#include "Components/Template.h"
|
#include "Components/Template.h"
|
||||||
#include "Components/Transform.h"
|
#include "Components/Transform.h"
|
||||||
|
|
||||||
|
|||||||
@@ -32,18 +32,6 @@ void Systems::RenderSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
|
|||||||
m_Renderer->AddModelToDraw(model, position, orientation, scale, modelComponent->Visible, modelComponent->ShadowCaster);
|
m_Renderer->AddModelToDraw(model, position, orientation, scale, modelComponent->Visible, modelComponent->ShadowCaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug draw bounds
|
|
||||||
#ifdef DEBUG
|
|
||||||
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 volumeVector = transformComponent->Scale * bounds->VolumeVector;
|
|
||||||
m_Renderer->AddAABBToDraw(origin, volumeVector, (collision != nullptr && collision->CollidingEntities.size() > 0));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
auto pointLightComponent = m_World->GetComponent<Components::PointLight>(entity, "PointLight");
|
auto pointLightComponent = m_World->GetComponent<Components::PointLight>(entity, "PointLight");
|
||||||
if (pointLightComponent != nullptr)
|
if (pointLightComponent != nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
#include "Components/Model.h"
|
#include "Components/Model.h"
|
||||||
#include "Components/Transform.h"
|
#include "Components/Transform.h"
|
||||||
#include "Components/Camera.h"
|
#include "Components/Camera.h"
|
||||||
#include "Components/Bounds.h"
|
|
||||||
#include "Components/Collision.h"
|
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
|
|
||||||
namespace Systems
|
namespace Systems
|
||||||
|
|||||||
Reference in New Issue
Block a user