From e0d68607cd5f154af7609455f926d5900ef5887a Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 28 May 2014 21:02:33 -0700 Subject: [PATCH] Set max voxel size of 16 meters in script for voxel creation --- examples/editVoxels.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 9040306bf6..14bea50bb0 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -28,7 +28,7 @@ var NEW_VOXEL_SIZE = 1.0; var NEW_VOXEL_DISTANCE_FROM_CAMERA = 3.0; var PIXELS_PER_EXTRUDE_VOXEL = 16; var WHEEL_PIXELS_PER_SCALE_CHANGE = 100; -var MAX_VOXEL_SCALE = 1.0; +var MAX_VOXEL_SCALE = 16.0; var MIN_VOXEL_SCALE = 1.0 / Math.pow(2.0, 8.0); var WHITE_COLOR = { red: 255, green: 255, blue: 255 }; @@ -394,6 +394,9 @@ function ScaleSelector() { if (this.power < 13) { ++this.power; this.scale *= 2.0; + if (this.scale > MAX_VOXEL_SCALE) { + this.scale = MAX_VOXEL_SCALE; + } this.update(); rescaleImport(); resizeVoxelSound.play(voxelSizePlus); @@ -1056,6 +1059,9 @@ function mousePressEvent(event) { lastVoxelPosition = { x: voxelDetails.x, y: voxelDetails.y, z: voxelDetails.z }; lastVoxelColor = { red: newColor.red, green: newColor.green, blue: newColor.blue }; lastVoxelScale = voxelDetails.s; + if (lastVoxelScale > MAX_VOXEL_SCALE) { + lastVoxelScale = MAX_VOXEL_SCALE; + } addVoxelSound.playRandom();