mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 09:47:43 +00:00
Various bug fixes
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "CMetaAnimPhaseBlend.hpp"
|
||||
#include "CMetaAnimFactory.hpp"
|
||||
#include "CAnimTreeTimeScale.hpp"
|
||||
#include "CAnimTreeBlend.hpp"
|
||||
|
||||
namespace urde {
|
||||
|
||||
@@ -17,7 +19,24 @@ void CMetaAnimPhaseBlend::GetUniquePrimitives(std::set<CPrimitive>& primsOut) co
|
||||
|
||||
std::shared_ptr<CAnimTreeNode> CMetaAnimPhaseBlend::VGetAnimationTree(const CAnimSysContext& animSys,
|
||||
const CMetaAnimTreeBuildOrders& orders) const {
|
||||
return {};
|
||||
if (orders.x0_recursiveAdvance)
|
||||
return GetAnimationTree(animSys, CMetaAnimTreeBuildOrders::PreAdvanceForAll(*orders.x0_recursiveAdvance));
|
||||
|
||||
auto a = x4_animA->GetAnimationTree(animSys, CMetaAnimTreeBuildOrders::NoSpecialOrders());
|
||||
auto b = x8_animB->GetAnimationTree(animSys, CMetaAnimTreeBuildOrders::NoSpecialOrders());
|
||||
auto da = a->GetContributionOfHighestInfluence().GetSteadyStateAnimInfo().GetDuration();
|
||||
auto db = b->GetContributionOfHighestInfluence().GetSteadyStateAnimInfo().GetDuration();
|
||||
auto dblend = da + (db - da) * xc_blend;
|
||||
float fa = da / dblend;
|
||||
float fb = db / dblend;
|
||||
|
||||
auto tsa = std::make_shared<CAnimTreeTimeScale>(a, fa,
|
||||
CAnimTreeTimeScale::CreatePrimitiveName(a, fa, CCharAnimTime::Infinity(), -1.f));
|
||||
auto tsb = std::make_shared<CAnimTreeTimeScale>(b, fb,
|
||||
CAnimTreeTimeScale::CreatePrimitiveName(b, fb, CCharAnimTime::Infinity(), -1.f));
|
||||
|
||||
return std::make_shared<CAnimTreeBlend>(x10_, tsa, tsb, xc_blend,
|
||||
CAnimTreeBlend::CreatePrimitiveName(tsa, tsb, xc_blend));
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user