template class MAGES::Recorder::ContinuousPlaybackObject¶
Overview¶
A group of continuous playback objects. More…
templateclass ContinuousPlaybackObject { public: // structs struct Sample; // properties int Count; // methods ContinuousPlaybackObject(System.Func interpolate); void AddSampleInTime(T value, double time); bool TryAddSampleInTime(T value, double time, Predicate sameSamplePredicate); bool RemoveSampleInTime(double time, Predicate sameSamplePredicate); T Update(double nowTime); static ContinuousPlaybackObject CreateVector3(); static ContinuousPlaybackObject CreateQuaternion(); };
Detailed Documentation¶
A group of continuous playback objects.
Parameters:
T |
The value type that will be played back. |
Properties¶
int Count
Gets the amount of samples currently stored.
Methods¶
ContinuousPlaybackObject(System.Funcinterpolate)
Initializes a new instance of the ContinuousPlaybackObject<T> class.
Parameters:
interpolate |
The function used to interpolate between two values given a 0-1 double. |
void AddSampleInTime(T value, double time)
Adds a sample in time.
Parameters:
value |
The value. |
time |
The time at which this value has to match the calculated value. |
bool TryAddSampleInTime(T value, double time, PredicatesameSamplePredicate)
Adds a sample in time if no matching sample already exists at that same timestamp.
Parameters:
value |
The value. |
time |
The time at which this value has to match the calculated value. |
sameSamplePredicate |
Predicate used to identify duplicates for values at the same timestamp. |
Returns:
True when the sample was added, false when it already existed.
bool RemoveSampleInTime(double time, PredicatesameSamplePredicate)
Removes a sample at a given timestamp.
Parameters:
time |
The sample timestamp. |
sameSamplePredicate |
Predicate used to identify the sample. |
Returns:
True when a sample was removed, false otherwise.
T Update(double nowTime)
Updates the playback object.
Parameters:
nowTime |
The position of the play cursor. |
Returns:
The updated value of the object.
static ContinuousPlaybackObjectCreateVector3()
Creates a new continuous playback object for Vector3 values.
Returns:
The new instatnce of the object.
static ContinuousPlaybackObjectCreateQuaternion()
Creates a new continuous playback object for Quaternion values.
Returns:
The new instance of the object.