leapmotion / leapjs

JavaScript client for the Leap Motion Controller
https://developer.leapmotion.com/leapjs
Apache License 2.0
2k stars 445 forks source link

isFlapped #189

Open ktansai opened 9 years ago

ktansai commented 9 years ago

Hi. I want to use API that notice whether Leap motion tracking in flapped image or not . This is same as isFlipped in C++ , Unity/C# , Java , Obj-C.

pehrlich commented 9 years ago

Just checked with our tracking team - it looks like the feature is on a deprecation track, to be removed soon from the other APIs. May I ask what you're hoping to use the feature for?

ktansai commented 9 years ago

When I use Leap motion attached on HMDs, I can't recognize whether hands coming from up or down and left or right in "auto flip tracking mode". If you have any ideas that recognize absolute position & direction of hands instead , it do for me , too.

jo3w4rd commented 9 years ago

isFlipped was never actually implemented in the native APIs either -- it always returns false. There's actually no way for the Leap Motion sensor to know whether hands are coming in from one side or the other (since the device can be mounted either way). It doesn't contain any sensors that would tell it this. In auto-rotate mode, the software assumes are coming into view from the "normal" direction -- in desktop mode that will be from the user toward the device -- in HMD mode that will be from below the device reaching upward. The software will flip the z-axis to make this assumption true. However, until the hands first appear, the orientation is in an unknown state, so we can't really say whether the orientation is "flipped" or not "flipped." In short, the coordinates of the hand will always be correct for the normal situation. If the user has contorted themselves to put their hands above their head and then down into the field of view, then the auto-orientation result will be incorrect. If you need this behavior, you will have to turn off the auto-orientation feature and provide a way for the user to manually flip the orientation if they have mounted the device upside down.