From 1acfe017e1ff2d4c9fe7fd7982ba7e2159106ee9 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 15 Sep 2016 17:12:35 -0700 Subject: [PATCH 1/4] Make the equip sphere emissive maybe this will make it visible in low ambient light situations? --- scripts/system/controllers/handControllerGrab.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 734ef9e6eb..284599eb4d 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -634,6 +634,7 @@ EquipHotspotBuddy.prototype.updateHotspot = function(hotspot, timestamp) { dimensions: diameter * EQUIP_SPHERE_SCALE_FACTOR, color: EQUIP_SPHERE_COLOR, alpha: EQUIP_SPHERE_ALPHA, + emissive: true, solid: true, visible: true, ignoreRayIntersection: true, From 2ddd46f30b167497fa416604335362ce3514c07c Mon Sep 17 00:00:00 2001 From: David Kelly Date: Fri, 16 Sep 2016 10:56:59 -0700 Subject: [PATCH 2/4] Switch to the cool looking model instead --- .../system/controllers/handControllerGrab.js | 57 ++++++------------- 1 file changed, 18 insertions(+), 39 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 284599eb4d..ba999a5515 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -205,6 +205,8 @@ var CONTROLLER_STATE_MACHINE = {}; var mostRecentSearchingHand = RIGHT_HAND; +var DEFAULT_SPHERE_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/equip-Fresnel-3.fbx"; + CONTROLLER_STATE_MACHINE[STATE_OFF] = { name: "off", enterMethod: "offEnter", @@ -602,47 +604,24 @@ EquipHotspotBuddy.prototype.updateHotspot = function(hotspot, timestamp) { targetSize: 1, overlays: [] }; - + var diameter = hotspot.radius * 2; - if (hotspot.modelURL) { - // override default sphere with a user specified model - overlayInfoSet.overlays.push(Overlays.addOverlay("model", { - url: hotspot.modelURL, - position: hotspot.worldPosition, - rotation: { - x: 0, - y: 0, - z: 0, - w: 1 - }, - dimensions: diameter * EQUIP_SPHERE_SCALE_FACTOR, - scale: hotspot.modelScale, - ignoreRayIntersection: true - })); - overlayInfoSet.type = "model"; - } else { - // default sphere overlay - overlayInfoSet.overlays.push(Overlays.addOverlay("sphere", { - position: hotspot.worldPosition, - rotation: { - x: 0, - y: 0, - z: 0, - w: 1 - }, - dimensions: diameter * EQUIP_SPHERE_SCALE_FACTOR, - color: EQUIP_SPHERE_COLOR, - alpha: EQUIP_SPHERE_ALPHA, - emissive: true, - solid: true, - visible: true, - ignoreRayIntersection: true, - drawInFront: false - })); - overlayInfoSet.type = "sphere"; - } - + // override default sphere with a user specified model, if it exists. + overlayInfoSet.overlays.push(Overlays.addOverlay("model", { + url: hotspot.modelURL ? hotspot.modelURL : DEFAULT_SPHERE_MODEL_URL, + position: hotspot.worldPosition, + rotation: { + x: 0, + y: 0, + z: 0, + w: 1 + }, + dimensions: diameter * EQUIP_SPHERE_SCALE_FACTOR, + scale: hotspot.modelScale, + ignoreRayIntersection: true + })); + overlayInfoSet.type = "model"; this.map[hotspot.key] = overlayInfoSet; } else { overlayInfoSet.timestamp = timestamp; From ade17e6456841acbf113ec5e7929814cfd34e943 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Fri, 16 Sep 2016 14:15:14 -0700 Subject: [PATCH 3/4] PR feedback --- scripts/system/controllers/handControllerGrab.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index ba999a5515..09b5ff74d1 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -56,12 +56,6 @@ var HAND_HEAD_MIX_RATIO = 0.0; // 0 = only use hands for search/move. 1 = only var PICK_WITH_HAND_RAY = true; -var EQUIP_SPHERE_COLOR = { - red: 116, - green: 90, - blue: 238 -}; -var EQUIP_SPHERE_ALPHA = 0.15; var EQUIP_SPHERE_SCALE_FACTOR = 0.65; @@ -604,7 +598,7 @@ EquipHotspotBuddy.prototype.updateHotspot = function(hotspot, timestamp) { targetSize: 1, overlays: [] }; - + var diameter = hotspot.radius * 2; // override default sphere with a user specified model, if it exists. From 22d80914e2d69614a72904c47720af26e4e32486 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Fri, 16 Sep 2016 14:17:44 -0700 Subject: [PATCH 4/4] whitespace --- scripts/system/controllers/handControllerGrab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index 09b5ff74d1..1fb6595aa5 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -598,7 +598,7 @@ EquipHotspotBuddy.prototype.updateHotspot = function(hotspot, timestamp) { targetSize: 1, overlays: [] }; - + var diameter = hotspot.radius * 2; // override default sphere with a user specified model, if it exists.