Merge pull request #11933 from druiz17/fix-far-to-equip

fix far grab to equip transition
This commit is contained in:
Seth Alves 2017-12-08 07:04:54 -08:00 committed by GitHub
commit dfbd6bcd8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@
getControllerJointIndex, enableDispatcherModule, disableDispatcherModule, getControllerJointIndex, enableDispatcherModule, disableDispatcherModule,
Messages, makeDispatcherModuleParameters, makeRunningValues, Settings, entityHasActions, Messages, makeDispatcherModuleParameters, makeRunningValues, Settings, entityHasActions,
Vec3, Overlays, flatten, Xform, getControllerWorldLocation, ensureDynamic, entityIsCloneable, Vec3, Overlays, flatten, Xform, getControllerWorldLocation, ensureDynamic, entityIsCloneable,
cloneEntity, DISPATCHER_PROPERTIES cloneEntity, DISPATCHER_PROPERTIES, TEAR_AWAY_DISTANCE
*/ */
Script.include("/~/system/libraries/Xform.js"); Script.include("/~/system/libraries/Xform.js");
@ -138,9 +138,9 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
var dimensions; var dimensions;
if (overlayInfoSet.type === "sphere") { if (overlayInfoSet.type === "sphere") {
dimensions = overlayInfoSet.hotspot.radius * 2 * overlayInfoSet.currentSize * EQUIP_SPHERE_SCALE_FACTOR; dimensions = (overlayInfoSet.hotspot.radius / 2) * overlayInfoSet.currentSize * EQUIP_SPHERE_SCALE_FACTOR;
} else { } else {
dimensions = overlayInfoSet.hotspot.radius * 2 * overlayInfoSet.currentSize; dimensions = (overlayInfoSet.hotspot.radius / 2) * overlayInfoSet.currentSize;
} }
overlayInfoSet.overlays.forEach(function(overlay) { overlayInfoSet.overlays.forEach(function(overlay) {
@ -162,7 +162,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
var ATTACH_POINT_SETTINGS = "io.highfidelity.attachPoints"; var ATTACH_POINT_SETTINGS = "io.highfidelity.attachPoints";
var EQUIP_RADIUS = 0.2; // radius used for palm vs equip-hotspot for equipping. var EQUIP_RADIUS = 1.0; // radius used for palm vs equip-hotspot for equipping.
var HAPTIC_PULSE_STRENGTH = 1.0; var HAPTIC_PULSE_STRENGTH = 1.0;
var HAPTIC_PULSE_DURATION = 13.0; var HAPTIC_PULSE_DURATION = 13.0;
@ -322,7 +322,9 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
} }
} else { } else {
var wearableProps = getWearableData(props); var wearableProps = getWearableData(props);
var sensorToScaleFactor = MyAvatar.sensorToWorldScale;
if (wearableProps && wearableProps.joints) { if (wearableProps && wearableProps.joints) {
result.push({ result.push({
key: entityID.toString() + "0", key: entityID.toString() + "0",
entityID: entityID, entityID: entityID,
@ -332,7 +334,7 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
z: 0 z: 0
}, },
worldPosition: entityXform.pos, worldPosition: entityXform.pos,
radius: EQUIP_RADIUS, radius: EQUIP_RADIUS * sensorToScaleFactor,
joints: wearableProps.joints, joints: wearableProps.joints,
modelURL: null, modelURL: null,
modelScale: null modelScale: null