From 7026436dee33e332f49ba315746f0c6a7bfc00da Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 20 Feb 2014 17:32:59 -0800 Subject: [PATCH 01/14] first cut at touch support for orbit and pan, skeleton support for pan --- examples/editVoxels.js | 409 +++++++++++++++++++++++++++++++---------- 1 file changed, 310 insertions(+), 99 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 81e3000566..59cb56fab6 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -31,6 +31,11 @@ var key_shift = false; var isAdding = false; var isExtruding = false; var isOrbiting = false; +var isOrbitingFromTouch = false; +var isPanning = false; +var isPanningFromTouch = false; +var touchPointsToOrbit = 2; // you can change these, but be mindful that on some track pads 2 touch points = right click+drag +var touchPointsToPan = 3; var orbitAzimuth = 0.0; var orbitAltitude = 0.0; var orbitCenter = { x: 0, y: 0, z: 0 }; @@ -68,6 +73,7 @@ var changeColorSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelit var clickSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Switches+and+sliders/toggle+switch+-+medium.raw"); var audioOptions = new AudioInjectionOptions();
 audioOptions.volume = 0.5; +audioOptions.position = Vec3.sum(MyAvatar.position, { x: 0, y: 1, z: 0 } ); // start with audio slightly above the avatar var editToolsOn = false; // starts out off @@ -326,7 +332,7 @@ var trackLastMouseY = 0; var trackAsDelete = false; var trackAsRecolor = false; var trackAsEyedropper = false; -var trackAsOrbit = false; +var trackAsOrbitOrPan = false; function calculateVoxelFromIntersection(intersection, operation) { //print("calculateVoxelFromIntersection() operation="+operation); @@ -477,7 +483,7 @@ function showPreviewVoxel() { solid: true, alpha: 0.8 }); - } else if (trackAsOrbit) { + } else if (trackAsOrbitOrPan) { Overlays.editOverlay(voxelPreview, { visible: false }); } else if (!isExtruding) { guidePosition = calculateVoxelFromIntersection(intersection,"add"); @@ -548,16 +554,22 @@ function showPreviewGuides() { } function trackMouseEvent(event) { - trackLastMouseX = event.x; - trackLastMouseY = event.y; - trackAsDelete = event.isControl; - trackAsRecolor = event.isShifted; - trackAsEyedropper = event.isMeta; - trackAsOrbit = event.isAlt; - showPreviewGuides(); + if (!trackAsOrbitOrPan) { + trackLastMouseX = event.x; + trackLastMouseY = event.y; + trackAsDelete = event.isControl; + trackAsRecolor = event.isShifted; + trackAsEyedropper = event.isMeta; + trackAsOrbitOrPan = event.isAlt; // TODO: double check this...?? + showPreviewGuides(); + } } function trackKeyPressEvent(event) { + if (!editToolsOn) { + return; + } + if (event.text == "CONTROL") { trackAsDelete = true; moveTools(); @@ -571,41 +583,13 @@ function trackKeyPressEvent(event) { moveTools(); } if (event.text == "ALT") { - trackAsOrbit = true; + trackAsOrbitOrPan = true; moveTools(); } showPreviewGuides(); } function trackKeyReleaseEvent(event) { - if (event.text == "ESC") { - pointerVoxelScaleSet = false; - } - if (event.text == "-") { - thumbX -= thumbDeltaPerStep; - calcScaleFromThumb(thumbX); - } - if (event.text == "+") { - thumbX += thumbDeltaPerStep; - calcScaleFromThumb(thumbX); - } - if (event.text == "CONTROL") { - trackAsDelete = false; - moveTools(); - } - if (event.text == "SHIFT") { - trackAsRecolor = false; - moveTools(); - } - if (event.text == "META") { - trackAsEyedropper = false; - moveTools(); - } - if (event.text == "ALT") { - trackAsOrbit = false; - moveTools(); - } - // on TAB release, toggle our tool state if (event.text == "TAB") { editToolsOn = !editToolsOn; @@ -613,14 +597,108 @@ function trackKeyReleaseEvent(event) { Audio.playSound(clickSound, audioOptions); } - // on F1 toggle the preview mode between cubes and lines - if (event.text == "F1") { - previewAsVoxel = !previewAsVoxel; - } + if (editToolsOn) { + if (event.text == "ESC") { + pointerVoxelScaleSet = false; + } + if (event.text == "-") { + thumbX -= thumbDeltaPerStep; + calcScaleFromThumb(thumbX); + } + if (event.text == "+") { + thumbX += thumbDeltaPerStep; + calcScaleFromThumb(thumbX); + } + if (event.text == "CONTROL") { + trackAsDelete = false; + moveTools(); + } + if (event.text == "SHIFT") { + trackAsRecolor = false; + moveTools(); + } + if (event.text == "META") { + trackAsEyedropper = false; + moveTools(); + } + if (event.text == "ALT") { + trackAsOrbitOrPan = false; + moveTools(); + } + + // on F1 toggle the preview mode between cubes and lines + if (event.text == "F1") { + previewAsVoxel = !previewAsVoxel; + } - showPreviewGuides(); + showPreviewGuides(); + } } +function startOrbitMode(event) { + mouseX = event.x; + mouseY = event.y; + var pickRay = Camera.computePickRay(event.x, event.y); + var intersection = Voxels.findRayIntersection(pickRay); + + // start orbit camera! + var cameraPosition = Camera.getPosition(); + oldMode = Camera.getMode(); + Camera.setMode("independent"); + Camera.keepLookingAt(intersection.intersection); + // get position for initial azimuth, elevation + orbitCenter = intersection.intersection; + var orbitVector = Vec3.subtract(cameraPosition, orbitCenter); + orbitRadius = Vec3.length(orbitVector); + orbitAzimuth = Math.atan2(orbitVector.z, orbitVector.x); + orbitAltitude = Math.asin(orbitVector.y / Vec3.length(orbitVector)); + + print("startOrbitMode..."); +} + +function handleOrbitingMove(event) { + var cameraOrientation = Camera.getOrientation(); + var origEulers = Quat.safeEulerAngles(cameraOrientation); + var newEulers = fixEulerAngles(Quat.safeEulerAngles(cameraOrientation)); + var dx = event.x - mouseX; + var dy = event.y - mouseY; + orbitAzimuth += dx / ORBIT_RATE_AZIMUTH; + orbitAltitude += dy / ORBIT_RATE_ALTITUDE; + var orbitVector = { x:(Math.cos(orbitAltitude) * Math.cos(orbitAzimuth)) * orbitRadius, + y:Math.sin(orbitAltitude) * orbitRadius, + z:(Math.cos(orbitAltitude) * Math.sin(orbitAzimuth)) * orbitRadius }; + orbitPosition = Vec3.sum(orbitCenter, orbitVector); + Camera.setPosition(orbitPosition); + mouseX = event.x; + mouseY = event.y; + print("handleOrbitingMove..."); +} + +function endOrbitMode(event) { + var cameraOrientation = Camera.getOrientation(); + var eulers = Quat.safeEulerAngles(cameraOrientation); + MyAvatar.position = Camera.getPosition(); + MyAvatar.orientation = cameraOrientation; + Camera.stopLooking(); + Camera.setMode(oldMode); + Camera.setOrientation(cameraOrientation); + print("endOrbitMode..."); +} + +function startPanMode(event, intersection) { + // start pan camera! + print("handle PAN mode!!!"); +} + +function handlePanMove(event) { + print("PANNING mode!!! isPanning="+isPanning + " inPanningFromTouch="+isPanningFromTouch + " trackAsOrbitOrPan="+trackAsOrbitOrPan); +} + +function endPanMode(event) { + print("ending PAN mode!!!"); +} + + function mousePressEvent(event) { // if our tools are off, then don't do anything @@ -628,29 +706,58 @@ function mousePressEvent(event) { return; } - var clickedOnSwatch = false; - var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y}); - - // If the user clicked on the thumb, handle the slider logic - if (clickedOverlay == thumb) { - isMovingSlider = true; - thumbClickOffsetX = event.x - (sliderX + thumbX); // this should be the position of the mouse relative to the thumb - return; // no further processing - } else { - // if the user clicked on one of the color swatches, update the selectedSwatch - for (s = 0; s < numColors; s++) { - if (clickedOverlay == swatches[s]) { - whichColor = s; - moveTools(); - clickedOnSwatch = true; + // Normally, if we're panning or orbiting from touch, ignore these... because our touch takes precedence. + // but In the case of a button="RIGHT" click, we may get some touch messages first, and we actually want to + // cancel any touch mode, and then let the right-click through + if (isOrbitingFromTouch || isPanningFromTouch) { + + // if the user is holding the ALT key AND they are clicking the RIGHT button (or on multi-touch doing a two + // finger touch, then we want to let the new panning behavior take over. + // if it's any other case we still want to bail + if (event.button == "RIGHT" && trackAsOrbitOrPan) { + // cancel our current multitouch operation... + if (isOrbitingFromTouch) { + endOrbitMode(event); + isOrbitingFromTouch = false; } + if (isPanningFromTouch) { + //print("mousePressEvent... calling endPanMode()"); + endPanMode(event); + isPanningFromTouch = false; + } + // let things fall through + } else { + return; } - if (clickedOnSwatch) { + } + + // no clicking on overlays while in panning mode + if (!trackAsOrbitOrPan) { + var clickedOnSwatch = false; + var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y}); + + // If the user clicked on the thumb, handle the slider logic + if (clickedOverlay == thumb) { + isMovingSlider = true; + thumbClickOffsetX = event.x - (sliderX + thumbX); // this should be the position of the mouse relative to the thumb return; // no further processing + } else { + // if the user clicked on one of the color swatches, update the selectedSwatch + for (s = 0; s < numColors; s++) { + if (clickedOverlay == swatches[s]) { + whichColor = s; + moveTools(); + clickedOnSwatch = true; + } + } + if (clickedOnSwatch) { + return; // no further processing + } } } + // TODO: does any of this stuff need to execute if we're panning or orbiting? trackMouseEvent(event); // used by preview support mouseX = event.x; mouseY = event.y; @@ -663,20 +770,16 @@ function mousePressEvent(event) { calcThumbFromScale(intersection.voxel.s); } - if (event.isAlt) { - // start orbit camera! - var cameraPosition = Camera.getPosition(); - oldMode = Camera.getMode(); - Camera.setMode("independent"); - isOrbiting = true; - Camera.keepLookingAt(intersection.intersection); - // get position for initial azimuth, elevation - orbitCenter = intersection.intersection; - var orbitVector = Vec3.subtract(cameraPosition, orbitCenter); - orbitRadius = Vec3.length(orbitVector); - orbitAzimuth = Math.atan2(orbitVector.z, orbitVector.x); - orbitAltitude = Math.asin(orbitVector.y / Vec3.length(orbitVector)); - + // Note: touch and mouse events can cross paths, so we want to ignore any mouse events that would + // start a pan or orbit if we're already doing a pan or orbit via touch... + if ((event.isAlt || trackAsOrbitOrPan) && !(isOrbitingFromTouch || isPanningFromTouch)) { + if (event.isLeftButton && !event.isRightButton) { + startOrbitMode(event); + isOrbiting = true; + } else if (event.isRightButton && !event.isLeftButton) { + startPanMode(event); + isPanning = true; + } } else if (trackAsDelete || (event.isRightButton && !trackAsEyedropper)) { // Delete voxel voxelDetails = calculateVoxelFromIntersection(intersection,"delete"); @@ -784,7 +887,28 @@ function keyReleaseEvent(event) { function mouseMoveEvent(event) { - if (isMovingSlider) { + if (!editToolsOn) { + return; + } + + // if we're panning or orbiting from touch, ignore these... because our touch takes precedence. + if (isOrbitingFromTouch || isPanningFromTouch) { + return; + } + + // double check that we didn't accidentally miss a pan or orbit click request + if (trackAsOrbitOrPan && !isPanning && !isOrbiting) { + if (event.isLeftButton && !event.isRightButton) { + startOrbitMode(event); + isOrbiting = true; + } + if (!event.isLeftButton && event.isRightButton) { + startPanMode(event); + isPanning = true; + } + } + + if (!trackAsOrbitOrPan && isMovingSlider) { thumbX = (event.x - thumbClickOffsetX) - sliderX; if (thumbX < minThumbX) { thumbX = minThumbX; @@ -795,21 +919,10 @@ function mouseMoveEvent(event) { calcScaleFromThumb(thumbX); } else if (isOrbiting) { - var cameraOrientation = Camera.getOrientation(); - var origEulers = Quat.safeEulerAngles(cameraOrientation); - var newEulers = fixEulerAngles(Quat.safeEulerAngles(cameraOrientation)); - var dx = event.x - mouseX; - var dy = event.y - mouseY; - orbitAzimuth += dx / ORBIT_RATE_AZIMUTH; - orbitAltitude += dy / ORBIT_RATE_ALTITUDE; - var orbitVector = { x:(Math.cos(orbitAltitude) * Math.cos(orbitAzimuth)) * orbitRadius, - y:Math.sin(orbitAltitude) * orbitRadius, - z:(Math.cos(orbitAltitude) * Math.sin(orbitAzimuth)) * orbitRadius }; - orbitPosition = Vec3.sum(orbitCenter, orbitVector); - Camera.setPosition(orbitPosition); - mouseX = event.x; - mouseY = event.y; - } else if (isAdding) { + handleOrbitingMove(event); + } else if (isPanning) { + handlePanMove(event); + } else if (!trackAsOrbitOrPan && isAdding) { // Watch the drag direction to tell which way to 'extrude' this voxel if (!isExtruding) { var pickRay = Camera.computePickRay(event.x, event.y); @@ -861,18 +974,17 @@ function mouseReleaseEvent(event) { if (isMovingSlider) { isMovingSlider = false; } - + if (isOrbiting) { - var cameraOrientation = Camera.getOrientation(); - var eulers = Quat.safeEulerAngles(cameraOrientation); - MyAvatar.position = Camera.getPosition(); - MyAvatar.orientation = cameraOrientation; - Camera.stopLooking(); - Camera.setMode(oldMode); - Camera.setOrientation(cameraOrientation); + endOrbitMode(event); + isOrbiting = false; + } + if (isPanning) { + print("mouseReleaseEvent... calling endPanMode()"); + endPanMode(event); + isPanning = false; } isAdding = false; - isOrbiting = false; isExtruding = false; } @@ -915,7 +1027,7 @@ function moveTools() { recolorToolColor = toolSelectedColor; } else if (trackAsEyedropper) { eyedropperToolColor = toolSelectedColor; - } else if (trackAsOrbit) { + } else if (trackAsOrbitOrPan) { // nothing gets selected in this case... } else { addToolColor = toolSelectedColor; @@ -962,6 +1074,101 @@ function moveTools() { } +function touchBeginEvent(event) { + if (!editToolsOn) { + return; + } + + // if we're already in the middle of orbiting or panning, then ignore these multi-touch events... + if (isOrbiting || isPanning) { + return; + } + + if (event.isAlt || trackAsOrbitOrPan) { + if (event.touchPoints == touchPointsToOrbit) { + // we need to double check that we didn't start an orbit, because the touch events will sometimes + // come in as 2 then 3 touches... + if (isPanningFromTouch) { + print("touchBeginEvent... calling endPanMode()"); + endPanMode(event); + isPanningFromTouch = false; + } + startOrbitMode(event); + isOrbitingFromTouch = true; + } else if (event.touchPoints == touchPointsToPan) { + // we need to double check that we didn't start an orbit, because the touch events will sometimes + // come in as 2 then 3 touches... + if (isOrbitingFromTouch) { + endOrbitMode(event); + isOrbitingFromTouch = false; + } + startPanMode(event); + isPanningFromTouch = true; + } + } +} + +function touchUpdateEvent(event) { + if (!editToolsOn) { + return; + } + + // if we're already in the middle of orbiting or panning, then ignore these multi-touch events... + if (isOrbiting || isPanning) { + return; + } + + if (isOrbitingFromTouch) { + // we need to double check that we didn't start an orbit, because the touch events will sometimes + // come in as 2 then 3 touches... + if (event.touchPoints == touchPointsToPan) { + //print("we now have touchPointsToPan touches... switch to pan..."); + endOrbitMode(event); + isOrbitingFromTouch = false; + startPanMode(event); + isPanningFromTouch = true; + } else { + handleOrbitingMove(event); + } + } + if (isPanningFromTouch) { + //print("touchUpdateEvent... isPanningFromTouch... event.touchPoints=" + event.touchPoints); + // we need to double check that we didn't start an orbit, because the touch events will sometimes + // come in as 2 then 3 touches... + if (event.touchPoints == touchPointsToOrbit) { + //print("we now have touchPointsToOrbit touches... switch to orbit..."); + //print("touchUpdateEvent... calling endPanMode()"); + endPanMode(event); + isPanningFromTouch = false; + startOrbitMode(event); + isOrbitingFromTouch = true; + handleOrbitingMove(event); + } else { + handlePanMove(event); + } + } +} + +function touchEndEvent(event) { + if (!editToolsOn) { + return; + } + + // if we're already in the middle of orbiting or panning, then ignore these multi-touch events... + if (isOrbiting || isPanning) { + return; + } + + if (isOrbitingFromTouch) { + endOrbitMode(event); + isOrbitingFromTouch = false; + } + if (isPanningFromTouch) { + print("touchEndEvent... calling endPanMode()"); + endPanMode(event); + isPanningFromTouch = false; + } +} function update() { var newWindowDimensions = Controller.getViewportDimensions(); @@ -976,6 +1183,10 @@ Controller.mouseReleaseEvent.connect(mouseReleaseEvent); Controller.mouseMoveEvent.connect(mouseMoveEvent); Controller.keyPressEvent.connect(keyPressEvent); Controller.keyReleaseEvent.connect(keyReleaseEvent); +Controller.touchBeginEvent.connect(touchBeginEvent); +Controller.touchUpdateEvent.connect(touchUpdateEvent); +Controller.touchEndEvent.connect(touchEndEvent); + function scriptEnding() { Overlays.deleteOverlay(voxelPreview); From fb06512e67d88abbebb3fc7d27ff433378ce1efc Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Thu, 20 Feb 2014 23:47:46 -0800 Subject: [PATCH 02/14] improve z fighting adjust for preview voxels and highlights --- examples/editVoxels.js | 77 ++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 59cb56fab6..4e1dff008b 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -24,6 +24,9 @@ var ORBIT_RATE_ALTITUDE = 200.0; var ORBIT_RATE_AZIMUTH = 90.0; var PIXELS_PER_EXTRUDE_VOXEL = 16; +var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting +var previewLineWidth = 1.5; + var oldMode = Camera.getMode(); var key_alt = false; @@ -98,7 +101,7 @@ var linePreviewTop = Overlays.addOverlay("line3d", { color: { red: 255, green: 255, blue: 255}, alpha: 1, visible: false, - lineWidth: 1 + lineWidth: previewLineWidth }); var linePreviewBottom = Overlays.addOverlay("line3d", { @@ -107,7 +110,7 @@ var linePreviewBottom = Overlays.addOverlay("line3d", { color: { red: 255, green: 255, blue: 255}, alpha: 1, visible: false, - lineWidth: 1 + lineWidth: previewLineWidth }); var linePreviewLeft = Overlays.addOverlay("line3d", { @@ -116,7 +119,7 @@ var linePreviewLeft = Overlays.addOverlay("line3d", { color: { red: 255, green: 255, blue: 255}, alpha: 1, visible: false, - lineWidth: 1 + lineWidth: previewLineWidth }); var linePreviewRight = Overlays.addOverlay("line3d", { @@ -125,7 +128,7 @@ var linePreviewRight = Overlays.addOverlay("line3d", { color: { red: 255, green: 255, blue: 255}, alpha: 1, visible: false, - lineWidth: 1 + lineWidth: previewLineWidth }); @@ -356,82 +359,82 @@ function calculateVoxelFromIntersection(intersection, operation) { // now we also want to calculate the "edge square" for the face for this voxel if (intersection.face == "MIN_X_FACE") { - highlightAt.x = intersection.voxel.x; + highlightAt.x = intersection.voxel.x - zFightingSizeAdjust; resultVoxel.x = intersection.voxel.x; if (operation == "add") { resultVoxel.x -= voxelSize; } - resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z }; - resultVoxel.bottomRight = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z + voxelSize }; - resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y + voxelSize, z: highlightAt.z }; - resultVoxel.topRight = {x: highlightAt.x, y: highlightAt.y + voxelSize, z: highlightAt.z + voxelSize }; + resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z + zFightingSizeAdjust }; + resultVoxel.bottomRight = {x: highlightAt.x, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z + voxelSize - zFightingSizeAdjust }; + resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z + zFightingSizeAdjust }; + resultVoxel.topRight = {x: highlightAt.x, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z + voxelSize - zFightingSizeAdjust }; } else if (intersection.face == "MAX_X_FACE") { - highlightAt.x = intersection.voxel.x + intersection.voxel.s; + highlightAt.x = intersection.voxel.x + intersection.voxel.s + zFightingSizeAdjust; resultVoxel.x = intersection.voxel.x + intersection.voxel.s; if (operation != "add") { resultVoxel.x -= voxelSize; } - resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z }; - resultVoxel.bottomRight = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z + voxelSize }; - resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y + voxelSize, z: highlightAt.z }; - resultVoxel.topRight = {x: highlightAt.x, y: highlightAt.y + voxelSize, z: highlightAt.z + voxelSize }; + resultVoxel.bottomRight = {x: highlightAt.x, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z + zFightingSizeAdjust }; + resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z + voxelSize - zFightingSizeAdjust }; + resultVoxel.topRight = {x: highlightAt.x, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z + zFightingSizeAdjust }; + resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z + voxelSize - zFightingSizeAdjust }; } else if (intersection.face == "MIN_Y_FACE") { - highlightAt.y = intersection.voxel.y; + highlightAt.y = intersection.voxel.y - zFightingSizeAdjust; resultVoxel.y = intersection.voxel.y; if (operation == "add") { resultVoxel.y -= voxelSize; } - resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z }; - resultVoxel.bottomRight = {x: highlightAt.x + voxelSize , y: highlightAt.y, z: highlightAt.z}; - resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z + voxelSize }; - resultVoxel.topRight = {x: highlightAt.x + voxelSize , y: highlightAt.y, z: highlightAt.z + voxelSize}; + resultVoxel.topRight = {x: highlightAt.x + zFightingSizeAdjust , y: highlightAt.y, z: highlightAt.z + zFightingSizeAdjust }; + resultVoxel.topLeft = {x: highlightAt.x + voxelSize - zFightingSizeAdjust, y: highlightAt.y, z: highlightAt.z + zFightingSizeAdjust }; + resultVoxel.bottomRight = {x: highlightAt.x + zFightingSizeAdjust , y: highlightAt.y, z: highlightAt.z + voxelSize - zFightingSizeAdjust }; + resultVoxel.bottomLeft = {x: highlightAt.x + voxelSize - zFightingSizeAdjust , y: highlightAt.y, z: highlightAt.z + voxelSize - zFightingSizeAdjust }; } else if (intersection.face == "MAX_Y_FACE") { - highlightAt.y = intersection.voxel.y + intersection.voxel.s; + highlightAt.y = intersection.voxel.y + intersection.voxel.s + zFightingSizeAdjust; resultVoxel.y = intersection.voxel.y + intersection.voxel.s; if (operation != "add") { resultVoxel.y -= voxelSize; } - resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z }; - resultVoxel.bottomRight = {x: highlightAt.x + voxelSize , y: highlightAt.y, z: highlightAt.z}; - resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z + voxelSize }; - resultVoxel.topRight = {x: highlightAt.x + voxelSize , y: highlightAt.y, z: highlightAt.z + voxelSize}; + resultVoxel.bottomRight = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y, z: highlightAt.z + zFightingSizeAdjust }; + resultVoxel.bottomLeft = {x: highlightAt.x + voxelSize - zFightingSizeAdjust, y: highlightAt.y, z: highlightAt.z + zFightingSizeAdjust}; + resultVoxel.topRight = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y, z: highlightAt.z + voxelSize - zFightingSizeAdjust}; + resultVoxel.topLeft = {x: highlightAt.x + voxelSize - zFightingSizeAdjust, y: highlightAt.y, z: highlightAt.z + voxelSize - zFightingSizeAdjust}; } else if (intersection.face == "MIN_Z_FACE") { - highlightAt.z = intersection.voxel.z; + highlightAt.z = intersection.voxel.z - zFightingSizeAdjust; resultVoxel.z = intersection.voxel.z; if (operation == "add") { resultVoxel.z -= voxelSize; } - resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z }; - resultVoxel.bottomRight = {x: highlightAt.x + voxelSize , y: highlightAt.y, z: highlightAt.z}; - resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y + voxelSize, z: highlightAt.z }; - resultVoxel.topRight = {x: highlightAt.x + voxelSize , y: highlightAt.y + voxelSize, z: highlightAt.z}; + resultVoxel.bottomRight = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z }; + resultVoxel.bottomLeft = {x: highlightAt.x + voxelSize - zFightingSizeAdjust, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z}; + resultVoxel.topRight = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z }; + resultVoxel.topLeft = {x: highlightAt.x + voxelSize - zFightingSizeAdjust, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z}; } else if (intersection.face == "MAX_Z_FACE") { - highlightAt.z = intersection.voxel.z + intersection.voxel.s; + highlightAt.z = intersection.voxel.z + intersection.voxel.s + zFightingSizeAdjust; resultVoxel.z = intersection.voxel.z + intersection.voxel.s; if (operation != "add") { resultVoxel.z -= voxelSize; } - resultVoxel.bottomLeft = {x: highlightAt.x, y: highlightAt.y, z: highlightAt.z }; - resultVoxel.bottomRight = {x: highlightAt.x + voxelSize , y: highlightAt.y, z: highlightAt.z}; - resultVoxel.topLeft = {x: highlightAt.x, y: highlightAt.y + voxelSize, z: highlightAt.z }; - resultVoxel.topRight = {x: highlightAt.x + voxelSize , y: highlightAt.y + voxelSize, z: highlightAt.z}; + resultVoxel.bottomLeft = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z }; + resultVoxel.bottomRight = {x: highlightAt.x + voxelSize - zFightingSizeAdjust, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z}; + resultVoxel.topLeft = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z }; + resultVoxel.topRight = {x: highlightAt.x + voxelSize - zFightingSizeAdjust, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z}; } @@ -466,7 +469,7 @@ function showPreviewVoxel() { guidePosition = calculateVoxelFromIntersection(intersection,"delete"); Overlays.editOverlay(voxelPreview, { position: guidePosition, - size: guidePosition.s, + size: guidePosition.s + zFightingSizeAdjust, visible: true, color: { red: 255, green: 0, blue: 0 }, solid: false, @@ -477,7 +480,7 @@ function showPreviewVoxel() { Overlays.editOverlay(voxelPreview, { position: guidePosition, - size: guidePosition.s + 0.002, + size: guidePosition.s + zFightingSizeAdjust, visible: true, color: voxelColor, solid: true, @@ -490,7 +493,7 @@ function showPreviewVoxel() { Overlays.editOverlay(voxelPreview, { position: guidePosition, - size: guidePosition.s, + size: (guidePosition.s - zFightingSizeAdjust), visible: true, color: voxelColor, solid: true, From 8dac269c3cd0437f010be41944abde6a799b02e6 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 21 Feb 2014 00:27:40 -0800 Subject: [PATCH 03/14] added selectable tools to the tool palette --- examples/editVoxels.js | 140 +++++++++++++++++++++++++++++------------ 1 file changed, 101 insertions(+), 39 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 4e1dff008b..0ab94918c0 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -29,8 +29,6 @@ var previewLineWidth = 1.5; var oldMode = Camera.getMode(); -var key_alt = false; -var key_shift = false; var isAdding = false; var isExtruding = false; var isOrbiting = false; @@ -54,8 +52,6 @@ var dragStart = { x: 0, y: 0 }; var mouseX = 0; var mouseY = 0; - - // Create a table of the different colors you can choose var colors = new Array(); colors[0] = { red: 237, green: 175, blue: 0 }; @@ -337,6 +333,12 @@ var trackAsRecolor = false; var trackAsEyedropper = false; var trackAsOrbitOrPan = false; +var addToolSelected = true; +var deleteToolSelected = false; +var recolorToolSelected = false; +var eyedropperToolSelected = false; +var selectToolSelected = false; + function calculateVoxelFromIntersection(intersection, operation) { //print("calculateVoxelFromIntersection() operation="+operation); var resultVoxel; @@ -465,7 +467,7 @@ function showPreviewVoxel() { var guidePosition; - if (trackAsDelete) { + if (trackAsDelete || deleteToolSelected) { guidePosition = calculateVoxelFromIntersection(intersection,"delete"); Overlays.editOverlay(voxelPreview, { position: guidePosition, @@ -475,7 +477,17 @@ function showPreviewVoxel() { solid: false, alpha: 1 }); - } else if (trackAsRecolor || trackAsEyedropper) { + } else if (selectToolSelected) { + guidePosition = calculateVoxelFromIntersection(intersection,"select"); + Overlays.editOverlay(voxelPreview, { + position: guidePosition, + size: guidePosition.s + zFightingSizeAdjust, + visible: true, + color: { red: 255, green: 255, blue: 0 }, + solid: false, + alpha: 1 + }); + } else if (trackAsRecolor || recolorToolSelected || trackAsEyedropper|| eyedropperToolSelected) { guidePosition = calculateVoxelFromIntersection(intersection,"recolor"); Overlays.editOverlay(voxelPreview, { @@ -488,7 +500,7 @@ function showPreviewVoxel() { }); } else if (trackAsOrbitOrPan) { Overlays.editOverlay(voxelPreview, { visible: false }); - } else if (!isExtruding) { + } else if (addToolSelected && !isExtruding) { guidePosition = calculateVoxelFromIntersection(intersection,"add"); Overlays.editOverlay(voxelPreview, { @@ -517,12 +529,25 @@ function showPreviewLines() { } resultVoxel = calculateVoxelFromIntersection(intersection,""); - Overlays.editOverlay(linePreviewTop, { position: resultVoxel.topLeft, end: resultVoxel.topRight, visible: true }); - Overlays.editOverlay(linePreviewBottom, { position: resultVoxel.bottomLeft, end: resultVoxel.bottomRight, visible: true }); - Overlays.editOverlay(linePreviewLeft, { position: resultVoxel.topLeft, end: resultVoxel.bottomLeft, visible: true }); - Overlays.editOverlay(linePreviewRight, { position: resultVoxel.topRight, end: resultVoxel.bottomRight, visible: true }); - + if (selectToolSelected) { + Overlays.editOverlay(voxelPreview, { + position: resultVoxel, + size: resultVoxel.s + zFightingSizeAdjust, + visible: true, + color: { red: 255, green: 255, blue: 255 }, + lineWidth: previewLineWidth, + solid: false, + alpha: 1 + }); + } else { + Overlays.editOverlay(voxelPreview, { visible: false }); + Overlays.editOverlay(linePreviewTop, { position: resultVoxel.topLeft, end: resultVoxel.topRight, visible: true }); + Overlays.editOverlay(linePreviewBottom, { position: resultVoxel.bottomLeft, end: resultVoxel.bottomRight, visible: true }); + Overlays.editOverlay(linePreviewLeft, { position: resultVoxel.topLeft, end: resultVoxel.bottomLeft, visible: true }); + Overlays.editOverlay(linePreviewRight, { position: resultVoxel.topRight, end: resultVoxel.bottomRight, visible: true }); + } } else { + Overlays.editOverlay(voxelPreview, { visible: false }); Overlays.editOverlay(linePreviewTop, { visible: false }); Overlays.editOverlay(linePreviewBottom, { visible: false }); Overlays.editOverlay(linePreviewLeft, { visible: false }); @@ -542,9 +567,6 @@ function showPreviewGuides() { Overlays.editOverlay(linePreviewRight, { visible: false }); } else { showPreviewLines(); - - // make sure alternative is hidden - Overlays.editOverlay(voxelPreview, { visible: false }); } } else { // make sure all previews are off @@ -656,7 +678,7 @@ function startOrbitMode(event) { orbitAzimuth = Math.atan2(orbitVector.z, orbitVector.x); orbitAltitude = Math.asin(orbitVector.y / Vec3.length(orbitVector)); - print("startOrbitMode..."); + //print("startOrbitMode..."); } function handleOrbitingMove(event) { @@ -674,7 +696,7 @@ function handleOrbitingMove(event) { Camera.setPosition(orbitPosition); mouseX = event.x; mouseY = event.y; - print("handleOrbitingMove..."); + //print("handleOrbitingMove..."); } function endOrbitMode(event) { @@ -685,7 +707,7 @@ function endOrbitMode(event) { Camera.stopLooking(); Camera.setMode(oldMode); Camera.setOrientation(cameraOrientation); - print("endOrbitMode..."); + //print("endOrbitMode..."); } function startPanMode(event, intersection) { @@ -694,7 +716,8 @@ function startPanMode(event, intersection) { } function handlePanMove(event) { - print("PANNING mode!!! isPanning="+isPanning + " inPanningFromTouch="+isPanningFromTouch + " trackAsOrbitOrPan="+trackAsOrbitOrPan); + print("PANNING mode!!! "); + //print("isPanning="+isPanning + " inPanningFromTouch="+isPanningFromTouch + " trackAsOrbitOrPan="+trackAsOrbitOrPan); } function endPanMode(event) { @@ -736,30 +759,72 @@ function mousePressEvent(event) { // no clicking on overlays while in panning mode if (!trackAsOrbitOrPan) { - var clickedOnSwatch = false; + var clickedOnSomething = false; var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y}); + +print("clickedOverlay="+clickedOverlay); // If the user clicked on the thumb, handle the slider logic if (clickedOverlay == thumb) { isMovingSlider = true; thumbClickOffsetX = event.x - (sliderX + thumbX); // this should be the position of the mouse relative to the thumb - return; // no further processing + clickedOnSomething = true; + } else if (clickedOverlay == addTool) { + addToolSelected = true; + deleteToolSelected = false; + recolorToolSelected = false; + eyedropperToolSelected = false; + selectToolSelected = false; + moveTools(); + clickedOnSomething = true; + } else if (clickedOverlay == deleteTool) { + addToolSelected = false; + deleteToolSelected = true; + recolorToolSelected = false; + eyedropperToolSelected = false; + selectToolSelected = false; + moveTools(); + clickedOnSomething = true; + } else if (clickedOverlay == recolorTool) { + addToolSelected = false; + deleteToolSelected = false; + recolorToolSelected = true; + eyedropperToolSelected = false; + selectToolSelected = false; + moveTools(); + clickedOnSomething = true; + } else if (clickedOverlay == eyedropperTool) { + addToolSelected = false; + deleteToolSelected = false; + recolorToolSelected = false; + eyedropperToolSelected = true; + selectToolSelected = false; + moveTools(); + clickedOnSomething = true; + } else if (clickedOverlay == selectTool) { + addToolSelected = false; + deleteToolSelected = false; + recolorToolSelected = false; + eyedropperToolSelected = false; + selectToolSelected = true; + moveTools(); + clickedOnSomething = true; } else { // if the user clicked on one of the color swatches, update the selectedSwatch for (s = 0; s < numColors; s++) { if (clickedOverlay == swatches[s]) { whichColor = s; moveTools(); - clickedOnSwatch = true; + clickedOnSomething = true; + break; } } - if (clickedOnSwatch) { - return; // no further processing - } + } + if (clickedOnSomething) { + return; // no further processing } } - // TODO: does any of this stuff need to execute if we're panning or orbiting? trackMouseEvent(event); // used by preview support mouseX = event.x; @@ -783,13 +848,13 @@ function mousePressEvent(event) { startPanMode(event); isPanning = true; } - } else if (trackAsDelete || (event.isRightButton && !trackAsEyedropper)) { + } else if (deleteToolSelected || trackAsDelete || (event.isRightButton && !trackAsEyedropper)) { // Delete voxel voxelDetails = calculateVoxelFromIntersection(intersection,"delete"); Voxels.eraseVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s); Audio.playSound(deleteSound, audioOptions); Overlays.editOverlay(voxelPreview, { visible: false }); - } else if (trackAsEyedropper) { + } else if (eyedropperToolSelected || trackAsEyedropper) { if (whichColor != -1) { colors[whichColor].red = intersection.voxel.red; colors[whichColor].green = intersection.voxel.green; @@ -797,7 +862,7 @@ function mousePressEvent(event) { moveTools(); } - } else if (trackAsRecolor) { + } else if (recolorToolSelected || trackAsRecolor) { // Recolor Voxel voxelDetails = calculateVoxelFromIntersection(intersection,"recolor"); @@ -807,7 +872,7 @@ function mousePressEvent(event) { colors[whichColor].red, colors[whichColor].green, colors[whichColor].blue); Audio.playSound(changeColorSound, audioOptions); Overlays.editOverlay(voxelPreview, { visible: false }); - } else { + } else if (addToolSelected) { // Add voxel on face if (whichColor == -1) { // Copy mode - use clicked voxel color @@ -833,15 +898,13 @@ function mousePressEvent(event) { Overlays.editOverlay(voxelPreview, { visible: false }); dragStart = { x: event.x, y: event.y }; isAdding = true; - } + } } } function keyPressEvent(event) { // if our tools are off, then don't do anything if (editToolsOn) { - key_alt = event.isAlt; - key_shift = event.isShifted; var nVal = parseInt(event.text); if (event.text == "0") { print("Color = Copy"); @@ -884,8 +947,6 @@ function keyPressEvent(event) { function keyReleaseEvent(event) { trackKeyReleaseEvent(event); // used by preview support - key_alt = false; - key_shift = false; } @@ -1024,12 +1085,14 @@ function moveTools() { eyedropperToolColor = notSelectedColor; selectToolColor = notSelectedColor; - if (trackAsDelete) { + if (trackAsDelete || deleteToolSelected) { deleteToolColor = toolSelectedColor; - } else if (trackAsRecolor) { + } else if (trackAsRecolor || recolorToolSelected) { recolorToolColor = toolSelectedColor; - } else if (trackAsEyedropper) { + } else if (trackAsEyedropper || eyedropperToolSelected) { eyedropperToolColor = toolSelectedColor; + } else if (selectToolSelected) { + selectToolColor = toolSelectedColor; } else if (trackAsOrbitOrPan) { // nothing gets selected in this case... } else { @@ -1066,7 +1129,6 @@ function moveTools() { visible: editToolsOn }); - sliderX = swatchesX + swatchesWidth; sliderY = windowDimensions.y - sliderHeight; Overlays.editOverlay(slider, { x: sliderX, y: sliderY, visible: editToolsOn }); From 03d6173c90d7c80b5dc1287be32811f1cd70a8bd Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 11:38:23 -0800 Subject: [PATCH 04/14] add Voxels.getFaceVector() to JS --- .../voxels/src/VoxelsScriptingInterface.cpp | 18 ++++++++++++++++++ .../voxels/src/VoxelsScriptingInterface.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/libraries/voxels/src/VoxelsScriptingInterface.cpp b/libraries/voxels/src/VoxelsScriptingInterface.cpp index c0468ccca6..bc9639f6a9 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.cpp +++ b/libraries/voxels/src/VoxelsScriptingInterface.cpp @@ -64,3 +64,21 @@ RayToVoxelIntersectionResult VoxelsScriptingInterface::findRayIntersection(const } return result; } + +glm::vec3 VoxelsScriptingInterface::getFaceVector(const QString& face) { + if (face == "MIN_X_FACE") { + return glm::vec3(-1, 0, 0); + } else if (face == "MAX_X_FACE") { + return glm::vec3(1, 0, 0); + } else if (face == "MIN_Y_FACE") { + return glm::vec3(0, -1, 0); + } else if (face == "MAX_Y_FACE") { + return glm::vec3(0, 1, 0); + } else if (face == "MIN_Z_FACE") { + return glm::vec3(0, 0, -1); + } else if (face == "MAX_Z_FACE") { + return glm::vec3(0, 0, 1); + } + return glm::vec3(0, 0, 0); //error case +} + diff --git a/libraries/voxels/src/VoxelsScriptingInterface.h b/libraries/voxels/src/VoxelsScriptingInterface.h index f87e8d0a4c..88363bef39 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.h +++ b/libraries/voxels/src/VoxelsScriptingInterface.h @@ -60,6 +60,9 @@ public slots: /// If the scripting context has visible voxels, this will determine a ray intersection RayToVoxelIntersectionResult findRayIntersection(const PickRay& ray); + /// returns a voxel space axis aligned vector for the face, useful in doing voxel math + glm::vec3 getFaceVector(const QString& face); + private: void queueVoxelAdd(PacketType addPacketType, VoxelDetail& addVoxelDetails); VoxelTree* _tree; From 9831fb57971c446d35a0acba4cb48a493f397268 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 12:09:53 -0800 Subject: [PATCH 05/14] fix calculateVoxelFromIntersection() in editVoxels.js to work same as C++ code for voxel sizes larger than intersecting voxel --- examples/editVoxels.js | 100 ++++++++++++++++++++++++++++------------- 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 0ab94918c0..219589f78d 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -25,7 +25,7 @@ var ORBIT_RATE_AZIMUTH = 90.0; var PIXELS_PER_EXTRUDE_VOXEL = 16; var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting -var previewLineWidth = 1.5; +var previewLineWidth = 3; // 1.5; var oldMode = Camera.getMode(); @@ -339,9 +339,22 @@ var recolorToolSelected = false; var eyedropperToolSelected = false; var selectToolSelected = false; + function calculateVoxelFromIntersection(intersection, operation) { //print("calculateVoxelFromIntersection() operation="+operation); var resultVoxel; + + var wantDebug = false; + if (wantDebug) { + print(">>>>> calculateVoxelFromIntersection().... intersection voxel.red/green/blue=" + intersection.voxel.red + ", " + + intersection.voxel.green + ", " + intersection.voxel.blue); + print(" intersection voxel.x/y/z/s=" + intersection.voxel.x + ", " + + intersection.voxel.y + ", " + intersection.voxel.z+ ": " + intersection.voxel.s); + print(" intersection face=" + intersection.face); + print(" intersection distance=" + intersection.distance); + print(" intersection intersection.x/y/z=" + intersection.intersection.x + ", " + + intersection.intersection.y + ", " + intersection.intersection.z); + } var voxelSize; if (pointerVoxelScaleSet) { @@ -350,20 +363,48 @@ function calculateVoxelFromIntersection(intersection, operation) { voxelSize = intersection.voxel.s; } - // first, calculate the enclosed voxel of size voxelSize that the intersection point falls inside of. - // if you have a voxelSize that's smaller than the voxel you're intersecting, this calculation will result - // in the subvoxel that the intersection point falls in - var x = Math.floor(intersection.intersection.x / voxelSize) * voxelSize; - var y = Math.floor(intersection.intersection.y / voxelSize) * voxelSize; - var z = Math.floor(intersection.intersection.z / voxelSize) * voxelSize; + var x; + var y; + var z; + + // if our "target voxel size" is larger than the voxel we intersected with, then we need to find the closest + // ancestor voxel of our target size that contains our intersected voxel. + if (voxelSize > intersection.voxel.s) { + if (wantDebug) { + print("voxelSize > intersection.voxel.s.... choose the larger voxel that encompasses the one selected"); + } + x = Math.floor(intersection.voxel.x / voxelSize) * voxelSize; + y = Math.floor(intersection.voxel.y / voxelSize) * voxelSize; + z = Math.floor(intersection.voxel.z / voxelSize) * voxelSize; + } else { + // otherwise, calculate the enclosed voxel of size voxelSize that the intersection point falls inside of. + // if you have a voxelSize that's smaller than the voxel you're intersecting, this calculation will result + // in the subvoxel that the intersection point falls in, if the target voxelSize matches the intersecting + // voxel this still works and results in returning the intersecting voxel which is what we want + var adjustToCenter = Vec3.multiply(Voxels.getFaceVector(intersection.face), (voxelSize * -0.5)); + if (wantDebug) { + print("adjustToCenter=" + adjustToCenter.x + "," + adjustToCenter.y + "," + adjustToCenter.z); + } + var centerOfIntersectingVoxel = Vec3.sum(intersection.intersection, adjustToCenter); + x = Math.floor(centerOfIntersectingVoxel.x / voxelSize) * voxelSize; + y = Math.floor(centerOfIntersectingVoxel.y / voxelSize) * voxelSize; + z = Math.floor(centerOfIntersectingVoxel.z / voxelSize) * voxelSize; + } resultVoxel = { x: x, y: y, z: z, s: voxelSize }; highlightAt = { x: x, y: y, z: z, s: voxelSize }; + // we only do the "add to the face we're pointing at" adjustment, if the operation is an add + // operation, and the target voxel size is equal to or smaller than the intersecting voxel. + var wantAddAdjust = (operation == "add" && (voxelSize <= intersection.voxel.s)); + if (wantDebug) { + print("wantAddAdjust="+wantAddAdjust); + } + // now we also want to calculate the "edge square" for the face for this voxel if (intersection.face == "MIN_X_FACE") { - highlightAt.x = intersection.voxel.x - zFightingSizeAdjust; - resultVoxel.x = intersection.voxel.x; - if (operation == "add") { + + highlightAt.x = x - zFightingSizeAdjust; + if (wantAddAdjust) { resultVoxel.x -= voxelSize; } @@ -373,10 +414,10 @@ function calculateVoxelFromIntersection(intersection, operation) { resultVoxel.topRight = {x: highlightAt.x, y: highlightAt.y + voxelSize - zFightingSizeAdjust, z: highlightAt.z + voxelSize - zFightingSizeAdjust }; } else if (intersection.face == "MAX_X_FACE") { - highlightAt.x = intersection.voxel.x + intersection.voxel.s + zFightingSizeAdjust; - resultVoxel.x = intersection.voxel.x + intersection.voxel.s; - if (operation != "add") { - resultVoxel.x -= voxelSize; + + highlightAt.x = x + voxelSize + zFightingSizeAdjust; + if (wantAddAdjust) { + resultVoxel.x += resultVoxel.s; } resultVoxel.bottomRight = {x: highlightAt.x, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z + zFightingSizeAdjust }; @@ -386,10 +427,8 @@ function calculateVoxelFromIntersection(intersection, operation) { } else if (intersection.face == "MIN_Y_FACE") { - highlightAt.y = intersection.voxel.y - zFightingSizeAdjust; - resultVoxel.y = intersection.voxel.y; - - if (operation == "add") { + highlightAt.y = y - zFightingSizeAdjust; + if (wantAddAdjust) { resultVoxel.y -= voxelSize; } @@ -400,10 +439,9 @@ function calculateVoxelFromIntersection(intersection, operation) { } else if (intersection.face == "MAX_Y_FACE") { - highlightAt.y = intersection.voxel.y + intersection.voxel.s + zFightingSizeAdjust; - resultVoxel.y = intersection.voxel.y + intersection.voxel.s; - if (operation != "add") { - resultVoxel.y -= voxelSize; + highlightAt.y = y + voxelSize + zFightingSizeAdjust; + if (wantAddAdjust) { + resultVoxel.y += voxelSize; } resultVoxel.bottomRight = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y, z: highlightAt.z + zFightingSizeAdjust }; @@ -413,10 +451,8 @@ function calculateVoxelFromIntersection(intersection, operation) { } else if (intersection.face == "MIN_Z_FACE") { - highlightAt.z = intersection.voxel.z - zFightingSizeAdjust; - resultVoxel.z = intersection.voxel.z; - - if (operation == "add") { + highlightAt.z = z - zFightingSizeAdjust; + if (wantAddAdjust) { resultVoxel.z -= voxelSize; } @@ -427,10 +463,9 @@ function calculateVoxelFromIntersection(intersection, operation) { } else if (intersection.face == "MAX_Z_FACE") { - highlightAt.z = intersection.voxel.z + intersection.voxel.s + zFightingSizeAdjust; - resultVoxel.z = intersection.voxel.z + intersection.voxel.s; - if (operation != "add") { - resultVoxel.z -= voxelSize; + highlightAt.z = z + voxelSize + zFightingSizeAdjust; + if (wantAddAdjust) { + resultVoxel.z += voxelSize; } resultVoxel.bottomLeft = {x: highlightAt.x + zFightingSizeAdjust, y: highlightAt.y + zFightingSizeAdjust, z: highlightAt.z }; @@ -534,7 +569,7 @@ function showPreviewLines() { position: resultVoxel, size: resultVoxel.s + zFightingSizeAdjust, visible: true, - color: { red: 255, green: 255, blue: 255 }, + color: { red: 0, green: 255, blue: 0 }, lineWidth: previewLineWidth, solid: false, alpha: 1 @@ -888,6 +923,7 @@ print("clickedOverlay="+clickedOverlay); } voxelDetails = calculateVoxelFromIntersection(intersection,"add"); + Voxels.eraseVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s); Voxels.setVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s, newColor.red, newColor.green, newColor.blue); lastVoxelPosition = { x: voxelDetails.x, y: voxelDetails.y, z: voxelDetails.z }; @@ -929,6 +965,7 @@ function keyPressEvent(event) { red: colors[color].red, green: colors[color].green, blue: colors[color].blue }; + Voxels.eraseVoxel(newVoxel.x, newVoxel.y, newVoxel.z, newVoxel.s); Voxels.setVoxel(newVoxel.x, newVoxel.y, newVoxel.z, newVoxel.s, newVoxel.red, newVoxel.green, newVoxel.blue); setAudioPosition(); Audio.playSound(addSound, audioOptions); @@ -1017,6 +1054,7 @@ function mouseMoveEvent(event) { var dy = event.y - mouseY; if (Math.sqrt(dx*dx + dy*dy) > PIXELS_PER_EXTRUDE_VOXEL) { lastVoxelPosition = Vec3.sum(lastVoxelPosition, extrudeDirection); + Voxels.eraseVoxel(lastVoxelPosition.x, lastVoxelPosition.y, lastVoxelPosition.z,extrudeScale); Voxels.setVoxel(lastVoxelPosition.x, lastVoxelPosition.y, lastVoxelPosition.z, extrudeScale, lastVoxelColor.red, lastVoxelColor.green, lastVoxelColor.blue); mouseX = event.x; From f1577d12a018d7ee31f314aa5236f79f9e9811f0 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 12:36:38 -0800 Subject: [PATCH 06/14] make changes to local tree in Voxels JS interface --- examples/editVoxels.js | 3 --- .../voxels/src/VoxelsScriptingInterface.cpp | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 219589f78d..31a8e7a787 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -923,7 +923,6 @@ print("clickedOverlay="+clickedOverlay); } voxelDetails = calculateVoxelFromIntersection(intersection,"add"); - Voxels.eraseVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s); Voxels.setVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s, newColor.red, newColor.green, newColor.blue); lastVoxelPosition = { x: voxelDetails.x, y: voxelDetails.y, z: voxelDetails.z }; @@ -965,7 +964,6 @@ function keyPressEvent(event) { red: colors[color].red, green: colors[color].green, blue: colors[color].blue }; - Voxels.eraseVoxel(newVoxel.x, newVoxel.y, newVoxel.z, newVoxel.s); Voxels.setVoxel(newVoxel.x, newVoxel.y, newVoxel.z, newVoxel.s, newVoxel.red, newVoxel.green, newVoxel.blue); setAudioPosition(); Audio.playSound(addSound, audioOptions); @@ -1054,7 +1052,6 @@ function mouseMoveEvent(event) { var dy = event.y - mouseY; if (Math.sqrt(dx*dx + dy*dy) > PIXELS_PER_EXTRUDE_VOXEL) { lastVoxelPosition = Vec3.sum(lastVoxelPosition, extrudeDirection); - Voxels.eraseVoxel(lastVoxelPosition.x, lastVoxelPosition.y, lastVoxelPosition.z,extrudeScale); Voxels.setVoxel(lastVoxelPosition.x, lastVoxelPosition.y, lastVoxelPosition.z, extrudeScale, lastVoxelColor.red, lastVoxelColor.green, lastVoxelColor.blue); mouseX = event.x; diff --git a/libraries/voxels/src/VoxelsScriptingInterface.cpp b/libraries/voxels/src/VoxelsScriptingInterface.cpp index bc9639f6a9..719df8dccf 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.cpp +++ b/libraries/voxels/src/VoxelsScriptingInterface.cpp @@ -20,6 +20,13 @@ void VoxelsScriptingInterface::setVoxelNonDestructive(float x, float y, float z, // queue the packet queueVoxelAdd(PacketTypeVoxelSet, addVoxelDetail); + + // handle the local tree also... + if (_tree) { + _tree->lockForWrite(); + _tree->createVoxel(addVoxelDetail.x, addVoxelDetail.y, addVoxelDetail.z, addVoxelDetail.s, red, green, blue, false); + _tree->unlock(); + } } void VoxelsScriptingInterface::setVoxel(float x, float y, float z, float scale, @@ -30,6 +37,13 @@ void VoxelsScriptingInterface::setVoxel(float x, float y, float z, float scale, // queue the destructive add queueVoxelAdd(PacketTypeVoxelSetDestructive, addVoxelDetail); + + // handle the local tree also... + if (_tree) { + _tree->lockForWrite(); + _tree->createVoxel(addVoxelDetail.x, addVoxelDetail.y, addVoxelDetail.z, addVoxelDetail.s, red, green, blue, true); + _tree->unlock(); + } } void VoxelsScriptingInterface::eraseVoxel(float x, float y, float z, float scale) { @@ -39,6 +53,13 @@ void VoxelsScriptingInterface::eraseVoxel(float x, float y, float z, float scale scale / (float)TREE_SCALE, 0, 0, 0}; getVoxelPacketSender()->queueVoxelEditMessages(PacketTypeVoxelErase, 1, &deleteVoxelDetail); + + // handle the local tree also... + if (_tree) { + _tree->lockForWrite(); + _tree->deleteVoxelAt(deleteVoxelDetail.x, deleteVoxelDetail.y, deleteVoxelDetail.z, deleteVoxelDetail.s); + _tree->unlock(); + } } From 78de562f4164ad47c9b3619df461182632c07ea4 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 12:52:41 -0800 Subject: [PATCH 07/14] added clipboard support to editVoxels.js --- examples/editVoxels.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 31a8e7a787..fa0f130fd7 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -982,6 +982,44 @@ function keyPressEvent(event) { function keyReleaseEvent(event) { trackKeyReleaseEvent(event); // used by preview support + + // handle clipboard items + if (selectToolSelected) { + var pickRay = Camera.computePickRay(trackLastMouseX, trackLastMouseY); + var intersection = Voxels.findRayIntersection(pickRay); + selectedVoxel = calculateVoxelFromIntersection(intersection,"select"); + + // Note: this sample uses Alt+ as the key codes for these clipboard items + if ((event.key == 199 || event.key == 67 || event.text == "C" || event.text == "c") && event.isAlt) { + print("the Alt+C key was pressed... copy"); + Clipboard.copyVoxel(selectedVoxel.x, selectedVoxel.y, selectedVoxel.z, selectedVoxel.s); + } + if ((event.key == 8776 || event.key == 88 || event.text == "X" || event.text == "x") && event.isAlt) { + print("the Alt+X key was pressed... cut"); + Clipboard.cutVoxel(selectedVoxel.x, selectedVoxel.y, selectedVoxel.z, selectedVoxel.s); + } + if ((event.key == 8730 || event.key == 86 || event.text == "V" || event.text == "v") && event.isAlt) { + print("the Alt+V key was pressed... paste"); + Clipboard.pasteVoxel(selectedVoxel.x, selectedVoxel.y, selectedVoxel.z, selectedVoxel.s); + } + if (event.text == "DELETE" || event.text == "BACKSPACE") { + print("the DELETE/BACKSPACE key was pressed... delete"); + Clipboard.deleteVoxel(selectedVoxel.x, selectedVoxel.y, selectedVoxel.z, selectedVoxel.s); + } + + if ((event.text == "E" || event.text == "e") && event.isMeta) { + print("the Ctl+E key was pressed... export"); + Clipboard.exportVoxel(selectedVoxel.x, selectedVoxel.y, selectedVoxel.z, selectedVoxel.s); + } + if ((event.text == "I" || event.text == "i") && event.isMeta) { + print("the Ctl+I key was pressed... import"); + Clipboard.importVoxels(); + } + if ((event.key == 78 || event.text == "N" || event.text == "n") && event.isMeta) { + print("the Ctl+N key was pressed, nudging to left 1 meter... nudge"); + Clipboard.nudgeVoxel(selectedVoxel.x, selectedVoxel.y, selectedVoxel.z, selectedVoxel.s, { x: -1, y: 0, z: 0 }); + } + } } @@ -1286,6 +1324,8 @@ Controller.keyReleaseEvent.connect(keyReleaseEvent); Controller.touchBeginEvent.connect(touchBeginEvent); Controller.touchUpdateEvent.connect(touchUpdateEvent); Controller.touchEndEvent.connect(touchEndEvent); +Controller.captureKeyEvents({ text: "+" }); +Controller.captureKeyEvents({ text: "-" }); function scriptEnding() { @@ -1302,6 +1342,8 @@ function scriptEnding() { Overlays.deleteOverlay(recolorTool); Overlays.deleteOverlay(eyedropperTool); Overlays.deleteOverlay(selectTool); + Controller.releaseKeyEvents({ text: "+" }); + Controller.releaseKeyEvents({ text: "-" }); } Script.scriptEnding.connect(scriptEnding); From a8b34ae756d21337876a8c9444bac42cb0c5155f Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 12:58:20 -0800 Subject: [PATCH 08/14] removed some debug settings --- examples/editVoxels.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index fa0f130fd7..ce444885af 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -25,7 +25,7 @@ var ORBIT_RATE_AZIMUTH = 90.0; var PIXELS_PER_EXTRUDE_VOXEL = 16; var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting -var previewLineWidth = 3; // 1.5; +var previewLineWidth = 1.5; var oldMode = Camera.getMode(); @@ -569,7 +569,7 @@ function showPreviewLines() { position: resultVoxel, size: resultVoxel.s + zFightingSizeAdjust, visible: true, - color: { red: 0, green: 255, blue: 0 }, + color: { red: 255, green: 255, blue: 0 }, lineWidth: previewLineWidth, solid: false, alpha: 1 From 892cc01dd95652b014d64c40815367639f2cb342 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 13:18:36 -0800 Subject: [PATCH 09/14] added Voxels.getVoxelAt() to inspect local tree --- examples/rayPickExample.js | 6 +++++ .../voxels/src/VoxelsScriptingInterface.cpp | 24 +++++++++++++++++++ .../voxels/src/VoxelsScriptingInterface.h | 8 +++++++ 3 files changed, 38 insertions(+) diff --git a/examples/rayPickExample.js b/examples/rayPickExample.js index 39dc910e78..9c34cca1de 100644 --- a/examples/rayPickExample.js +++ b/examples/rayPickExample.js @@ -26,6 +26,12 @@ function mouseMoveEvent(event) { print("intersection distance=" + intersection.distance); print("intersection intersection.x/y/z=" + intersection.intersection.x + ", " + intersection.intersection.y + ", " + intersection.intersection.z); + + // also test the getVoxelAt() api which should find and return same voxel + + var voxelAt = Voxels.getVoxelAt(intersection.voxel.x, intersection.voxel.y, intersection.voxel.z, intersection.voxel.s); + print("voxelAt.x/y/z/s=" + voxelAt.x + ", " + voxelAt.y + ", " + voxelAt.z + ": " + voxelAt.s); + print("voxelAt.red/green/blue=" + voxelAt.red + ", " + voxelAt.green + ", " + voxelAt.blue); } } diff --git a/libraries/voxels/src/VoxelsScriptingInterface.cpp b/libraries/voxels/src/VoxelsScriptingInterface.cpp index 719df8dccf..1a0a234e0a 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.cpp +++ b/libraries/voxels/src/VoxelsScriptingInterface.cpp @@ -12,6 +12,30 @@ void VoxelsScriptingInterface::queueVoxelAdd(PacketType addPacketType, VoxelDeta getVoxelPacketSender()->queueVoxelEditMessages(addPacketType, 1, &addVoxelDetails); } +VoxelDetail VoxelsScriptingInterface::getVoxelAt(float x, float y, float z, float scale) { + // setup a VoxelDetail struct with the data + VoxelDetail result = {0,0,0,0,0,0,0}; + + if (_tree) { + _tree->lockForRead(); + + VoxelTreeElement* voxel = static_cast(_tree->getOctreeElementAt(x / (float)TREE_SCALE, y / (float)TREE_SCALE, + z / (float)TREE_SCALE, scale / (float)TREE_SCALE)); + _tree->unlock(); + if (voxel) { + // Note: these need to be in voxel space because the VoxelDetail -> js converter will upscale + result.x = voxel->getCorner().x; + result.y = voxel->getCorner().y; + result.z = voxel->getCorner().z; + result.s = voxel->getScale(); + result.red = voxel->getColor()[RED_INDEX]; + result.green = voxel->getColor()[GREEN_INDEX]; + result.blue = voxel->getColor()[BLUE_INDEX]; + } + } + return result; +} + void VoxelsScriptingInterface::setVoxelNonDestructive(float x, float y, float z, float scale, uchar red, uchar green, uchar blue) { // setup a VoxelDetail struct with the data diff --git a/libraries/voxels/src/VoxelsScriptingInterface.h b/libraries/voxels/src/VoxelsScriptingInterface.h index 88363bef39..fb0bd6ab03 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.h +++ b/libraries/voxels/src/VoxelsScriptingInterface.h @@ -30,6 +30,14 @@ public: void setVoxelTree(VoxelTree* tree) { _tree = tree; } public slots: + + /// checks the local voxel tree for a voxel at the specified location and scale + /// \param x the x-coordinate of the voxel (in meter units) + /// \param y the y-coordinate of the voxel (in meter units) + /// \param z the z-coordinate of the voxel (in meter units) + /// \param scale the scale of the voxel (in meter units) + VoxelDetail getVoxelAt(float x, float y, float z, float scale); + /// queues the creation of a voxel which will be sent by calling process on the PacketSender /// \param x the x-coordinate of the voxel (in meter units) /// \param y the y-coordinate of the voxel (in meter units) From 43f63781fcb08c0e76b52c14cdff5b30a7c7b64b Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 18:35:39 -0800 Subject: [PATCH 10/14] removed files we don't need --- examples/alternate-gameoflife.js | 137 ----------------- examples/cubes.svo | Bin 145 -> 0 bytes examples/invader.svo | Bin 130 -> 0 bytes examples/invader2.svo | Bin 130 -> 0 bytes examples/slider.jpg | Bin 8797 -> 0 bytes examples/slider.png | Bin 10738 -> 0 bytes examples/swatches.svg | 20 --- examples/testing-hifi-interface-tools.svg | 177 ---------------------- examples/testing-swatches | 20 --- examples/testing-swatches.svg | 20 --- examples/thumb.jpg | Bin 5221 -> 0 bytes examples/thumb.png | Bin 5198 -> 0 bytes 12 files changed, 374 deletions(-) delete mode 100644 examples/alternate-gameoflife.js delete mode 100644 examples/cubes.svo delete mode 100644 examples/invader.svo delete mode 100644 examples/invader2.svo delete mode 100644 examples/slider.jpg delete mode 100644 examples/slider.png delete mode 100644 examples/swatches.svg delete mode 100644 examples/testing-hifi-interface-tools.svg delete mode 100644 examples/testing-swatches delete mode 100644 examples/testing-swatches.svg delete mode 100644 examples/thumb.jpg delete mode 100644 examples/thumb.png diff --git a/examples/alternate-gameoflife.js b/examples/alternate-gameoflife.js deleted file mode 100644 index 8ab992138a..0000000000 --- a/examples/alternate-gameoflife.js +++ /dev/null @@ -1,137 +0,0 @@ -// Add your JavaScript for assignment below this line - -// The following is an example of Conway's Game of Life (http://en.wikipedia.org/wiki/Conway's_Game_of_Life) - -var gameZ = 100; -var NUMBER_OF_CELLS_EACH_DIMENSION = 64; -var NUMBER_OF_CELLS = NUMBER_OF_CELLS_EACH_DIMENSION * NUMBER_OF_CELLS_EACH_DIMENSION; - -var currentCells = []; -var nextCells = []; - -var METER_LENGTH = 1; -var cellScale = (NUMBER_OF_CELLS_EACH_DIMENSION * METER_LENGTH) / NUMBER_OF_CELLS_EACH_DIMENSION; - -// randomly populate the cell start values -for (var i = 0; i < NUMBER_OF_CELLS_EACH_DIMENSION; i++) { - // create the array to hold this row - currentCells[i] = []; - - // create the array to hold this row in the nextCells array - nextCells[i] = []; - - for (var j = 0; j < NUMBER_OF_CELLS_EACH_DIMENSION; j++) { - currentCells[i][j] = Math.floor(Math.random() * 2); - - // put the same value in the nextCells array for first board draw - nextCells[i][j] = currentCells[i][j]; - } -} - -function isNeighbourAlive(i, j) { - if (i < 0 || i >= NUMBER_OF_CELLS_EACH_DIMENSION - || i < 0 || j >= NUMBER_OF_CELLS_EACH_DIMENSION) { - return 0; - } else { - return currentCells[i][j]; - } -} - -function updateCells() { - var i = 0; - var j = 0; - - for (i = 0; i < NUMBER_OF_CELLS_EACH_DIMENSION; i++) { - for (j = 0; j < NUMBER_OF_CELLS_EACH_DIMENSION; j++) { - // figure out the number of live neighbours for the i-j cell - var liveNeighbours = - isNeighbourAlive(i + 1, j - 1) + isNeighbourAlive(i + 1, j) + isNeighbourAlive(i + 1, j + 1) + - isNeighbourAlive(i, j - 1) + isNeighbourAlive(i, j + 1) + - isNeighbourAlive(i - 1, j - 1) + isNeighbourAlive(i - 1, j) + isNeighbourAlive(i - 1, j + 1); - - if (currentCells[i][j]) { - // live cell - - if (liveNeighbours < 2) { - // rule #1 - under-population - this cell will die - // mark it zero to mark the change - nextCells[i][j] = 0; - } else if (liveNeighbours < 4) { - // rule #2 - this cell lives - // mark it -1 to mark no change - nextCells[i][j] = -1; - } else { - // rule #3 - overcrowding - this cell dies - // mark it zero to mark the change - nextCells[i][j] = 0; - } - } else { - // dead cell - if (liveNeighbours == 3) { - // rule #4 - reproduction - this cell revives - // mark it one to mark the change - nextCells[i][j] = 1; - } else { - // this cell stays dead - // mark it -1 for no change - nextCells[i][j] = -1; - } - } - - if (Math.random() < 0.001) { - // Random mutation to keep things interesting in there. - nextCells[i][j] = 1; - } - } - } - - for (i = 0; i < NUMBER_OF_CELLS_EACH_DIMENSION; i++) { - for (j = 0; j < NUMBER_OF_CELLS_EACH_DIMENSION; j++) { - if (nextCells[i][j] != -1) { - // there has been a change to this cell, change the value in the currentCells array - currentCells[i][j] = nextCells[i][j]; - } - } - } -} - -function sendNextCells() { - for (var i = 0; i < NUMBER_OF_CELLS_EACH_DIMENSION; i++) { - for (var j = 0; j < NUMBER_OF_CELLS_EACH_DIMENSION; j++) { - if (nextCells[i][j] != -1) { - // there has been a change to the state of this cell, send it - - // find the x and y position for this voxel, z = 0 - var x = j * cellScale; - var y = i * cellScale; - - // queue a packet to add a voxel for the new cell - var color = (nextCells[i][j] == 1) ? 255 : 1; - if (color == 255) { - Voxels.setVoxel(x, y, gameZ, cellScale, color, color, color); - } else { - Voxels.setVoxel(x, y, gameZ, cellScale, 255, 0, 0); - } - } - } - } -} - -var sentFirstBoard = false; - -function step() { - if (sentFirstBoard) { - // we've already sent the first full board, perform a step in time - updateCells(); - } else { - // this will be our first board send - sentFirstBoard = true; - } - - sendNextCells(); -} - -print("here"); -//Script.willSendVisualDataCallback.connect(step); -Voxels.setPacketsPerSecond(200); -print("now here"); diff --git a/examples/cubes.svo b/examples/cubes.svo deleted file mode 100644 index dee8f428d5f8ce33d9aacca999b1bd4c92b414a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 145 zcmZQr#ef7>1u`%&yj>4M4(A~>GRfeIkp7G;0bw%)K%^c1V3BiRU|?{t$0EV7%J#Cy P+w}~_XU_aLb7cSk!{1-@O+06`At;Y>J#!4=MQ_zY*l84Ljsro$h&5S+o_@OC|egFT!NXD|Q& DBSAZq diff --git a/examples/invader2.svo b/examples/invader2.svo deleted file mode 100644 index bacabfe662ec646e704b899a0a5c0cf609664d27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmZQr#ef7>1u`%&yj>4M4(A~>GRfeIkp7G;0bw%)K%^c1V3BiRU|?{t$07j$Zi6)> diff --git a/examples/slider.jpg b/examples/slider.jpg deleted file mode 100644 index 0d9652d212edf69e3bb95b05b8da3335e85738e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8797 zcmeHrc|4Tw_xHJHweL%Wkv$UG2}5=&ic%_)ecuZoj20A1t3pw!Bq0?_WiORVl9U#E zSu;d47<2z#W9jqxexL8}^?H8K^Zfao*DU8g*SX&3yw7#dxvy)`k7zgW*;?9I0)il5 z4b}i?FHg6PnVFlzR(ngEjTV3)06cHqLqh{Gd;megk>OjdHc0Q-=^{=11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`u12>3;Dj)Hg{Lt#1y$voB+VrCK*E5?j*QuZ4-b!_KMo#?>*s|QmADS9AP~+_0a$mdqx$N=o z3lh)l-={v~&i+IXYiYcMW!8u!8Xb7r{5`tK(eKzf#;;%22Xw#tXBsKf(s&H_6r#`( z;iP-$qvOLzN&^`^Cj71_G~Mp{Ng8kyjBaLH8SP?LyHpR^v-`W`rIha)RAr=XTKlPF zt?S^7yaSJI^4zm(z6s$`m%L+9oH-(D_{LWgm9%7E%zg66`4PALE~?e}rqMKoFceme zys5Ds`IStXZk{e}&7;c+2F;GP$T*pJB*HJTGaZYf>!aVZ0`HL6VV3uemqH%TZ+ z?{cG&3yY#0P5aEtQ7ECjZ?Bp+E@+(JS$jnG-C^;bDW+uhbunL3Rxrh2=GOohZw-VFd6TQo?>_Gohoi+)Z|lPidmAcG}laeNWKkMd0H*Q{6^woO5UzIP*=mP zn-=0BRxu%4U0eJq-MiXm;y`+N1}UIY{QPlkyLro>V`(qFFXd{)pQWm3J1EuTw+!ZE z5{+2KD}LxGvmx^v&mCknJAF@Q84=@Xf_dav^B_7 zS3;3SETk1tsONXgexY<>8NOF*>oHId$GVe;RO z0O@ZS6pmCieduG-NqrVVK&jv3F%pJC9PdOvQ(%O&D`T#ka$Lv(L4iFgqqu3FN`96> zx4Ru5OddbT)Y|g@WBfmx8lj+y4yO>RGVCraP((q&tY7JJX1@>I_Xn|~719@eQA dt5n(?=bls0P+U4Q!~4?eN~TK3j3)Z&zX0j532FcU diff --git a/examples/slider.png b/examples/slider.png deleted file mode 100644 index b4ba7d90b827130d4c78576b337ebc951de7d158..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10738 zcmZ{Jbx>T-*6j=f1Hm=82MfV1z+i#k7J@qg0)!a`cTLa)cZcA?UBUoEa0sr!-QAs6 z`Q7{7`@L87y6XJ1&f07D?%iE`pVMLLs&Y7(6qo=207pSyMgsrI%}*bn1@qk2X+C06-q6Ovg(1eIG^U``GB{5fp-GLQfsf1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>4BZy;ipK%~33q`Jr0`6O4>u%0j+S0(dB_G$!B zi0gXbY(yrTr4BZkc(wTrZL#LU^q0wNX(h_VY*+&sjl0z=AK}ZNG#A)#F0)TQlaiCj z*Ay6`E8uN^HHi4~3osO*hB88MuGU%#%7pL|$O9pMgUYoLU0;N@>iGQjx~E9C!%hM3 zB?9C^@Q&Gm<-bF&7=Dz&np3j&9o!->NaAoYCLWvyHd(I)>d^!Nc{)In5YBA$-qizPILH_%Zu1$EeO9PlH%{88&#HCmpW(1C%NmgI?5vug2-f#Id0$ZZqvLgxB~S z`lUoP?Lzq3cyMThj;|I7Jv)GKq!MqLRn17_LXs;pliw16<$uE*SXf#u`IwHtdOK2!5_yNcPTZ# z8^vZ?0C7S^Loq2mB}=@Q~~ zlJL2>r$Yo5zz9g+>(bBKO~v41uy$cUYXjN@>c)e}^w6$`v8S_T+xZa&^=CZkSujGH zPL1SmlervfosHVW$l%EG5e<>cZ=f|*91z2ge*`mj{dSp_G+cUc^MlAFp<&k72R0R1 zXY_YVO(Ne-OQIoi#lL7h{=MAzL2(Ra7-mUd(L$yb7wf+hP#3UI=Qp*Tdz|D|Gdtzq ze2r5Png7?B=Ohw!Tt8~4$!Kf!W;>JfuH0a}`|=@mPfOHg{+|>of&lQ(wgw06{AE@R zi;q)_VVCF%T*mih!Y)l+t(QUDejo4Fw0abIT)6+?tAPM`BXuTV8^7aho3_XLDZ|zY zl*P@0HpkXU!^gshoh?lF9{A>7Xfe248V3Mb`t$`xNojk))mA%AsgwGI-alle&nL9V R`uE;d;jOAn`5V*E{|6%+f)M}! diff --git a/examples/swatches.svg b/examples/swatches.svg deleted file mode 100644 index ee144170c5..0000000000 --- a/examples/swatches.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/examples/testing-hifi-interface-tools.svg b/examples/testing-hifi-interface-tools.svg deleted file mode 100644 index b7bdbbcb58..0000000000 --- a/examples/testing-hifi-interface-tools.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/testing-swatches b/examples/testing-swatches deleted file mode 100644 index ee144170c5..0000000000 --- a/examples/testing-swatches +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/examples/testing-swatches.svg b/examples/testing-swatches.svg deleted file mode 100644 index ee144170c5..0000000000 --- a/examples/testing-swatches.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/examples/thumb.jpg b/examples/thumb.jpg deleted file mode 100644 index ab33cec76416883592c39c1034b075f7528873dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5221 zcmbtY2UHZ<(yk7Zm;l4T5G3cQWI-h7pyap)h9M1^A&LPE3kv3diV zJromW2N4w&7XyeQ&O1%o{onuIIe(}#GyQe-S9R;F+ui5h5kC-%K+4Cd-=Knf&j2?@zT?iQ7M3w)GT43hqGFEM5G$!86ZFdCNRN>$Inc6 z^7r?J|7b(^0U<8lF(z{TN7}zPc1&z09{}+OfasV^ehL6`1^{c|rwg+HNJKuZ+^lp0 zZv+4tVR%F&0I7<=@#DCGz|rIQ#uz6!&;@`b0-!Q@JYhTl^F08lrX6LaY}tXN3P?dX{tGguhXc03Z#3YVk8&BFA&0R{06RVG|tR zm{?ag0FVMe!-Z*qll+9toS;d6etv?>+(~{S&zqQU764kp6OO5o0YG=eCVLR$Y5<_e z(zE=DI=KL7M{4ri2`%W$IH5biA^hKCGspB2wIyUF1bdF>$E31^!30MJ08@$+xOB(dFv@`$~EX)oh`k)1X#l@zE5IrRPB{4i#qPI!_*lutK9ta^8q9GOf zKn;As1zab7)gTs9K@Iqj2FZ{HLN&?BE2LMXPSOj~J(7s@aMA}ZlROYW45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FWqr(+)#f`SIPgm*T^|``ke<#(yg&Jo|~Gd>izlVu=eGBM}~`smX`W|3~BrA z+392RC8xiV$5RxQmJ}-|4fcqNTS_I1e!`vpFL`X8hSfe9>Z<1UHa7i^s@l(fw%c3y z*f5{3_@d5zzKeTxck~7Q(US$DGJEdu#Y2hGc{o$B zHT+gFS|kQhRb*GQ-x`gsp6vH>3uNw^Y&P;=-B!Kto1oC9=0V!Si$iC(H0Nu{EyFGr zx7sUT2$*f6wS3PdY&R>c&rvmx+f)9j;4!D|_q_OSnUnK9t1aK{D06sW^Jj_ZLxE_2 z(D^@%R9NM@n#ffL{lS{Di^(${$9oT`Y|4IdbA99u%C*3oHmjpoN!I(&$Vmp3xKQhC93xP2ry@9T^0t#&@4ioaIn1bHuO$Lp@E z*O$(o?pawld%lcqca!F=u6qRoJ~eW0?=LeuTXHA(ZuB~qtaR_a;Kh(vSpp;PfXoMKHpS82E{pL0j@$T#Qu6CxoUEI)z50-K2aXYJElvY^+pQCIn0^FcL G{P3Ur<$c5e diff --git a/examples/thumb.png b/examples/thumb.png deleted file mode 100644 index fd5f87cacabe1e11989d4115aab0f73eb5e9d8e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5198 zcmZ`)WmFVgx1Is%ZloLO?x9iXk{D7tgc)EMU>I6Sr8@+q5pWO?kW?H>q@^S!1?eFK z2IMZ^_xV>Fo*tXp_CMbO%5B%vAI!JvDV4hbomCX^G6T=f0;+z|2Xc zb5G*V)8}2nf^X@~w0dHN6m z;#}1FKE=5xTb+XK$ z3VGp21!;KaT|Hx6rO5qaaO0Nog)SVe=^Q2EIH119;>j0u{=N9tJuOQh?wCm*|84mX zm)>Z!7)d{bK82YDw?Vd7=su2NulQq;5wdu;t(16wg$7D5jS=%SkT8@{HN(C4QnQZW za_p|uCnDuUni>(ELPnwn{NBpWmuie5rD9Vuk7*0U>k__`JblU;TT5t=ITFt{@dAc% zdT?x}&Sf=6c*sA(V*B;22)$6o zLmEHv7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pPmSu)gYWq{Gk3)`I#C?oTXxt2u;=>`C^W6fa{%XF*kRjv1 zDCKXOd7r#GKWoQsprZyHz7z~{B5!}+wEKyYtC;Tl(d=IXbdSOIAHuuhw+bjqz;TH# zbokNK?J5FcS=5*s2~vzk-1ta=oE}3VAp_?sjU=xT9e^QpSxQc->AX#JU>I1LxCx?` zln@lzr0sc?7`JE6t28EFB&vvItD}emcnYiq<{;i|oc3jm1xA~OKO96x7!<2NFV7xm zg)UkD`ZfxP+57N2z_A36C_Zyw7C+@3i&HQ(If6+AZ0L;uMQ5tYBgoha1>h-UqeVmG z!ntOMUY1$x(c Date: Sun, 23 Feb 2014 18:52:15 -0800 Subject: [PATCH 11/14] removed unneeded code --- examples/editVoxels.js | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 4e24f6021e..26090d2f49 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -736,7 +736,6 @@ function handleOrbitingMove(event) { function endOrbitMode(event) { var cameraOrientation = Camera.getOrientation(); - var eulers = Quat.safeEulerAngles(cameraOrientation); MyAvatar.position = Camera.getPosition(); MyAvatar.headOrientation = cameraOrientation; Camera.stopLooking(); From dad97cd52ea324f9d42b6df3de6028737962575d Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 18:54:15 -0800 Subject: [PATCH 12/14] removed accidental code --- examples/hifi-interface-tools.svg | 177 ------------------------------ examples/touchVsMouse.js | 36 ------ 2 files changed, 213 deletions(-) delete mode 100644 examples/hifi-interface-tools.svg delete mode 100644 examples/touchVsMouse.js diff --git a/examples/hifi-interface-tools.svg b/examples/hifi-interface-tools.svg deleted file mode 100644 index 311514581f..0000000000 --- a/examples/hifi-interface-tools.svg +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/touchVsMouse.js b/examples/touchVsMouse.js deleted file mode 100644 index c5007e076b..0000000000 --- a/examples/touchVsMouse.js +++ /dev/null @@ -1,36 +0,0 @@ -// -// toucheVsMouse.js -// hifi -// -// Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. -// -// This is an example script that demonstrates use of the Controller class -// -// - -function touchBeginEvent(event) { - print("touchBeginEvent event.x,y=" + event.x + ", " + event.y); -} - -function touchEndEvent(event) { - print("touchEndEvent event.x,y=" + event.x + ", " + event.y); -} - -function touchUpdateEvent(event) { - print("touchUpdateEvent event.x,y=" + event.x + ", " + event.y); -} -function mouseMoveEvent(event) { - print("mouseMoveEvent event.x,y=" + event.x + ", " + event.y); -} - -// Map the mouse events to our functions -Controller.touchBeginEvent.connect(touchBeginEvent); -Controller.touchUpdateEvent.connect(touchUpdateEvent); -Controller.touchEndEvent.connect(touchEndEvent); - -Controller.mouseMoveEvent.connect(mouseMoveEvent); - -function scriptEnding() { -} -Script.scriptEnding.connect(scriptEnding); From 766a922fb3d8ac253399535fdaa031cbbd458abe Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Sun, 23 Feb 2014 19:02:10 -0800 Subject: [PATCH 13/14] add work around for voxel add of larger voxel on top of smaller voxels --- examples/editVoxels.js | 3 +++ libraries/voxels/src/VoxelsScriptingInterface.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 26090d2f49..d676e71087 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -922,6 +922,7 @@ print("clickedOverlay="+clickedOverlay); } voxelDetails = calculateVoxelFromIntersection(intersection,"add"); + Voxels.eraseVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s); Voxels.setVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s, newColor.red, newColor.green, newColor.blue); lastVoxelPosition = { x: voxelDetails.x, y: voxelDetails.y, z: voxelDetails.z }; @@ -963,6 +964,7 @@ function keyPressEvent(event) { red: colors[color].red, green: colors[color].green, blue: colors[color].blue }; + Voxels.eraseVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s); Voxels.setVoxel(newVoxel.x, newVoxel.y, newVoxel.z, newVoxel.s, newVoxel.red, newVoxel.green, newVoxel.blue); setAudioPosition(); Audio.playSound(addSound, audioOptions); @@ -1089,6 +1091,7 @@ function mouseMoveEvent(event) { var dy = event.y - mouseY; if (Math.sqrt(dx*dx + dy*dy) > PIXELS_PER_EXTRUDE_VOXEL) { lastVoxelPosition = Vec3.sum(lastVoxelPosition, extrudeDirection); + Voxels.eraseVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s); Voxels.setVoxel(lastVoxelPosition.x, lastVoxelPosition.y, lastVoxelPosition.z, extrudeScale, lastVoxelColor.red, lastVoxelColor.green, lastVoxelColor.blue); mouseX = event.x; diff --git a/libraries/voxels/src/VoxelsScriptingInterface.cpp b/libraries/voxels/src/VoxelsScriptingInterface.cpp index 1a0a234e0a..db61460d69 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.cpp +++ b/libraries/voxels/src/VoxelsScriptingInterface.cpp @@ -42,7 +42,7 @@ void VoxelsScriptingInterface::setVoxelNonDestructive(float x, float y, float z, VoxelDetail addVoxelDetail = {x / (float)TREE_SCALE, y / (float)TREE_SCALE, z / (float)TREE_SCALE, scale / (float)TREE_SCALE, red, green, blue}; - // queue the packet + // queue the add packet queueVoxelAdd(PacketTypeVoxelSet, addVoxelDetail); // handle the local tree also... From f5fece5eb51adf07ec71393fc3f4828707677eef Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Sun, 23 Feb 2014 20:11:46 -0800 Subject: [PATCH 14/14] Fix for Xcode warnings. --- interface/src/renderer/Model.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index c3aae7146a..9513e45d60 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -52,8 +52,8 @@ bool Model::isLoadedWithTextures() const { } foreach (const NetworkMesh& mesh, _geometry->getMeshes()) { foreach (const NetworkMeshPart& part, mesh.parts) { - if (part.diffuseTexture && !part.diffuseTexture->isLoaded() || - part.normalTexture && !part.normalTexture->isLoaded()) { + if ((part.diffuseTexture && !part.diffuseTexture->isLoaded()) || + (part.normalTexture && !part.normalTexture->isLoaded())) { return false; } }