heuermh / leap-motion-processing

Leap Motion library for Processing
GNU General Public License v3.0
122 stars 31 forks source link

Request: HMD Policy Flag support? #11

Closed WIL993 closed 9 years ago

WIL993 commented 9 years ago

Hi, Sorry this was the only way I could see of contacting you! I am working with your library, which is fantastic, one feature I would really like though and which I cannot access is the optimize HMD policy flag. To help with top down detection. If you could add this or point me in the direction of enabling it that would be amazing! Thanks, Will will.vivid.vibe@gmail.com

heuermh commented 9 years ago

The LeapMotion API you're looking for would be Controller.policyFlags() and Controller.setPolicyFlags(Controller.PolicyFlags).

I'm not certain the best place to make this call, perhaps in onConnect in your sketch

void onConnect(final Controller controller)
{
  controller.setPolicyFlags(Controller.PolicyFlag.POLICY_OPTIMIZE_HMD);
}
WIL993 commented 9 years ago

I tried using the above code in a previous version of your library before the weekend however got the error: Could not find anything named "Controller.PolicyFlag.POLICY_OPTIMIZE_HMD".

(however the BACKGROUND FRAMES policy did work)

I will try again now because it is very possible with the update you have made to the recent SDK version that this feature may well be accessible.

WIL993 commented 9 years ago

Hi, I have just tested using latest library version with latest SDK and still have the same issue, error of: Could not find anything named "Controller.PolicyFlag.POLICY_OPTIMIZE_HMD"

heuermh commented 9 years ago

Hmm, thanks. I added a new example here

https://github.com/heuermh/leap-motion-processing/blob/master/examples/leap_hmd_policy_flag/leap_hmd_policy_flag.pde

and cut a new version 1.20 release. The example should work with version 1.20.

WIL993 commented 9 years ago

Thanks, I deleted the library to reinstall and am now having issues with "Error in contribution file on line 1" when opening library manager so cannot re-add the library, will report back when I get this resolved!

heuermh commented 9 years ago

Can't say I know what that means. I'll send you a direct download link via email.

WIL993 commented 9 years ago

Thank you very much for your help, this is now working for me!

heuermh commented 9 years ago

Great, thanks!