Work-around for right hand roll on Windows is no longer needed

This commit is contained in:
David Rowe 2014-10-07 14:50:29 -07:00
parent 8084c5c77d
commit 373d2f0532

View file

@ -31,7 +31,6 @@ var leapHands = (function () {
CALIBRATED = 2,
CALIBRATION_TIME = 1000, // milliseconds
PI = 3.141593,
isWindows,
avatarScale,
avatarFaceModelURL,
avatarSkeletonModelURL,
@ -132,9 +131,6 @@ var leapHands = (function () {
if (hands[0].controller.isActive() && hands[1].controller.isActive()) {
leapHandHeight = (hands[0].controller.getAbsTranslation().y + hands[1].controller.getAbsTranslation().y) / 2.0;
// TODO: Temporary detection of Windows to work around Leap Controller problem.
isWindows = (hands[1].controller.getAbsRotation().z > (0.25 * PI));
} else {
calibrationStatus = UNCALIBRATED;
return;
@ -398,12 +394,6 @@ var leapHands = (function () {
handPitch = 2.0 * -wristAbsRotation.x;
handYaw = 2.0 * wristAbsRotation.y;
// TODO: Leap Motion controller's right-hand roll calculation only works if physical hand is upside down.
// Approximate fix is to add a fudge factor.
if (h === 1 && isWindows) {
handRoll = handRoll + 0.6 * PI;
}
// Hand position and orientation ...
if (h === 0) {
handRotation = Quat.multiply(Quat.angleAxis(-90.0, { x: 0, y: 1, z: 0 }),