ClockCorrelatorΒΆ

ClockCorrelator Class Reference

The ClockCorrelator class correlates time between the Leap Motion clock and an application clock. More...

Inherits IDisposable.

Public Member Functions

 ClockCorrelator ()
 Creates a new Clock Correlation object for maintaining a latency-adjusted relationship between the Leap Motion system clock and an external clock. More...
 
Int64 ExternalClockToLeapTime (Int64 applicationClock)
 Returns the Leap Motion device time corresponding to an external time. More...
 
void UpdateRebaseEstimate (Int64 applicationClock)
 Updates the estimate of latency between render time and the Leap Motion device time. More...
 
void UpdateRebaseEstimate (Int64 applicationClock, Int64 leapClock)
 Updates the estimate of latency between render time and the Leap Motion device time. More...
 

Detailed Description

The ClockCorrelator class correlates time between the Leap Motion clock and an application clock.

Create a ClockCorrelator for each independent application clock.

Since
3.x.y

Constructor & Destructor Documentation

Creates a new Clock Correlation object for maintaining a latency-adjusted relationship between the Leap Motion system clock and an external clock.

Since
3.x.y

Member Function Documentation

Int64 ExternalClockToLeapTime ( Int64  applicationClock)

Returns the Leap Motion device time corresponding to an external time.

For this function to return meaningful results, the UpdateRebaseEstimate() function must be called for each graphics frame rendered.

Parameters
externalClockTimeThe time in milliseconds.
Returns
Int64 The latency-corrected Leap Motion device time in milliseconds corresponding to the specified external time.
Since
3.x.z
void UpdateRebaseEstimate ( Int64  applicationClock)

Updates the estimate of latency between render time and the Leap Motion device time.

Call this function when a frame is rendered. Uses the leap clock time at the moment this function is called.

Parameters
externalClockTimeThe time in milliseconds when the graphics frame is rendered.
Since
3.x.z
void UpdateRebaseEstimate ( Int64  applicationClock,
Int64  leapClock 
)

Updates the estimate of latency between render time and the Leap Motion device time.

Call this function when a frame is rendered.

Parameters
externalClockTimeThe time in milliseconds when the graphics frame is rendered.
leapClockthe time in milliseconds obtained by calling Controller.Now().
Since
3.x.z