Tanoda
Leap.Unity.DeltaFloatBuffer Class Reference

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...

Inheritance diagram for Leap.Unity.DeltaFloatBuffer:
Leap.Unity.DeltaBuffer< float, float > Leap.Unity.DeltaBuffer< Vector3, Vector3 >

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...
 
- Public Member Functions inherited from Leap.Unity.DeltaBuffer< float, float >
 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 ()
 
- Public Member Functions inherited from Leap.Unity.DeltaBuffer< Vector3, Vector3 >
 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

- Protected Attributes inherited from Leap.Unity.DeltaBuffer< float, float >
RingBuffer< ValueTimePair > _buffer
 
- Protected Attributes inherited from Leap.Unity.DeltaBuffer< Vector3, Vector3 >
RingBuffer< ValueTimePair > _buffer
 
- Properties inherited from Leap.Unity.DeltaBuffer< float, float >
int Count [get]
 
bool IsFull [get]
 
bool IsEmpty [get]
 
int Capacity [get]
 
SampleType this[int idx] [get]
 
- Properties inherited from Leap.Unity.DeltaBuffer< Vector3, Vector3 >
int Count [get]
 
bool IsFull [get]
 
bool IsEmpty [get]
 
int Capacity [get]
 
SampleType this[int idx] [get]
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DeltaFloatBuffer()

Leap.Unity.DeltaFloatBuffer.DeltaFloatBuffer ( int  bufferSize)

Definition at line 142 of file DeltaBuffer.cs.

Member Function Documentation

◆ Delta()

override float Leap.Unity.DeltaFloatBuffer.Delta ( )
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.


The documentation for this class was generated from the following file: