MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / Lerp

Method Lerp

modules/tools/animation_tool/src/track_optimizer.cc:67–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 _KeyFrame Lerp(const _KeyFrame& _left, const _KeyFrame& _right,
68 const _KeyFrame& _ref) const {
69 SKR_ASSERT(Decimable(_ref));
70 const float alpha =
71 (_ref.ratio - _left.ratio) / (_right.ratio - _left.ratio);
72 SKR_ASSERT(alpha >= 0.f && alpha <= 1.f);
73 const _KeyFrame key = {_ref.interpolation, _ref.ratio,
74 Policy::Lerp(_left.value, _right.value, alpha)};
75 return key;
76 }
77
78 float Distance(const _KeyFrame& _a, const _KeyFrame& _b) const {
79 return Policy::Distance(_a.value, _b.value);

Callers 1

DecimateFunction · 0.45

Calls 1

LerpFunction · 0.50

Tested by

no test coverage detected