FORCEINLINE void BlendCurves(const TArray<const FBlendedCurve*>& SourceCurves, const TArray<float>& SourceWeights, FBlendedCurve& OutCurve) { if(SourceCurves.Num() > 0) { OutCurve.Override(*SourceCurves[0], SourceWeights[0]); for(int32 CurveIndex=1; CurveIndex<SourceCurves.Num(); ++CurveIndex) { OutCurve.Accumulate(*SourceCurves[CurveIndex], SourceWeights[CurveIndex]); } } }
void FAnimationRuntime::AccumulateAdditivePose(FCompactPose& BasePose, const FCompactPose& AdditivePose, FBlendedCurve& BaseCurve, const FBlendedCurve& AdditiveCurve, float Weight, enum EAdditiveAnimationType AdditiveType) { if (AdditiveType == AAT_RotationOffsetMeshSpace) { AccumulateMeshSpaceRotationAdditiveToLocalPose(BasePose, AdditivePose, BaseCurve, AdditiveCurve, Weight); } else { AccumulateLocalSpaceAdditivePose(BasePose, AdditivePose, BaseCurve, AdditiveCurve, Weight); } // if curve exists, accumulate with the weight, BaseCurve.Accumulate(AdditiveCurve, Weight); // normalize BasePose.NormalizeRotations(); }