| 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); |