Made CollisionSystem aware of entities

This commit is contained in:
2016-01-27 15:42:50 +01:00
parent 181017313d
commit 788407b709
7 changed files with 22 additions and 56 deletions
-1
View File
@@ -59,7 +59,6 @@ bool AABBVsAABB(const AABB& a, const AABB& b);
//Return true if the boxes are intersecting.
//Also outputs the minimum translation that box [a] would need in order to resolve collision.
bool AABBVsAABB(const AABB& a, const AABB& b, glm::vec3& minimumTranslation);
bool IsSameBoxProbably(const AABB& first, const AABB& second, const float epsilon = 0.0001f);
// Calculates an absolute AABB from an entity AABB component
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity);
+2 -10
View File
@@ -7,7 +7,6 @@
#include "../Common.h"
#include "../Core/System.h"
#include "../Core/EventBroker.h"
#include "../Core/EKeyUp.h"
#include "../Core/Octree.h"
#include "EntityAABB.h"
@@ -18,20 +17,13 @@ public:
: System(world, eventBroker)
, PureSystem("Collidable")
, m_Octree(octree)
, zPress(false)
{
//TODO: Debug stuff, remove later.
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &CollisionSystem::OnKeyUp);
}
{ }
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override;
private:
Octree<EntityAABB>* m_Octree;
bool zPress;
EventRelay<CollisionSystem, Events::KeyUp> m_EKeyUp;
bool OnKeyUp(const Events::KeyUp &event);
std::vector<EntityAABB> m_OctreeResult;
};
#endif