28#ifndef OZZ_OZZ_ANIMATION_RUNTIME_TRACK_H_
29#define OZZ_OZZ_ANIMATION_RUNTIME_TRACK_H_
31#include "ozz/animation/runtime/export.h"
32#include "ozz/base/io/archive_traits.h"
33#include "ozz/base/maths/quaternion.h"
34#include "ozz/base/maths/vec_float.h"
35#include "ozz/base/platform.h"
36#include "ozz/base/span.h"
56template <
typename _ValueType>
59 typedef _ValueType ValueType;
69 void operator=(
Track const&) =
delete;
82 const char* name()
const {
return name_ ? name_ :
""; }
94 void Allocate(
size_t _keys_count,
size_t _name_len);
107 char* name_ =
nullptr;
111template <
typename _ValueType>
113 inline static _ValueType Lerp(
const _ValueType& _a,
const _ValueType& _b,
115 return math::Lerp(_a, _b, _alpha);
117 inline static float Distance(
const _ValueType& _a,
const _ValueType& _b) {
118 return math::Length(_a - _b);
120 inline static _ValueType identity() {
return _ValueType(0.f); }
126 return std::abs(_a - _b);
136 return math::NLerp(_a, _b, _alpha);
139inline float TrackPolicy<math::Quaternion>::Distance(
141 const float cos_half_angle =
142 _a.x * _b.x + _a.y * _b.y + _a.z * _b.z + _a.w * _b.w;
145 return 1.f - math::Min(1.f, std::abs(cos_half_angle));
148inline math::Quaternion TrackPolicy<math::Quaternion>::identity() {
149 return math::Quaternion::identity();
Definition track_builder.h:57
Definition quaternion.h:41