ClockCorrelatorΒΆ

class Leap::ClockCorrelator

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

Public Functions

ClockCorrelator()

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

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.

Return
Int64 The latency-corrected Leap Motion device time in milliseconds corresponding to the specified external time.
Since
3.x.z
Parameters
  • externalClockTime -

    The time in milliseconds.

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.

Since
3.x.z
Parameters
  • externalClockTime -

    The time in milliseconds when the graphics frame is rendered.

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.

Since
3.x.z
Parameters
  • externalClockTime -

    The time in milliseconds when the graphics frame is rendered.

  • leapClock -

    the time in milliseconds obtained by calling Controller.Now().