From 1c4051b288081ee12007f90eaecf89c5fd018f1d Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 12 Mar 2014 10:35:22 -0700 Subject: [PATCH] Added importBoundaries --- examples/editVoxels.js | 40 ++++++++++++++++++++++++++++----------- interface/interface_en.ts | 4 ++-- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index b5702dff47..956b6f1d1d 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -283,17 +283,25 @@ var thumbDeltaPerStep = thumbExtents / (pointerVoxelScaleSteps - 1); // Move the following code to a separate file when include will be available. var importTree; var importPreview; +var importBoundaries; var isImporting; var importPosition; var importScale; function initImport() { importPreview = Overlays.addOverlay("localvoxels", { - name: "import", - position: { x: 0, y: 0, z: 0}, - scale: 0, - visible: false - }); + name: "import", + position: { x: 0, y: 0, z: 0}, + scale: 1, + visible: false + }); + importBoundaries = Overlays.addOverlay("cube", { + position: { x: 0, y: 0, z: 0 }, + scale: 1, + color: { red: 128, blue: 128, green: 128 }, + solid: false, + visible: false + }) isImporting = false; importPosition = { x: 0, y: 0, z: 0 }; importScale = 0; @@ -316,8 +324,11 @@ function moveImport(position) { if (0 < position.x && 0 < position.y && 0 < position.z) { importPosition = position; Overlays.editOverlay(importPreview, { - position: { x: importPosition.x, y: importPosition.y, z: importPosition.z } - }); + position: { x: importPosition.x, y: importPosition.y, z: importPosition.z } + }); + Overlays.editOverlay(importBoundaries, { + position: { x: importPosition.x, y: importPosition.y, z: importPosition.z } + }); } } @@ -325,15 +336,21 @@ function rescaleImport(scale) { if (0 < scale) { importScale = scale; Overlays.editOverlay(importPreview, { - scale: importScale - }); + scale: importScale + }); + Overlays.editOverlay(importBoundaries, { + scale: importScale + }); } } function showImport(doShow) { Overlays.editOverlay(importPreview, { - visible: doShow - }); + visible: doShow + }); + Overlays.editOverlay(importBoundaries, { + visible: doShow + }); } function placeImport() { @@ -352,6 +369,7 @@ function cancelImport() { function cleanupImport() { Overlays.deleteOverlay(importPreview); + Overlays.deleteOverlay(importBoundaries); isImporting = false; importPostion = { x: 0, y: 0, z: 0 }; importScale = 0; diff --git a/interface/interface_en.ts b/interface/interface_en.ts index a8f78cd36e..76a5d47101 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -14,12 +14,12 @@ - + Open Script - + JavaScript Files (*.js)