leapmotion / LeapMotionCoreAssets

Unity Assets for Leap Motion v2 Skeletal Tracking
Apache License 2.0
166 stars 81 forks source link

RiggedFinger script uses GetBoneCenter erroneously #143

Open jo3w4rd opened 8 years ago

jo3w4rd commented 8 years ago

When FingerModel.deformPosition is set to true, the RiggedFinger script gets the bone center position and moves the bone to this position. This is incorrect since bones pivot around their proximal joint (Bone.prevJoint), not the center point between two joints.

The GetBoneCenter() function is used in non-rigged hand scripts as well, so a new function will be needed to correct this problem.

An easy way to observe the problem is to set deformPosition to true on one of the standard rigged hand prefabs. Using the GetBoneCenter() function, the hands are webbed and arthritic. Replacing bone center with the previous joint position makes things look much better.