17 #ifndef GZ_COMMON_ANIMATION_HH_
18 #define GZ_COMMON_ANIMATION_HH_
24 #include <gz/math/Pose3.hh>
25 #include <gz/math/Spline.hh>
26 #include <gz/math/RotationSpline.hh>
28 #include <gz/utils/ImplPtr.hh>
30 #include <gz/common/graphics/Export.hh>
38 class NumericKeyFrame;
50 const double _length,
const bool _loop);
54 public:
double Length()
const;
58 public:
void Length(
const double _len);
62 public:
void Time(
const double _time);
66 public:
void AddTime(
const double _time);
70 public:
double Time()
const;
74 public:
bool InterpolateX()
const;
78 public:
void SetInterpolateX(
const bool _interpolateX);
82 public:
unsigned int KeyFrameCount()
const;
92 protected:
template<
typename KeyFrameType>
93 KeyFrameType *CreateKeyFrame(
const double _time);
101 protected:
double KeyFramesAtTime(
104 unsigned int &_firstKeyIndex)
const;
107 GZ_UTILS_IMPL_PTR(dataPtr)
123 const double _length,
const bool _loop,
124 double _tension = 0.0);
129 public:
PoseKeyFrame *CreateKeyFrame(
const double _time);
138 protected:
void InterpolatedKeyFrame(
const double _time,
142 protected:
void BuildInterpolationSplines();
145 GZ_UTILS_IMPL_PTR(dataPtr)
156 const double _length,
const bool _loop);
169 GZ_UTILS_IMPL_PTR(dataPtr)
181 public:
unsigned int Id()
const;
185 public:
void SetId(
unsigned int _id);
189 public:
unsigned int AnimIndex()
const;
194 public:
void SetAnimIndex(
unsigned int _index);
198 public: std::chrono::steady_clock::duration Duration()
const;
203 public:
double DistanceSoFar(
204 const std::chrono::steady_clock::duration &_time)
const;
208 public: std::chrono::steady_clock::time_point StartTime()
const;
212 public:
void SetStartTime(
213 const std::chrono::steady_clock::time_point &_startTime);
217 public: std::chrono::steady_clock::time_point EndTime()
const;
221 public:
void SetEndTime(
222 const std::chrono::steady_clock::time_point &_endTime);
226 public:
bool Translated()
const;
230 public:
void SetTranslated(
bool _translated);
244 public:
void SetWaypoints(
246 _waypoints,
double _tension = 0.0);
249 GZ_UTILS_IMPL_PTR(dataPtr)