mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 15:38:00 +02:00
Fix arm and finger joint control in leapHands.js for desktop mode
This commit is contained in:
parent
5ecbaa5b93
commit
6736eefbc1
1 changed files with 12 additions and 21 deletions
|
@ -193,13 +193,12 @@ var leapHands = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set avatar arms vertical, forearms horizontal, as "zero" position for calibration
|
// Set avatar arms vertical, forearms horizontal, as "zero" position for calibration
|
||||||
MyAvatar.setJointData("LeftArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, -90.0));
|
MyAvatar.setJointRotation("LeftArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, 0.0));
|
||||||
MyAvatar.setJointData("LeftForeArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, 180.0));
|
MyAvatar.setJointRotation("LeftForeArm", Quat.fromPitchYawRollDegrees(0.0, 90.0, 90.0));
|
||||||
MyAvatar.setJointData("LeftHand", Quat.fromPitchYawRollRadians(0.0, 0.0, 0.0));
|
MyAvatar.setJointRotation("LeftHand", Quat.fromPitchYawRollRadians(0.0, 0.0, 0.0));
|
||||||
MyAvatar.setJointData("RightArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, 90.0));
|
MyAvatar.setJointRotation("RightArm", Quat.fromPitchYawRollDegrees(90.0,0.0, 0.0));
|
||||||
MyAvatar.setJointData("RightForeArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, 180.0));
|
MyAvatar.setJointRotation("RightForeArm", Quat.fromPitchYawRollDegrees(0.0, -90.0, -90.0));
|
||||||
MyAvatar.setJointData("RightHand", Quat.fromPitchYawRollRadians(0.0, 0.0, 0.0));
|
MyAvatar.setJointRotation("RightHand", Quat.fromPitchYawRollRadians(0.0, 0.0, 0.0));
|
||||||
|
|
||||||
|
|
||||||
// Wait for arms to assume their positions before calculating
|
// Wait for arms to assume their positions before calculating
|
||||||
Script.setTimeout(finishCalibration, CALIBRATION_TIME);
|
Script.setTimeout(finishCalibration, CALIBRATION_TIME);
|
||||||
|
@ -421,22 +420,14 @@ var leapHands = (function () {
|
||||||
|
|
||||||
// Hand rotation in camera coordinates ...
|
// Hand rotation in camera coordinates ...
|
||||||
handRotation = {
|
handRotation = {
|
||||||
x: handRotation.z,
|
x: -handRotation.x,
|
||||||
y: handRotation.y,
|
y: -handRotation.z,
|
||||||
z: handRotation.x,
|
z: -handRotation.y,
|
||||||
w: handRotation.w
|
w: handRotation.w,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Hand rotation in avatar coordinates ...
|
// Hand rotation in avatar coordinates ...
|
||||||
if (h === 0) {
|
handRotation = Quat.multiply(Quat.angleAxis(90.0, { x: 1, y: 0, z: 0 }), handRotation);
|
||||||
handRotation.x = -handRotation.x;
|
|
||||||
handRotation = Quat.multiply(Quat.angleAxis(-90.0, { x: 0, y: 1, z: 0 }),
|
|
||||||
handRotation);
|
|
||||||
} else {
|
|
||||||
handRotation.z = -handRotation.z;
|
|
||||||
handRotation = Quat.multiply(Quat.angleAxis(90.0, { x: 0, y: 1, z: 0 }),
|
|
||||||
handRotation);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set hand position and orientation ...
|
// Set hand position and orientation ...
|
||||||
|
@ -462,7 +453,7 @@ var leapHands = (function () {
|
||||||
w: locRotation.w
|
w: locRotation.w
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
MyAvatar.setJointData(fingers[h][i][j].jointName, locRotation);
|
MyAvatar.setJointRotation(fingers[h][i][j].jointName, locRotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue