Conflicts:
	Escape-the-Dawn/Systems/CollisionSystem.cpp
This commit is contained in:
Tleety
2015-06-01 23:30:05 +02:00
5 changed files with 83 additions and 54 deletions
+4 -4
View File
@@ -69,12 +69,12 @@ void Systems::CollisionSystem::Intersects(EntityID aEntity, EntityID bEntity)
if(bCollisionComponent == nullptr)
return;
auto transformSystem = m_World->GetSystem<Systems::TransformSystem>("TransformSystem");
auto aBounds = m_World->GetComponent<Components::Bounds>(aEntity, "Bounds");
auto bBounds = m_World->GetComponent<Components::Bounds>(bEntity, "Bounds");
glm::vec3 aPos = aTransform->Position + (aBounds->Origin * aTransform->Scale);
glm::vec3 bPos = bTransform->Position + (bBounds->Origin * bTransform->Scale);
glm::vec3 aPos = transformSystem->AbsolutePosition(aEntity) + (aBounds->Origin * aTransform->Scale);
glm::vec3 bPos = transformSystem->AbsolutePosition(bEntity) + (bBounds->Origin * bTransform->Scale);
glm::vec3 aMax = aPos + aBounds->VolumeVector * aTransform->Scale;
glm::vec3 aMin = aPos - aBounds->VolumeVector * aTransform->Scale;
@@ -118,7 +118,7 @@ void Systems::CollisionSystem::CreateBoundingBox(std::shared_ptr<Components::Bou
GLushort elements[] = {
0, 1, 2, 3,
4, 5, 6, 7,
0, 4, 1, 5,
0, 4, 1, 5,
2, 6, 3, 7
};
GLuint ibo_elements;