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
+9
View File
@@ -16,6 +16,15 @@ bool EntityWrapper::HasComponent(const std::string& componentName)
return World->HasComponent(ID, componentName);
}
void EntityWrapper::AttachComponent(const char* componentName)
{
if (!Valid()) {
LOG_WARNING("Could not attach \"%s\" component to #%i, component is not valid.", componentName, ID);
return;
}
World->AttachComponent(ID, componentName);
}
EntityWrapper EntityWrapper::Parent()
{
if (this->World == nullptr || this->ID == EntityID_Invalid) {