mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Make recalibrate Leap-on-desk if avatar head or skeleton changes
This commit is contained in:
parent
38b6d5dd5d
commit
51f229af57
1 changed files with 8 additions and 2 deletions
|
@ -33,6 +33,8 @@ var leapHands = (function () {
|
|||
PI = 3.141593,
|
||||
isWindows,
|
||||
avatarScale,
|
||||
avatarFaceModelURL,
|
||||
avatarSkeletonModelURL,
|
||||
settingsTimer;
|
||||
|
||||
function printSkeletonJointNames() {
|
||||
|
@ -168,6 +170,8 @@ var leapHands = (function () {
|
|||
calibrationStatus = CALIBRATING;
|
||||
|
||||
avatarScale = MyAvatar.scale;
|
||||
avatarFaceModelURL = MyAvatar.faceModelURL;
|
||||
avatarSkeletonModelURL = MyAvatar.skeletonModelURL;
|
||||
|
||||
// Set avatar arms vertical, forearms horizontal, as "zero" position for calibration
|
||||
MyAvatar.setJointData("LeftArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, -90.0));
|
||||
|
@ -212,8 +216,10 @@ var leapHands = (function () {
|
|||
|
||||
function checkSettings() {
|
||||
// There is no "scale changed" event so we need check periodically.
|
||||
if (!isOnHMD && calibrationStatus && MyAvatar.scale !== avatarScale) {
|
||||
print("Leap Motion: Recalibrate because avatar scale changed");
|
||||
if (!isOnHMD && calibrationStatus > UNCALIBRATED && (MyAvatar.scale !== avatarScale
|
||||
|| MyAvatar.faceModelURL !== avatarFaceModelURL
|
||||
|| MyAvatar.skeletonModelURL !== avatarSkeletonModelURL)) {
|
||||
print("Leap Motion: Recalibrate because avatar body or scale changed");
|
||||
calibrationStatus = UNCALIBRATED;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue