From 260d27f4d7e3039473f9acb8475f12c9cccbd056 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 2 Feb 2016 14:31:20 -0800 Subject: [PATCH] increase drop-on-joint radius. fix bug that kept from dropping on hips (index 0). save adjustments if in dressing room --- examples/attachedEntitiesManager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/attachedEntitiesManager.js b/examples/attachedEntitiesManager.js index 01f8f861c9..4d3235667c 100644 --- a/examples/attachedEntitiesManager.js +++ b/examples/attachedEntitiesManager.js @@ -18,7 +18,7 @@ var DEFAULT_WEARABLE_DATA = { }; -var MINIMUM_DROP_DISTANCE_FROM_JOINT = 0.4; +var MINIMUM_DROP_DISTANCE_FROM_JOINT = 0.8; var ATTACHED_ENTITY_SEARCH_DISTANCE = 10.0; var ATTACHED_ENTITIES_SETTINGS_KEY = "ATTACHED_ENTITIES"; var DRESSING_ROOM_DISTANCE = 2.0; @@ -154,7 +154,7 @@ function AttachedEntitiesManager() { continue; } var jointIndex = MyAvatar.getJointIndex(jointName); - if (jointIndex > 0) { + if (jointIndex >= 0) { var jointPosition = MyAvatar.getJointPosition(jointIndex); var distanceFromJoint = Vec3.distance(jointPosition, props.position); if (distanceFromJoint <= MINIMUM_DROP_DISTANCE_FROM_JOINT) { @@ -175,7 +175,9 @@ function AttachedEntitiesManager() { }; if (bestJointOffset && bestJointOffset.constructor === Array && bestJointOffset.length > 1) { - if (!this.avatarIsInDressingRoom()) { + if (this.avatarIsInDressingRoom()) { + this.updateRelativeOffsets(grabbedEntity); + } else { // don't snap the entity to the preferred position if the avatar is in the dressing room. wearProps.localPosition = bestJointOffset[0]; wearProps.localRotation = bestJointOffset[1];