Add hand roll, pitch, and yaw

This commit is contained in:
David Rowe 2014-09-14 15:25:02 -07:00
parent 3ddd5854cd
commit 1527c40e1d

View file

@ -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.