Add rstl::binary_find

Including CAnimData::GetBoundingBox
This commit is contained in:
Henrique Gemignani Passos Lima
2022-12-05 23:35:31 +02:00
parent 960b828260
commit e4a864880b
19 changed files with 232 additions and 87 deletions

View File

@@ -0,0 +1,22 @@
#include "MetroidPrime/CAnimData.hpp"
#include "Kyoto/Animation/CAnimTreeNode.hpp"
#include "rstl/algorithm.hpp"
CAABox CAnimData::GetBoundingBox() const {
const rstl::vector< rstl::pair< rstl::string, CAABox > >& aabbList =
xc_charInfo.GetAnimBBoxList();
if (aabbList.size() > 0) {
CAnimTreeEffectiveContribution contrib = x1f8_animRoot->GetContributionOfHighestInfluence();
rstl::string name = contrib.GetPrimitiveName();
rstl::vector< rstl::pair< rstl::string, CAABox > >::const_iterator search =
rstl::find_by_key(aabbList, rstl::string(name));
if (search != aabbList.end()) {
return search->second;
}
}
return x108_aabb;
}