diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 6241f6b20e..8f54e3b62e 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -26,7 +26,7 @@ var WANT_DEBUG = false; var WANT_DEBUG_STATE = false; var WANT_DEBUG_SEARCH_NAME = null; -var FORCE_IGNORE_IK = true; +var FORCE_IGNORE_IK = false; var SHOW_GRAB_POINT_SPHERE = true; // @@ -1382,10 +1382,11 @@ function MyController(hand) { this.chooseBestEquipHotspot = function(candidateEntities) { var DISTANCE = 0; var equippableHotspots = this.chooseNearEquipHotspots(candidateEntities, DISTANCE); + var _this = this; if (equippableHotspots.length > 0) { // sort by distance equippableHotspots.sort(function(a, b) { - var handControllerLocation = getControllerWorldLocation(this.handToController(), true); + var handControllerLocation = getControllerWorldLocation(_this.handToController(), true); var aDistance = Vec3.distance(a.worldPosition, handControllerLocation.position); var bDistance = Vec3.distance(b.worldPosition, handControllerLocation.position); return aDistance - bDistance; @@ -1896,7 +1897,7 @@ function MyController(hand) { if (FORCE_IGNORE_IK) { this.ignoreIK = true; } else { - this.ignoreIK = grabbableData.ignoreIK ? grabbableData.ignoreIK : false; + this.ignoreIK = (grabbableData.ignoreIK !== undefined) ? grabbableData.ignoreIK : true; } var handRotation; diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 67aa8bdb13..0bcae7f409 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -830,7 +830,7 @@ function loaded() { elGrabbable.checked = properties.dynamic; elWantsTrigger.checked = false; - elIgnoreIK.checked = false; + elIgnoreIK.checked = true; var parsedUserData = {} try { parsedUserData = JSON.parse(properties.userData); @@ -1143,7 +1143,7 @@ function loaded() { userDataChanger("grabbableKey", "wantsTrigger", elWantsTrigger, elUserData, false); }); elIgnoreIK.addEventListener('change', function() { - userDataChanger("grabbableKey", "ignoreIK", elIgnoreIK, elUserData, false); + userDataChanger("grabbableKey", "ignoreIK", elIgnoreIK, elUserData, true); }); elCollisionSoundURL.addEventListener('change', createEmitTextPropertyUpdateFunction('collisionSoundURL')); @@ -1596,4 +1596,4 @@ function loaded() { document.addEventListener("contextmenu", function(event) { event.preventDefault(); }, false); -} \ No newline at end of file +}