leapjs-plugins
leapjs-plugins copied to clipboard
Work without controlling the render loop
Via @capnmidnight :
I have one comment. Work on making all of this stuff work better when the leap controller is not managing the animation frame loop. Or if it does work fine, update the documentation. I personally haven't been able to figure out how to use any of the plugins like boneHand or riggedHand because my app framework manages the loop on its own.
It looks like that there are places that would need a trivial refactor for this to work. For example, the bone hand would need an explicitly exposed "render" method, which would call the onHand, etc. https://github.com/leapmotion/leapjs-plugins/blob/master/main/bone-hand/leap.bone-hand.coffee#L475
Found an example of this, here: https://developer.leapmotion.com/gallery/vr-quickstart
However, still leaving this issue open. Although that example does indeed work, it is possible or perhaps even easy to introduce a frame of lag. As the onHand
method moves the hand, and is triggered by the hand
event, which is running on its own requestAnimationFrame
loop. If the Leap Controller is not initialized prior to the app's, a frame of delay could be introduced. (CC @capnmidnight )
OK, thanks. This example worked well, but yes, I did notice the lag.