diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 04e9920a0a..35e8dbcd56 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -929,7 +929,7 @@ glm::quat Avatar::getAbsoluteJointRotationInObjectFrame(int index) const { } case CAMERA_MATRIX_INDEX: { glm::quat rotation; - if (_skeletonModel) { + if (_skeletonModel && _skeletonModel->isActive()) { int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex; if (headJointIndex >= 0) { _skeletonModel->getAbsoluteJointRotationInRigFrame(headJointIndex, rotation); @@ -965,7 +965,7 @@ glm::vec3 Avatar::getAbsoluteJointTranslationInObjectFrame(int index) const { } case CAMERA_MATRIX_INDEX: { glm::vec3 translation; - if (_skeletonModel) { + if (_skeletonModel && _skeletonModel->isActive()) { int headJointIndex = _skeletonModel->getFBXGeometry().headJointIndex; if (headJointIndex >= 0) { _skeletonModel->getAbsoluteJointTranslationInRigFrame(headJointIndex, translation); diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index d2f39f93de..a0ac0566d9 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -737,6 +737,7 @@ function MyController(hand) { this.autoUnequipCounter = 0; this.grabPointIntersectsEntity = false; this.stylus = null; + this.homeButtonTouched = false; // Until there is some reliable way to keep track of a "stack" of parentIDs, we'll have problems // when more than one avatar does parenting grabs on things. This script tries to work @@ -1178,13 +1179,13 @@ function MyController(hand) { this.showStylus(); var rayPickInfo = this.calcRayPickInfo(this.hand); if (rayPickInfo.distance < WEB_STYLUS_LENGTH / 2.0 + WEB_TOUCH_Y_OFFSET) { + this.handleStylusOnHomeButton(rayPickInfo); if (this.handleStylusOnWebEntity(rayPickInfo)) { return; } if (this.handleStylusOnWebOverlay(rayPickInfo)) { return; } - this.handleStylusOnHomeButton(rayPickInfo); } } else { this.hideStylus(); @@ -1246,8 +1247,16 @@ function MyController(hand) { var entity = rayPickInfo.entityID; var name = entityPropertiesCache.getProps(entity).name; if (name == "homeButton") { - Messages.sendLocalMessage("home", entity); + if (this.homeButtonTouched == false) { + this.homeButtonTouched = true; + Controller.triggerHapticPulse(1, 20, this.hand); + Messages.sendLocalMessage("home", entity); + } + } else { + this.homeButtonTouched = false; } + } else { + this.homeButtonTouched = false; } }; @@ -1679,7 +1688,6 @@ function MyController(hand) { }; this.handleStylusOnWebEntity = function (rayPickInfo) { - Controller.triggerHapticPulse(1, 20, this.hand); var pointerEvent; if (rayPickInfo.entityID && Entities.wantsHandControllerPointerEvents(rayPickInfo.entityID)) {