From 1527c40e1daf5322b22e521d8d6baa6b5213027e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 14 Sep 2014 15:25:02 -0700 Subject: [PATCH] Add hand roll, pitch, and yaw --- examples/leapHands.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/leapHands.js b/examples/leapHands.js index 64d6708cc0..db4988dcc4 100644 --- a/examples/leapHands.js +++ b/examples/leapHands.js @@ -236,8 +236,18 @@ var leapHands = (function () { handRoll = handRoll + PI / 2.0; } - // Hand position ... - MyAvatar.setJointModelPositionAndOrientation(hands[h].jointName, handOffset); + // Hand position and orientation ... + if (h === 0) { + MyAvatar.setJointModelPositionAndOrientation(hands[h].jointName, handOffset, Quat.fromPitchYawRollRadians( + handPitch, + -PI / 2.0 - handYaw, + handRoll), true); + } else { + MyAvatar.setJointModelPositionAndOrientation(hands[h].jointName, handOffset, Quat.fromPitchYawRollRadians( + handPitch, + PI / 2.0 - handYaw, + handRoll), true); + } // Finger joints ... // TODO: 2.0 * scale factors should not be necessary; Leap Motion controller code needs investigating.