Removed AnimationOffset and improved BlendTree

This commit is contained in:
viktorljung
2016-02-29 15:51:37 +01:00
parent 5c3b472a4d
commit 5bc0483f49
10 changed files with 847 additions and 459 deletions
+25
View File
@@ -39,6 +39,31 @@ EntityWrapper EntityWrapper::FirstChildByName(const std::string& name)
return firstChildByNameRecursive(name, this->ID);
}
EntityWrapper EntityWrapper::FirstLevelChildByName(const std::string& name)
{
EntityID parent = this->ID;
if (!this->World->ValidEntity(parent)) {
return EntityWrapper::Invalid;
}
auto itPair = this->World->GetChildren(parent);
if (itPair.first == itPair.second) {
return EntityWrapper::Invalid;
}
for (auto it = itPair.first; it != itPair.second; ++it) {
std::string itName = this->World->GetName(it->second);
if (itName == name) {
return EntityWrapper(this->World, it->second);
} else if (it->second != EntityID_Invalid) {
continue;
}
}
return EntityWrapper::Invalid;
}
EntityWrapper EntityWrapper::FirstParentWithComponent(const std::string& componentType)
{
EntityWrapper entity = *this;