AABBs are auto attached when adding Trigger/Collideable/etc, also added AttachComponent method to ComponentWrapper.

This commit is contained in:
William Moberg
2016-02-08 14:34:37 +01:00
parent 11cf85cc73
commit 93c6f3c0a3
7 changed files with 42 additions and 27 deletions
+2
View File
@@ -78,6 +78,8 @@ bool AABBVsAABB(const AABB& a, const AABB& b);
//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);
//Attaches an AABB which contains all vertices in the entitys Model.
bool AttachAABBComponentFromModel(EntityWrapper entity);
// Calculates an absolute AABB from an entity AABB component
boost::optional<EntityAABB> EntityAbsoluteAABB(EntityWrapper& entity);
+1
View File
@@ -25,6 +25,7 @@ struct EntityWrapper
const std::string Name();
bool HasComponent(const std::string& componentType);
void AttachComponent(const char* componentName);
EntityWrapper Parent();
EntityWrapper FirstChildByName(const std::string& name);
EntityWrapper FirstParentWithComponent(const std::string& componentType);