Tanoda
|
A ring buffer of floats with a Delta() function that computes the buffer's average change over time. Delta() will return zero if the buffer contains one or fewer samples. More...
Public Member Functions | |
DeltaFloatBuffer (int bufferSize) | |
override float | Delta () |
Returns the average change between each sample per unit time, or zero if the buffer is empty. More... | |
![]() | |
DeltaBuffer (int bufferSize) | |
DeltaBuffer (int bufferSize) | |
void | Clear () |
void | Add (SampleType sample, float sampleTime) |
SampleType | Get (int idx) |
SampleType | GetLatest () |
void | Set (int idx, SampleType sample, float sampleTime) |
void | SetLatest (SampleType sample, float sampleTime) |
float | GetTime (int idx) |
float | GetLatestTime () |
abstract DerivativeType | Delta () |
Returns the average change between each sample per unit time. More... | |
override Vector3 | Delta () |
Returns the average change between each sample per unit time, or zero if the buffer contains one or fewer elements. More... | |
IndexableEnumerator< SampleType > | GetEnumerator () |
![]() | |
DeltaBuffer (int bufferSize) | |
DeltaBuffer (int bufferSize) | |
void | Clear () |
void | Add (SampleType sample, float sampleTime) |
SampleType | Get (int idx) |
SampleType | GetLatest () |
void | Set (int idx, SampleType sample, float sampleTime) |
void | SetLatest (SampleType sample, float sampleTime) |
float | GetTime (int idx) |
float | GetLatestTime () |
abstract DerivativeType | Delta () |
Returns the average change between each sample per unit time. More... | |
override Vector3 | Delta () |
Returns the average change between each sample per unit time, or zero if the buffer contains one or fewer elements. More... | |
IndexableEnumerator< SampleType > | GetEnumerator () |
Additional Inherited Members | |
![]() | |
RingBuffer< ValueTimePair > | _buffer |
![]() | |
RingBuffer< ValueTimePair > | _buffer |
![]() | |
int | Count [get] |
bool | IsFull [get] |
bool | IsEmpty [get] |
int | Capacity [get] |
SampleType | this[int idx] [get] |
![]() | |
int | Count [get] |
bool | IsFull [get] |
bool | IsEmpty [get] |
int | Capacity [get] |
SampleType | this[int idx] [get] |
A ring buffer of floats with a Delta() function that computes the buffer's average change over time. Delta() will return zero if the buffer contains one or fewer samples.
The larger the buffer, the more stable but also delayed the resulting average change over time. A buffer size of 5 is a good start for 60-90 Hz updates.
Definition at line 140 of file DeltaBuffer.cs.
Leap.Unity.DeltaFloatBuffer.DeltaFloatBuffer | ( | int | bufferSize | ) |
Definition at line 142 of file DeltaBuffer.cs.
|
virtual |
Returns the average change between each sample per unit time, or zero if the buffer is empty.
Implements Leap.Unity.DeltaBuffer< float, float >.
Definition at line 148 of file DeltaBuffer.cs.