Tanoda
Leap.Unity.DeltaQuaternionBuffer Class Reference

A ring buffer of Quaternions with a Delta() function that computes the buffer's average change over time as an angle-axis vector. Returns Vector3.zero if the buffer contains one or fewer samples. More...

Inheritance diagram for Leap.Unity.DeltaQuaternionBuffer:
Leap.Unity.DeltaBuffer< Quaternion, Vector3 > Leap.Unity.DeltaBuffer< Vector3, Vector3 >

Public Member Functions

 DeltaQuaternionBuffer (int bufferSize)
 
override Vector3 Delta ()
 Returns the average angular velocity of Quaternions in the buffer as an angle-axis vector, or zero if the buffer is empty. More...
 
- Public Member Functions inherited from Leap.Unity.DeltaBuffer< Quaternion, 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 ()
 
- 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< Quaternion, Vector3 >
RingBuffer< ValueTimePair > _buffer
 
- Protected Attributes inherited from Leap.Unity.DeltaBuffer< Vector3, Vector3 >
RingBuffer< ValueTimePair > _buffer
 
- Properties inherited from Leap.Unity.DeltaBuffer< Quaternion, Vector3 >
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 Quaternions with a Delta() function that computes the buffer's average change over time as an angle-axis vector. Returns Vector3.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 168 of file DeltaBuffer.cs.

Constructor & Destructor Documentation

◆ DeltaQuaternionBuffer()

Leap.Unity.DeltaQuaternionBuffer.DeltaQuaternionBuffer ( int  bufferSize)

Definition at line 170 of file DeltaBuffer.cs.

Member Function Documentation

◆ Delta()

override Vector3 Leap.Unity.DeltaQuaternionBuffer.Delta ( )
virtual

Returns the average angular velocity of Quaternions in the buffer as an angle-axis vector, or zero if the buffer is empty.

Implements Leap.Unity.DeltaBuffer< Quaternion, Vector3 >.

Definition at line 176 of file DeltaBuffer.cs.


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