From 4a4efb0bfaae0137a5af37905f6fa6288d577503 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 19 Jun 2014 11:11:08 -0700 Subject: [PATCH 1/3] Don't glow models if you can't grab it --- examples/editModels.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/editModels.js b/examples/editModels.js index 8a73c79532..55e4d56a21 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -328,7 +328,8 @@ function controller(wichSide) { origin: this.palmPosition, direction: this.front }); - if (intersection.accurate && intersection.modelID.isKnownID) { + var angularSize = 2 * Math.atan(intersection.modelProperties.radius / Vec3.distance(Camera.getPosition(), intersection.modelProperties.position)) * 180 / 3.14; + if (intersection.accurate && intersection.modelID.isKnownID && angularSize > MIN_ANGULAR_SIZE && angularSize < MAX_ANGULAR_SIZE) { this.glowedIntersectingModel = intersection.modelID; Models.editModel(this.glowedIntersectingModel, { glowLevel: 0.25 }); } @@ -887,7 +888,8 @@ function mouseMoveEvent(event) { glowedModelID.isKnownID = false; } - if (modelIntersection.modelID.isKnownID) { + var angularSize = 2 * Math.atan(modelIntersection.modelProperties.radius / Vec3.distance(Camera.getPosition(), modelIntersection.modelProperties.position)) * 180 / 3.14; + if (modelIntersection.modelID.isKnownID && angularSize > MIN_ANGULAR_SIZE && angularSize < MAX_ANGULAR_SIZE) { Models.editModel(modelIntersection.modelID, { glowLevel: 0.25 }); glowedModelID = modelIntersection.modelID; } From 266dc6be3ed229b7298d3b598dc850b91fd5c622 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 19 Jun 2014 18:09:17 -0700 Subject: [PATCH 2/3] fixed tooltip not disapearing when deleting model --- examples/editModels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/editModels.js b/examples/editModels.js index 55e4d56a21..f2b76a28c3 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -1119,8 +1119,8 @@ function handeMenuEvent(menuItem){ Models.editModel(editModelID, properties); } } - tooltip.show(false); } + tooltip.show(false); } Menu.menuItemEvent.connect(handeMenuEvent); From 4561a6e3269693b5654f559fca7ada62b4698e10 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 19 Jun 2014 18:10:06 -0700 Subject: [PATCH 3/3] Fixed voxel being deleted even though voxel tool is not selected --- examples/editVoxels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index cff0d65743..412612fdad 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -1196,7 +1196,7 @@ function menuItemEvent(menuItem) { print("deleting..."); if (isImporting) { cancelImport(); - } else { + } else if (voxelToolSelected) { Clipboard.deleteVoxel(selectedVoxel.x, selectedVoxel.y, selectedVoxel.z, selectedVoxel.s); } }