leapmotion / LeapMotionCoreAssets

Unity Assets for Leap Motion v2 Skeletal Tracking
Apache License 2.0
166 stars 81 forks source link

Fixed Update Timeline Synchronization #117

Closed Amarcolina closed 9 years ago

Amarcolina commented 9 years ago

The FixedUpdate timeline is distorted relative to the LeapTimeline. This is especially apparent in situations where the physics framerate is higher than the update framerate. I have added a method GetFixedFrame() which returns a frame accounting for the timeline distortion/offset, which reduces jitter and improves smoothness.

This is difficult to verify without some sort of visualization, so it might be a good idea to pop over to my desk and I can show you how I use the Squiggle utility in HandyTools to verify it is working.

@yuwilbur @GabrielHare @RandomOutput

GabrielHare commented 9 years ago

As discussed: please expand the comments and include images output by squiggle to explain why this method should work.

Amarcolina commented 9 years ago

Expanded the comment for GetFixedFrame to include an explenation of how unity treats its FixedUpdate, and how GetFixedFrame solves the issue. Also made Update and FixedUpdate virtual, as well as changed constants to use scientific notation.