Go to the documentation of this file.
19 return tracks.emplace(
id,
VariantTrack{
id}).first->second;
25 return tracks.emplace(
id,
VariantTrack{id, updateFunc}).first->second;
31 (*this)[id].addKeyframe(keyframe);
43 for (
auto& it : tracks)
45 it.second.update(time, ignoreEmptyTracks);
56 catch (
const std::out_of_range&)
69 catch (
const std::out_of_range&)
78 os <<
"Trajectory with " << trajectory.tracks.size() <<
" tracks: ";
79 for (
const auto& [name, track] : trajectory.tracks)
81 os <<
"\n - " << track;
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.