From 8c01d5f82b3924060269f3da69ff26227bb730cb Mon Sep 17 00:00:00 2001 From: Zach Pomerantz Date: Mon, 15 Feb 2016 14:00:42 -0800 Subject: [PATCH] Remove camera tool's 3d hud overlays --- examples/libraries/entityCameraTool.js | 145 +------------------------ examples/libraries/overlayManager.js | 2 +- 2 files changed, 2 insertions(+), 145 deletions(-) diff --git a/examples/libraries/entityCameraTool.js b/examples/libraries/entityCameraTool.js index e3e86cedb3..d209ed6c5c 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -614,142 +614,19 @@ CameraTool = function(cameraManager) { visible: false, }); - var defaultCubeProps = { - size: ORIENTATION_OVERLAY_CUBE_SIZE, - alpha: 1, - color: { - red: 255, - green: 0, - blue: 0 - }, - solid: true, - visible: true, - drawOnHUD: true, - }; - var defaultLineProps = { - lineWidth: 1.5, - alpha: 1, - position: { - x: 0, - y: 0, - z: 0 - }, - start: { - x: 0, - y: 0, - z: 0 - }, - end: { - x: 0, - y: 0, - z: 0 - }, - color: { - red: 255, - green: 0, - blue: 0 - }, - visible: false, - drawOnHUD: true, - }; - - var orientationOverlay = OverlayGroup({ - position: { - x: uiPosition.x + UI_WIDTH / 2, - y: uiPosition.y + UI_HEIGHT / 2, - }, - visible: false, - }); - - var OOHS = ORIENTATION_OVERLAY_HALF_SIZE; - var cubeX = orientationOverlay.createOverlay("cube", mergeObjects(defaultCubeProps, { - position: { - x: -OOHS, - y: OOHS, - z: OOHS - }, - color: RED, - })); - var cubeY = orientationOverlay.createOverlay("cube", mergeObjects(defaultCubeProps, { - position: { - x: OOHS, - y: -OOHS, - z: OOHS - }, - color: GREEN, - })); - var cubeZ = orientationOverlay.createOverlay("cube", mergeObjects(defaultCubeProps, { - position: { - x: OOHS, - y: OOHS, - z: -OOHS - }, - color: BLUE, - })); - orientationOverlay.createOverlay("line3d", mergeObjects(defaultLineProps, { - start: { - x: -OOHS, - y: OOHS, - z: OOHS - }, - end: { - x: OOHS, - y: OOHS, - z: OOHS - }, - color: RED, - })); - orientationOverlay.createOverlay("line3d", mergeObjects(defaultLineProps, { - start: { - x: OOHS, - y: -OOHS, - z: OOHS - }, - end: { - x: OOHS, - y: OOHS, - z: OOHS - }, - color: GREEN, - })); - orientationOverlay.createOverlay("line3d", mergeObjects(defaultLineProps, { - start: { - x: OOHS, - y: OOHS, - z: -OOHS - }, - end: { - x: OOHS, - y: OOHS, - z: OOHS - }, - color: BLUE, - })); - Script.scriptEnding.connect(function() { - orientationOverlay.destroy(); Overlays.deleteOverlay(background); Overlays.deleteOverlay(backgroundBorder); }); var flip = Quat.fromPitchYawRollDegrees(0, 180, 0); that.update = function() { - orientationOverlay.setProperties({ - rotation: Quat.multiply(flip, Quat.inverse(Camera.orientation)), - }); - if (Window.innerWidth != lastKnownWidth) { lastKnownWidth = Window.innerWidth; uiPosition = { x: lastKnownWidth - UI_WIDTH - UI_PADDING, y: UI_PADDING, }; - orientationOverlay.setProperties({ - position: { - x: uiPosition.x + ORIENTATION_OVERLAY_OFFSET.x, - y: uiPosition.y + ORIENTATION_OVERLAY_OFFSET.y, - } - }); Overlays.editOverlay(backgroundBorder, { x: uiPosition.x - BORDER_WIDTH, y: uiPosition.y - BORDER_WIDTH, @@ -766,29 +643,9 @@ CameraTool = function(cameraManager) { x: event.x, y: event.y }); - - if (clickedOverlay == cubeX) { - targetPitch = 0; - targetYaw = event.isLeftButton ? 90 : -90; - cameraManager.setTargetPitchYaw(targetPitch, targetYaw); - return true; - } else if (clickedOverlay == cubeY) { - targetPitch = event.isLeftButton ? 90 : -90; - targetYaw = 0; - cameraManager.setTargetPitchYaw(targetPitch, targetYaw); - return true; - } else if (clickedOverlay == cubeZ) { - targetPitch = 0; - targetYaw = event.isLeftButton ? 0 : 180; - cameraManager.setTargetPitchYaw(targetPitch, targetYaw); - return true; - } }; that.setVisible = function(visible) { - orientationOverlay.setProperties({ - visible: visible - }); Overlays.editOverlay(background, { visible: visible }); @@ -800,4 +657,4 @@ CameraTool = function(cameraManager) { that.setVisible(false); return that; -}; \ No newline at end of file +}; diff --git a/examples/libraries/overlayManager.js b/examples/libraries/overlayManager.js index 49398c5009..4438193313 100644 --- a/examples/libraries/overlayManager.js +++ b/examples/libraries/overlayManager.js @@ -221,7 +221,7 @@ var Base3DOverlay = generateOverlayClass(Overlay, ABSTRACT, [ "position", "lineWidth", "rotation", "isSolid", "isFilled", "isWire", "isDashedLine", - "ignoreRayIntersection", "drawInFront", "drawOnHUD" + "ignoreRayIntersection", "drawInFront" ]); var Planar3DOverlay = generateOverlayClass(Base3DOverlay, ABSTRACT, [