Go to the documentation of this file.
17 return tracks.emplace(
id,
VariantTrack {
id}).first->second;
22 return tracks.emplace(
id,
VariantTrack {id, updateFunc}).first->second;
27 (*this)[id].addKeyframe(keyframe);
37 for (
auto& it : tracks)
39 it.second.update(time, ignoreEmptyTracks);
49 catch (
const std::out_of_range&)
61 catch (
const std::out_of_range&)
69 os <<
"Trajectory with " << trajectory.tracks.size() <<
" tracks: ";
70 for (
const auto& [name, track] : trajectory.tracks)
72 os <<
"\n - " << track;
85 func(std::get<float>(
value));
93 func(std::get<Eigen::MatrixXf>(
value));
101 func(std::get<Eigen::Quaternionf>(
value));
std::variant< float, Eigen::MatrixXf, Eigen::Quaternionf > VariantValue
Variant for trajectory values.
A keyframe, representing a value at a given time.
A track represents the timeline of a single value, identified by a track ID.
VariantTrack & operator[](const TrackID &id)
Get the track with the given ID.
std::string TrackID
ID of tracks.
void update(float time, bool ignoreEmptyTracks=false)
Update all tracks for the given time.
VariantTrack::UpdateFunc toUpdateFunc(std::function< void(float)> func)
Wrap the function in a Track::UpdateFunc.
std::function< void(ValueT)> UpdateFunc
The update function type.
VariantTrack & addTrack(const TrackID &id)
Add track with the given ID (and no update function).
std::shared_ptr< Value > value()
This class is used to update entities based on trajectory defined by keyframes.
std::ostream & operator<<(std::ostream &os, const Track< ValueT > &track)
void clear()
Clear the trajectory of all tracks.
This file offers overloads of toIce() and fromIce() functions for STL container types.
void addKeyframe(const TrackID &id, const VariantKeyframe &keyframe)
Add a keyframe to the specified track.