Hi folks,
I've been learning Unity and how to integrate Leap Motion. I've got a basic demo working, a block that hovers between two hands. My question is what's the best practice way to detect the hands?
I'm currently using
public HandController HC;
HandModel[] HMList;
HMList = HC.GetAllPhysicsHands();
for (int i=0; i<HMList.Length; i++){
if (HMList [i].GetLeapHand().IsLeft)
LeftPos = HMList [i].GetPalmPosition();
} else {
.....etc for right...
}
}
But I see there's another way using...
Frame f = HC.GetFrame ();
HandList HL = f.Hands;
for i ... {
if (HL [i].IsLeft) {
Vector PP = HL [i].PalmPosition;
LeftPos = PP.ToUnityScaled();
} else {
....etc for right...
}
}
The GetPalmPosition() scale works better than ToUnityScaled() which still needs rescaling. Which method is prefered? Is one better for performance? Reliability?