mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-15 19:48:47 +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,
|
PI = 3.141593,
|
||||||
isWindows,
|
isWindows,
|
||||||
avatarScale,
|
avatarScale,
|
||||||
|
avatarFaceModelURL,
|
||||||
|
avatarSkeletonModelURL,
|
||||||
settingsTimer;
|
settingsTimer;
|
||||||
|
|
||||||
function printSkeletonJointNames() {
|
function printSkeletonJointNames() {
|
||||||
|
@ -168,6 +170,8 @@ var leapHands = (function () {
|
||||||
calibrationStatus = CALIBRATING;
|
calibrationStatus = CALIBRATING;
|
||||||
|
|
||||||
avatarScale = MyAvatar.scale;
|
avatarScale = MyAvatar.scale;
|
||||||
|
avatarFaceModelURL = MyAvatar.faceModelURL;
|
||||||
|
avatarSkeletonModelURL = MyAvatar.skeletonModelURL;
|
||||||
|
|
||||||
// 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.setJointData("LeftArm", Quat.fromPitchYawRollDegrees(90.0, 0.0, -90.0));
|
||||||
|
@ -212,8 +216,10 @@ var leapHands = (function () {
|
||||||
|
|
||||||
function checkSettings() {
|
function checkSettings() {
|
||||||
// There is no "scale changed" event so we need check periodically.
|
// There is no "scale changed" event so we need check periodically.
|
||||||
if (!isOnHMD && calibrationStatus && MyAvatar.scale !== avatarScale) {
|
if (!isOnHMD && calibrationStatus > UNCALIBRATED && (MyAvatar.scale !== avatarScale
|
||||||
print("Leap Motion: Recalibrate because avatar scale changed");
|
|| MyAvatar.faceModelURL !== avatarFaceModelURL
|
||||||
|
|| MyAvatar.skeletonModelURL !== avatarSkeletonModelURL)) {
|
||||||
|
print("Leap Motion: Recalibrate because avatar body or scale changed");
|
||||||
calibrationStatus = UNCALIBRATED;
|
calibrationStatus = UNCALIBRATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue