MarcKamm
MarcKamm

Reputation: 27

Unity & Leap Motion - How to get live hand data?

Sorry if this is a dumb question, but I searched the Leap Motion Docs for Unity and couldnt figure out how to solve my problem.

I just want to access the current hands (and their data, like PalmNormal et cetera) detected by the leap motion controller from a script I added to my scene.

Thanks in advance!

Upvotes: 0

Views: 767

Answers (1)

Dimitri
Dimitri

Reputation: 119

I took a quick look and maybe this is the class you are looking for? https://leapmotion.github.io/UnityModules/class_leap_1_1_hand.html
For example you want the PalmPosition

Hand currentHand = new Hand();
currentHand.PalmPosition;

here's everything it contains


Hand    (   long    frameID,
int     id,
float   confidence,
float   grabStrength,
float   grabAngle,
float   pinchStrength,
float   pinchDistance,
float   palmWidth,
bool    isLeft,
float   timeVisible,
Arm     arm,
List< Finger >  fingers,
Vector  palmPosition,
Vector  stabilizedPalmPosition,
Vector  palmVelocity,
Vector  palmNormal,
LeapQuaternion  palmOrientation,
Vector  direction,
Vector  wristPosition 
)   

Upvotes: 1

Related Questions