[Case 6491] Minor: Fixes some paren spacing.

Changes Committed:
	modified:   scripts/system/libraries/entitySelectionTool.js
This commit is contained in:
LaShonda Hopper 2017-09-13 16:59:21 -04:00
parent f427b5ba3f
commit ff051db79a

View file

@ -1095,14 +1095,14 @@ SelectionDisplay = (function() {
// are treated as separate values. // are treated as separate values.
// @return: bool - Indicates if the activeTool is that queried. // @return: bool - Indicates if the activeTool is that queried.
function isActiveTool(toolHandle) { function isActiveTool(toolHandle) {
if ( ! toolHandle ) { if (!toolHandle) {
// Allow isActiveTool( null ) and similar to return true if there's // Allow isActiveTool(null) and similar to return true if there's
// no active tool // no active tool
return ( activeTool === toolHandle ); return (activeTool === toolHandle);
} }
if ( ! grabberTools.hasOwnProperty( toolHandle ) ) { if (!grabberTools.hasOwnProperty(toolHandle)) {
print("WARNING: entitySelectionTool.isActiveTool - Encountered unknown grabberToolHandle: " + toolHandle + ". Tools should be egistered via addGrabberTool." ); print("WARNING: entitySelectionTool.isActiveTool - Encountered unknown grabberToolHandle: " + toolHandle + ". Tools should be egistered via addGrabberTool.");
//--EARLY EXIT-- //--EARLY EXIT--
return false; return false;
} }
@ -1483,15 +1483,15 @@ SelectionDisplay = (function() {
isPointLight = properties.type == "Light" && !properties.isSpotlight; isPointLight = properties.type == "Light" && !properties.isSpotlight;
} }
if ( isActiveTool(yawHandle) || isActiveTool(pitchHandle) || if (isActiveTool(yawHandle) || isActiveTool(pitchHandle) ||
isActiveTool(rollHandle) || isActiveTool(selectionBox) || isActiveTool(grabberCloner)) { isActiveTool(rollHandle) || isActiveTool(selectionBox) || isActiveTool(grabberCloner)) {
rotationOverlaysVisible = true; rotationOverlaysVisible = true;
rotateHandlesVisible = false; rotateHandlesVisible = false;
//translateHandlesVisible = false; //translateHandlesVisible = false;
//selectionBoxVisible = false; //selectionBoxVisible = false;
} else if ( isActiveTool(grabberMoveUp) || isPointLight) { } else if (isActiveTool(grabberMoveUp) || isPointLight) {
rotateHandlesVisible = false; rotateHandlesVisible = false;
} else if ( activeTool ) { } else if (activeTool) {
// every other mode is a stretch mode... // every other mode is a stretch mode...
rotateHandlesVisible = false; rotateHandlesVisible = false;
//translateHandlesVisible = false; //translateHandlesVisible = false;
@ -1594,12 +1594,12 @@ SelectionDisplay = (function() {
return; return;
} }
if (wantDebug) { if (wantDebug) {
print( "PreToggle: " + spaceMode); print("PreToggle: " + spaceMode);
} }
spaceMode = spaceMode == SPACE_LOCAL ? SPACE_WORLD : SPACE_LOCAL; spaceMode = spaceMode == SPACE_LOCAL ? SPACE_WORLD : SPACE_LOCAL;
that.updateHandles(); that.updateHandles();
if (wantDebug) { if (wantDebug) {
print( "PostToggle: " + spaceMode); print("PostToggle: " + spaceMode);
print("======== ToggleSpaceMode called. <========="); print("======== ToggleSpaceMode called. <=========");
} }
}; };
@ -1612,17 +1612,17 @@ SelectionDisplay = (function() {
that.updateHandles = function() { that.updateHandles = function() {
var wantDebug = false; var wantDebug = false;
if (wantDebug) { if (wantDebug) {
print( "======> Update Handles =======" ); print("======> Update Handles =======");
print( " Selections Count: " + SelectionManager.selections.length ); print(" Selections Count: " + SelectionManager.selections.length);
print( " SpaceMode: " + spaceMode ); print(" SpaceMode: " + spaceMode);
print( " DisplayMode: " + getMode() ); print(" DisplayMode: " + getMode());
} }
if (SelectionManager.selections.length === 0) { if (SelectionManager.selections.length === 0) {
that.setOverlaysVisible(false); that.setOverlaysVisible(false);
return; return;
} }
//print( " Triggering updateRotationHandles"); //print(" Triggering updateRotationHandles");
that.updateRotationHandles(); that.updateRotationHandles();
var rotation, dimensions, position, registrationPoint; var rotation, dimensions, position, registrationPoint;
@ -1863,7 +1863,7 @@ SelectionDisplay = (function() {
if (isSingleSelection) { if (isSingleSelection) {
var properties = Entities.getEntityProperties(selectionManager.selections[0]); var properties = Entities.getEntityProperties(selectionManager.selections[0]);
var isLightSelection = (properties.type == "Light"); var isLightSelection = (properties.type == "Light");
if ( isLightSelection ) { if (isLightSelection) {
if (wantDebug) { if (wantDebug) {
print(" Light Selection revoking Non-Light Grabbers Visibility!"); print(" Light Selection revoking Non-Light Grabbers Visibility!");
} }
@ -1871,10 +1871,10 @@ SelectionDisplay = (function() {
extendedStretchHandlesVisible = false; extendedStretchHandlesVisible = false;
cloneHandleVisible = false; cloneHandleVisible = false;
if (properties.isSpotlight) { if (properties.isSpotlight) {
that.setPointLightHandlesVisible( false ); that.setPointLightHandlesVisible(false);
var distance = (properties.dimensions.z / 2) * Math.sin(properties.cutoff * (Math.PI / 180)); var distance = (properties.dimensions.z / 2) * Math.sin(properties.cutoff * (Math.PI / 180));
var showEdgeSpotGrabbers = ! (inModeTranslate || inModeRotate); var showEdgeSpotGrabbers = !(inModeTranslate || inModeRotate);
Overlays.editOverlay(grabberSpotLightCenter, { Overlays.editOverlay(grabberSpotLightCenter, {
position: position, position: position,
visible: false, visible: false,
@ -1939,9 +1939,9 @@ SelectionDisplay = (function() {
}); });
} else { //..it's a PointLight } else { //..it's a PointLight
that.setSpotLightHandlesVisible( false ); that.setSpotLightHandlesVisible(false);
var showEdgePointGrabbers = ! inModeTranslate; var showEdgePointGrabbers = !inModeTranslate;
Overlays.editOverlay(grabberPointLightT, { Overlays.editOverlay(grabberPointLightT, {
position: TOP, position: TOP,
rotation: rotation, rotation: rotation,
@ -2004,8 +2004,8 @@ SelectionDisplay = (function() {
}); });
} }
} else { //..it's not a light at all } else { //..it's not a light at all
that.setSpotLightHandlesVisible( false ); that.setSpotLightHandlesVisible(false);
that.setPointLightHandlesVisible( false ); that.setPointLightHandlesVisible(false);
} }
}//--end of isSingleSelection }//--end of isSingleSelection
@ -2229,7 +2229,7 @@ SelectionDisplay = (function() {
z: position.z z: position.z
}; };
Overlays.editOverlay(grabberMoveUp, { Overlays.editOverlay(grabberMoveUp, {
visible: ( ! activeTool ) || isActiveTool(grabberMoveUp) visible: (!activeTool) || isActiveTool(grabberMoveUp)
}); });
Overlays.editOverlay(baseOfEntityProjectionOverlay, { Overlays.editOverlay(baseOfEntityProjectionOverlay, {
@ -2248,12 +2248,12 @@ SelectionDisplay = (function() {
}); });
if (wantDebug) { if (wantDebug) {
print( "====== Update Handles <=======" ); print("====== Update Handles <=======");
} }
}; };
function helperSetOverlaysVisibility( handleArray, isVisible ) { function helperSetOverlaysVisibility(handleArray, isVisible) {
var numHandles = handleArray.length; var numHandles = handleArray.length;
var visibilityUpdate = { visible: isVisible }; var visibilityUpdate = { visible: isVisible };
for (var handleIndex = 0; handleIndex < numHandles; ++handleIndex) { for (var handleIndex = 0; handleIndex < numHandles; ++handleIndex) {
@ -2263,8 +2263,8 @@ SelectionDisplay = (function() {
// FUNCTION: SET OVERLAYS VISIBLE // FUNCTION: SET OVERLAYS VISIBLE
that.setOverlaysVisible = function(isVisible) { that.setOverlaysVisible = function(isVisible) {
helperSetOverlaysVisibility( allOverlays, isVisible ); helperSetOverlaysVisibility(allOverlays, isVisible);
helperSetOverlaysVisibility( selectionBoxes, isVisible ); helperSetOverlaysVisibility(selectionBoxes, isVisible);
}; };
// FUNCTION: SET ROTATION HANDLES VISIBLE // FUNCTION: SET ROTATION HANDLES VISIBLE
@ -2277,7 +2277,7 @@ SelectionDisplay = (function() {
// FUNCTION: SET STRETCH HANDLES VISIBLE // FUNCTION: SET STRETCH HANDLES VISIBLE
that.setStretchHandlesVisible = function(isVisible) { that.setStretchHandlesVisible = function(isVisible) {
helperSetOverlaysVisibility( stretchHandles, isVisible ); helperSetOverlaysVisibility(stretchHandles, isVisible);
}; };
// FUNCTION: SET GRABBER MOVE UP VISIBLE // FUNCTION: SET GRABBER MOVE UP VISIBLE
@ -2288,24 +2288,24 @@ SelectionDisplay = (function() {
// FUNCTION: SET GRABBER TOOLS UP VISIBLE // FUNCTION: SET GRABBER TOOLS UP VISIBLE
that.setGrabberToolsVisible = function(isVisible) { that.setGrabberToolsVisible = function(isVisible) {
var visibilityUpdate = { visible: isVisible }; var visibilityUpdate = { visible: isVisible };
for ( var toolKey in grabberTools ) { for (var toolKey in grabberTools) {
if ( ! grabberTools.hasOwnProperty( toolKey ) ) { if (!grabberTools.hasOwnProperty(toolKey)) {
//--EARLY ITERATION EXIT--( On to the next one ) //--EARLY ITERATION EXIT--(On to the next one)
continue; continue;
} }
Overlays.editOverlay( toolKey, visibilityUpdate ); Overlays.editOverlay(toolKey, visibilityUpdate);
} }
}; };
// FUNCTION: SET POINT LIGHT HANDLES VISIBLE // FUNCTION: SET POINT LIGHT HANDLES VISIBLE
that.setPointLightHandlesVisible = function(isVisible) { that.setPointLightHandlesVisible = function(isVisible) {
helperSetOverlaysVisibility( pointLightGrabberHandles, isVisible ); helperSetOverlaysVisibility(pointLightGrabberHandles, isVisible);
}; };
// FUNCTION: SET SPOT LIGHT HANDLES VISIBLE // FUNCTION: SET SPOT LIGHT HANDLES VISIBLE
that.setSpotLightHandlesVisible = function(isVisible) { that.setSpotLightHandlesVisible = function(isVisible) {
helperSetOverlaysVisibility( spotLightGrabberHandles, isVisible ); helperSetOverlaysVisibility(spotLightGrabberHandles, isVisible);
}; };
// FUNCTION: UNSELECT // FUNCTION: UNSELECT
@ -2335,9 +2335,9 @@ SelectionDisplay = (function() {
} }
SelectionManager.saveProperties(); SelectionManager.saveProperties();
that.setRotationHandlesVisible( false ); that.setRotationHandlesVisible(false);
that.setStretchHandlesVisible( false ); that.setStretchHandlesVisible(false);
that.setGrabberMoveUpVisible( false ); that.setGrabberMoveUpVisible(false);
startPosition = SelectionManager.worldPosition; startPosition = SelectionManager.worldPosition;
@ -2411,7 +2411,7 @@ SelectionDisplay = (function() {
print(" "+ translateXZTool.mode + "Pick ray does not intersect XZ plane."); print(" "+ translateXZTool.mode + "Pick ray does not intersect XZ plane.");
} }
//--EARLY EXIT--( Invalid ray detected. ) //--EARLY EXIT--(Invalid ray detected.)
return; return;
} }
@ -2429,7 +2429,7 @@ SelectionDisplay = (function() {
print(" "+ translateXZTool.mode + " - too close to horizon!"); print(" "+ translateXZTool.mode + " - too close to horizon!");
} }
//--EARLY EXIT--( Don't proceed past the reached limit. ) //--EARLY EXIT--(Don't proceed past the reached limit.)
return; return;
} }
@ -2547,9 +2547,9 @@ SelectionDisplay = (function() {
lastXYPick = rayPlaneIntersection(pickRay, SelectionManager.worldPosition, upDownPickNormal); lastXYPick = rayPlaneIntersection(pickRay, SelectionManager.worldPosition, upDownPickNormal);
SelectionManager.saveProperties(); SelectionManager.saveProperties();
that.setGrabberMoveUpVisible( true ); that.setGrabberMoveUpVisible(true);
that.setStretchHandlesVisible( false ); that.setStretchHandlesVisible(false);
that.setRotationHandlesVisible( false ); that.setRotationHandlesVisible(false);
// Duplicate entities if alt is pressed. This will make a // Duplicate entities if alt is pressed. This will make a
// copy of the selected entities and move the _original_ entities, not // copy of the selected entities and move the _original_ entities, not
@ -3534,10 +3534,10 @@ SelectionDisplay = (function() {
function updateRotationDegreesOverlay(angleFromZero, handleRotation, centerPosition) { function updateRotationDegreesOverlay(angleFromZero, handleRotation, centerPosition) {
var wantDebug = false; var wantDebug = false;
if (wantDebug) { if (wantDebug) {
print( "---> updateRotationDegreesOverlay ---" ); print("---> updateRotationDegreesOverlay ---");
print(" AngleFromZero: " + angleFromZero ); print(" AngleFromZero: " + angleFromZero);
print(" HandleRotation - X: " + handleRotation.x + " Y: " + handleRotation.y + " Z: " + handleRotation.z ); print(" HandleRotation - X: " + handleRotation.x + " Y: " + handleRotation.y + " Z: " + handleRotation.z);
print(" CenterPos - " + centerPosition.x + " Y: " + centerPosition.y + " Z: " + centerPosition.z ); print(" CenterPos - " + centerPosition.x + " Y: " + centerPosition.y + " Z: " + centerPosition.z);
} }
var angle = angleFromZero * (Math.PI / 180); var angle = angleFromZero * (Math.PI / 180);
@ -3547,7 +3547,7 @@ SelectionDisplay = (function() {
z: 0, z: 0,
}; };
if (wantDebug) { if (wantDebug) {
print(" Angle: " + angle ); print(" Angle: " + angle);
print(" InitialPos: " + position.x + ", " + position.y + ", " + position.z); print(" InitialPos: " + position.x + ", " + position.y + ", " + position.z);
} }
@ -3564,21 +3564,21 @@ SelectionDisplay = (function() {
}; };
if (wantDebug) { if (wantDebug) {
print(" TranslatedPos: " + position.x + ", " + position.y + ", " + position.z); print(" TranslatedPos: " + position.x + ", " + position.y + ", " + position.z);
print(" OverlayDim - X: " + overlayProps.dimensions.x + " Y: " + overlayProps.dimensions.y + " Z: " + overlayProps.dimensions.z ); print(" OverlayDim - X: " + overlayProps.dimensions.x + " Y: " + overlayProps.dimensions.y + " Z: " + overlayProps.dimensions.z);
print(" OverlayLineHeight: " + overlayProps.lineHeight ); print(" OverlayLineHeight: " + overlayProps.lineHeight);
print(" OverlayText: " + overlayProps.text ); print(" OverlayText: " + overlayProps.text);
} }
Overlays.editOverlay(rotationDegreesDisplay, overlayProps); Overlays.editOverlay(rotationDegreesDisplay, overlayProps);
if (wantDebug) { if (wantDebug) {
print( "<--- updateRotationDegreesOverlay ---" ); print("<--- updateRotationDegreesOverlay ---");
} }
} }
// FUNCTION DEF: updateSelectionsRotation // FUNCTION DEF: updateSelectionsRotation
// Helper func used by rotation grabber tools // Helper func used by rotation grabber tools
function updateSelectionsRotation( rotationChange ) { function updateSelectionsRotation(rotationChange) {
if ( ! rotationChange ) { if (!rotationChange) {
print("ERROR: entitySelectionTool.updateSelectionsRotation - Invalid arg specified!!"); print("ERROR: entitySelectionTool.updateSelectionsRotation - Invalid arg specified!!");
//--EARLY EXIT-- //--EARLY EXIT--
@ -3607,16 +3607,16 @@ SelectionDisplay = (function() {
} }
} }
function helperRotationHandleOnBegin( event, pickRay, rotAroundAxis, rotCenter, handleRotation ) { function helperRotationHandleOnBegin(event, pickRay, rotAroundAxis, rotCenter, handleRotation) {
var wantDebug = false; var wantDebug = false;
if (wantDebug) { if (wantDebug) {
print("================== " + getMode() + "(rotation helper onBegin) -> ======================="); print("================== " + getMode() + "(rotation helper onBegin) -> =======================");
} }
SelectionManager.saveProperties(); SelectionManager.saveProperties();
that.setRotationHandlesVisible( false ); that.setRotationHandlesVisible(false);
that.setStretchHandlesVisible( false ); that.setStretchHandlesVisible(false);
that.setGrabberMoveUpVisible( false ); that.setGrabberMoveUpVisible(false);
initialPosition = SelectionManager.worldPosition; initialPosition = SelectionManager.worldPosition;
rotationNormal = { x: 0, y: 0, z: 0 }; rotationNormal = { x: 0, y: 0, z: 0 };
@ -3669,7 +3669,7 @@ SelectionDisplay = (function() {
// editOverlays may not have committed rotation changes. // editOverlays may not have committed rotation changes.
// Compute zero position based on where the overlay will be eventually. // Compute zero position based on where the overlay will be eventually.
var result = rayPlaneIntersection( pickRay, rotCenter, rotationNormal ); var result = rayPlaneIntersection(pickRay, rotCenter, rotationNormal);
// In case of a parallel ray, this will be null, which will cause early-out // In case of a parallel ray, this will be null, which will cause early-out
// in the onMove helper. // in the onMove helper.
rotZero = result; rotZero = result;
@ -3677,12 +3677,12 @@ SelectionDisplay = (function() {
if (wantDebug) { if (wantDebug) {
print("================== " + getMode() + "(rotation helper onBegin) <- ======================="); print("================== " + getMode() + "(rotation helper onBegin) <- =======================");
} }
}//--End_Function( helperRotationHandleOnBegin ) }//--End_Function(helperRotationHandleOnBegin)
function helperRotationHandleOnMove( event, rotAroundAxis, rotCenter, handleRotation ) { function helperRotationHandleOnMove(event, rotAroundAxis, rotCenter, handleRotation) {
if ( ! rotZero ) { if (!rotZero) {
print("ERROR: entitySelectionTool.handleRotationHandleOnMove - Invalid RotationZero Specified (missed rotation target plane?)" ); print("ERROR: entitySelectionTool.handleRotationHandleOnMove - Invalid RotationZero Specified (missed rotation target plane?)");
//--EARLY EXIT-- //--EARLY EXIT--
return; return;
@ -3701,7 +3701,7 @@ SelectionDisplay = (function() {
visible: false visible: false
}); });
var result = rayPlaneIntersection( pickRay, rotCenter, rotationNormal ); var result = rayPlaneIntersection(pickRay, rotCenter, rotationNormal);
if (result) { if (result) {
var centerToZero = Vec3.subtract(rotZero, rotCenter); var centerToZero = Vec3.subtract(rotZero, rotCenter);
var centerToIntersect = Vec3.subtract(result, rotCenter); var centerToIntersect = Vec3.subtract(result, rotCenter);
@ -3724,8 +3724,8 @@ SelectionDisplay = (function() {
var vec3Degrees = { x: 0, y: 0, z: 0 }; var vec3Degrees = { x: 0, y: 0, z: 0 };
vec3Degrees[rotAroundAxis] = angleFromZero; vec3Degrees[rotAroundAxis] = angleFromZero;
var rotChange = Quat.fromVec3Degrees( vec3Degrees ); var rotChange = Quat.fromVec3Degrees(vec3Degrees);
updateSelectionsRotation( rotChange ); updateSelectionsRotation(rotChange);
updateRotationDegreesOverlay(angleFromZero, handleRotation, rotCenter); updateRotationDegreesOverlay(angleFromZero, handleRotation, rotCenter);
@ -3777,12 +3777,12 @@ SelectionDisplay = (function() {
minorTickMarksLength: 0.1, minorTickMarksLength: 0.1,
}); });
} }
}//--End_If( results.intersects ) }//--End_If(results.intersects)
if (wantDebug) { if (wantDebug) {
print("================== "+ getMode() + "(rotation helper onMove) <- ======================="); print("================== "+ getMode() + "(rotation helper onMove) <- =======================");
} }
}//--End_Function( helperRotationHandleOnMove ) }//--End_Function(helperRotationHandleOnMove)
function helperRotationHandleOnEnd() { function helperRotationHandleOnEnd() {
var wantDebug = false; var wantDebug = false;
@ -3807,7 +3807,7 @@ SelectionDisplay = (function() {
if (wantDebug) { if (wantDebug) {
print("================== " + getMode() + "(onEnd) <- ======================="); print("================== " + getMode() + "(onEnd) <- =======================");
} }
}//--End_Function( helperRotationHandleOnEnd ) }//--End_Function(helperRotationHandleOnEnd)
// YAW GRABBER TOOL DEFINITION // YAW GRABBER TOOL DEFINITION
@ -3815,13 +3815,13 @@ SelectionDisplay = (function() {
addGrabberTool(yawHandle, { addGrabberTool(yawHandle, {
mode: "ROTATE_YAW", mode: "ROTATE_YAW",
onBegin: function(event, pickRay, pickResult) { onBegin: function(event, pickRay, pickResult) {
helperRotationHandleOnBegin( event, pickRay, "y", yawCenter, yawHandleRotation ); helperRotationHandleOnBegin(event, pickRay, "y", yawCenter, yawHandleRotation);
}, },
onEnd: function(event, reason) { onEnd: function(event, reason) {
helperRotationHandleOnEnd(); helperRotationHandleOnEnd();
}, },
onMove: function(event) { onMove: function(event) {
helperRotationHandleOnMove( event, "y", yawCenter, yawHandleRotation ); helperRotationHandleOnMove(event, "y", yawCenter, yawHandleRotation);
} }
}); });
@ -3830,13 +3830,13 @@ SelectionDisplay = (function() {
addGrabberTool(pitchHandle, { addGrabberTool(pitchHandle, {
mode: "ROTATE_PITCH", mode: "ROTATE_PITCH",
onBegin: function(event, pickRay, pickResult) { onBegin: function(event, pickRay, pickResult) {
helperRotationHandleOnBegin( event, pickRay, "x", pitchCenter, pitchHandleRotation ); helperRotationHandleOnBegin(event, pickRay, "x", pitchCenter, pitchHandleRotation);
}, },
onEnd: function(event, reason) { onEnd: function(event, reason) {
helperRotationHandleOnEnd(); helperRotationHandleOnEnd();
}, },
onMove: function (event) { onMove: function (event) {
helperRotationHandleOnMove( event, "x", pitchCenter, pitchHandleRotation ); helperRotationHandleOnMove(event, "x", pitchCenter, pitchHandleRotation);
} }
}); });
@ -3845,13 +3845,13 @@ SelectionDisplay = (function() {
addGrabberTool(rollHandle, { addGrabberTool(rollHandle, {
mode: "ROTATE_ROLL", mode: "ROTATE_ROLL",
onBegin: function(event, pickRay, pickResult) { onBegin: function(event, pickRay, pickResult) {
helperRotationHandleOnBegin( event, pickRay, "z", rollCenter, rollHandleRotation ); helperRotationHandleOnBegin(event, pickRay, "z", rollCenter, rollHandleRotation);
}, },
onEnd: function (event, reason) { onEnd: function (event, reason) {
helperRotationHandleOnEnd(); helperRotationHandleOnEnd();
}, },
onMove: function(event) { onMove: function(event) {
helperRotationHandleOnMove( event, "z", rollCenter, rollHandleRotation ); helperRotationHandleOnMove(event, "z", rollCenter, rollHandleRotation);
} }
}); });
@ -3899,10 +3899,10 @@ SelectionDisplay = (function() {
var intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludes, overlayExcludes); var intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludes, overlayExcludes);
if (wantDebug) { if (wantDebug) {
if ( ! overlayIncludes ) { if (!overlayIncludes) {
print("testRayIntersect - no overlayIncludes provided."); print("testRayIntersect - no overlayIncludes provided.");
} }
if ( ! overlayExcludes ) { if (!overlayExcludes) {
print("testRayIntersect - no overlayExcludes provided."); print("testRayIntersect - no overlayExcludes provided.");
} }
print("testRayIntersect - Hit: " + intersectObj.intersects); print("testRayIntersect - Hit: " + intersectObj.intersects);
@ -3932,17 +3932,17 @@ SelectionDisplay = (function() {
var interactiveOverlays = [HMD.tabletID, HMD.tabletScreenID, HMD.homeButtonID, selectionBox]; var interactiveOverlays = [HMD.tabletID, HMD.tabletScreenID, HMD.homeButtonID, selectionBox];
for (var key in grabberTools) { for (var key in grabberTools) {
if (grabberTools.hasOwnProperty(key)) { if (grabberTools.hasOwnProperty(key)) {
interactiveOverlays.push( key ); interactiveOverlays.push(key);
} }
} }
// Start with unknown mode, in case no tool can handle this. // Start with unknown mode, in case no tool can handle this.
activeTool = null; activeTool = null;
var results = testRayIntersect( pickRay, interactiveOverlays ); var results = testRayIntersect(pickRay, interactiveOverlays);
if ( results.intersects ) { if (results.intersects) {
var hitOverlayID = results.overlayID; var hitOverlayID = results.overlayID;
if ( (hitOverlayID == HMD.tabletID) || (hitOverlayID == HMD.tabletScreenID) || (hitOverlayID == HMD.homeButtonID) ) { if ((hitOverlayID == HMD.tabletID) || (hitOverlayID == HMD.tabletScreenID) || (hitOverlayID == HMD.homeButtonID)) {
//--EARLY EXIT-(mouse clicks on the tablet should override the edit affordances) //--EARLY EXIT-(mouse clicks on the tablet should override the edit affordances)
return false; return false;
} }
@ -3950,17 +3950,17 @@ SelectionDisplay = (function() {
entityIconOverlayManager.setIconsSelectable(selectionManager.selections, true); entityIconOverlayManager.setIconsSelectable(selectionManager.selections, true);
var hitTool = grabberTools[ hitOverlayID ]; var hitTool = grabberTools[ hitOverlayID ];
if ( hitTool ) { if (hitTool) {
activeTool = hitTool; activeTool = hitTool;
if (activeTool.onBegin) { if (activeTool.onBegin) {
activeTool.onBegin(event, pickRay, results); activeTool.onBegin(event, pickRay, results);
} else { } else {
print("ERROR: entitySelectionTool.mousePressEvent - ActiveTool( " + activeTool.mode + " ) missing onBegin"); print("ERROR: entitySelectionTool.mousePressEvent - ActiveTool(" + activeTool.mode + ") missing onBegin");
} }
} else { } else {
print("ERROR: entitySelectionTool.mousePressEvent - Hit unexpected object, check interactiveOverlays"); print("ERROR: entitySelectionTool.mousePressEvent - Hit unexpected object, check interactiveOverlays");
}//--End_if ( hitTool ) }//--End_if (hitTool)
}//--End_If( results.intersects ) }//--End_If(results.intersects)
if (wantDebug) { if (wantDebug) {
print(" DisplayMode: " + getMode()); print(" DisplayMode: " + getMode());
@ -3976,11 +3976,11 @@ SelectionDisplay = (function() {
that.mouseMoveEvent = function(event) { that.mouseMoveEvent = function(event) {
var wantDebug = false; var wantDebug = false;
if (wantDebug) { if (wantDebug) {
print( "=============== eST::MouseMoveEvent BEG ======================="); print("=============== eST::MouseMoveEvent BEG =======================");
} }
if (activeTool) { if (activeTool) {
if (wantDebug) { if (wantDebug) {
print(" Trigger ActiveTool( " + activeTool.mode + " )'s onMove"); print(" Trigger ActiveTool(" + activeTool.mode + ")'s onMove");
} }
activeTool.onMove(event); activeTool.onMove(event);
@ -3992,7 +3992,7 @@ SelectionDisplay = (function() {
if (wantDebug) { if (wantDebug) {
print("=============== eST::MouseMoveEvent END ======================="); print("=============== eST::MouseMoveEvent END =======================");
} }
//--EARLY EXIT--( Move handled via active tool) //--EARLY EXIT--(Move handled via active tool)
return true; return true;
} }
@ -4129,18 +4129,18 @@ SelectionDisplay = (function() {
} }
var showHandles = false; var showHandles = false;
if (activeTool) { if (activeTool) {
if ( activeTool.onEnd ) { if (activeTool.onEnd) {
if (wantDebug) { if (wantDebug) {
print(" Triggering ActiveTool( " + activeTool.mode + " )'s onEnd"); print(" Triggering ActiveTool(" + activeTool.mode + ")'s onEnd");
} }
activeTool.onEnd(event); activeTool.onEnd(event);
}else if (wantDebug) { }else if (wantDebug) {
print(" ActiveTool( " + activeTool.mode + " )'s missing onEnd"); print(" ActiveTool(" + activeTool.mode + ")'s missing onEnd");
} }
} }
// hide our rotation overlays..., and show our handles // hide our rotation overlays..., and show our handles
if ( isActiveTool(yawHandle) || isActiveTool(pitchHandle) || isActiveTool(rollHandle)) { if (isActiveTool(yawHandle) || isActiveTool(pitchHandle) || isActiveTool(rollHandle)) {
if (wantDebug) { if (wantDebug) {
print(" Triggering hide of RotateOverlays"); print(" Triggering hide of RotateOverlays");
} }