2020-01-15 12:07:48 +00:00
|
|
|
#include "Runtime/Character/CMetaAnimBlend.hpp"
|
|
|
|
|
|
|
|
#include "Runtime/Character/CAnimTreeBlend.hpp"
|
|
|
|
#include "Runtime/Character/CMetaAnimFactory.hpp"
|
2016-04-10 21:22:59 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2016-04-10 21:22:59 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CMetaAnimBlend::CMetaAnimBlend(CInputStream& in) {
|
|
|
|
x4_animA = CMetaAnimFactory::CreateMetaAnim(in);
|
|
|
|
x8_animB = CMetaAnimFactory::CreateMetaAnim(in);
|
|
|
|
xc_blend = in.readFloatBig();
|
|
|
|
x10_ = in.readBool();
|
2016-04-10 21:22:59 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void CMetaAnimBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) const {
|
|
|
|
x4_animA->GetUniquePrimitives(primsOut);
|
|
|
|
x4_animA->GetUniquePrimitives(primsOut);
|
2016-04-10 21:22:59 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
std::shared_ptr<CAnimTreeNode> CMetaAnimBlend::VGetAnimationTree(const CAnimSysContext& animSys,
|
|
|
|
const CMetaAnimTreeBuildOrders& orders) const {
|
2019-03-09 08:58:27 +00:00
|
|
|
CMetaAnimTreeBuildOrders oa = CMetaAnimTreeBuildOrders::NoSpecialOrders();
|
2021-06-07 19:29:18 +00:00
|
|
|
CMetaAnimTreeBuildOrders ob = orders.x0_recursiveAdvance
|
|
|
|
? CMetaAnimTreeBuildOrders::PreAdvanceForAll(*orders.x0_recursiveAdvance)
|
|
|
|
: CMetaAnimTreeBuildOrders::NoSpecialOrders();
|
2019-03-09 08:58:27 +00:00
|
|
|
auto a = x4_animA->GetAnimationTree(animSys, oa);
|
|
|
|
auto b = x8_animB->GetAnimationTree(animSys, ob);
|
2021-06-07 19:29:18 +00:00
|
|
|
return std::make_shared<CAnimTreeBlend>(x10_, a, b, xc_blend, CAnimTreeBlend::CreatePrimitiveName(a, b, xc_blend));
|
2016-04-10 21:22:59 +00:00
|
|
|
}
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|