Update scripts to use instead of for line3d

This commit is contained in:
Ryan Huffman 2014-12-18 16:23:24 -08:00
parent 27e13385ed
commit 5537fb970b
6 changed files with 29 additions and 29 deletions

View file

@ -178,7 +178,7 @@ var currentCursor = 0;
function addLineOverlay() {
return Overlays.addOverlay("line3d", {
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: 255, blue: 255},
alpha: 1,
@ -474,7 +474,7 @@ function initImport() {
});
xImportGuide = Overlays.addOverlay("line3d", {
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},
alpha: 1,
@ -482,7 +482,7 @@ function initImport() {
lineWidth: previewLineWidth
});
yImportGuide = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 255, blue: 0},
alpha: 1,
@ -490,7 +490,7 @@ function initImport() {
lineWidth: previewLineWidth
});
zImportGuide = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 0, blue: 255},
alpha: 1,
@ -519,15 +519,15 @@ function moveImport(position) {
Overlays.editOverlay(xImportGuide, {
position: { x: importPosition.x, y: 0, z: importPosition.z },
start: { x: importPosition.x, y: 0, z: importPosition.z },
end: { x: importPosition.x + scaleSelector.scale, y: 0, z: importPosition.z }
});
Overlays.editOverlay(yImportGuide, {
position: { x: importPosition.x, y: importPosition.y, z: importPosition.z },
start: { x: importPosition.x, y: importPosition.y, z: importPosition.z },
end: { x: importPosition.x, y: 0, z: importPosition.z }
});
Overlays.editOverlay(zImportGuide, {
position: { x: importPosition.x, y: 0, z: importPosition.z },
start: { x: importPosition.x, y: 0, z: importPosition.z },
end: { x: importPosition.x, y: 0, z: importPosition.z + scaleSelector.scale }
});
rescaleImport();

View file

@ -28,7 +28,7 @@ var MIN_VOXEL_SCALE = Math.pow(2.0, MIN_VOXEL_SCALE_POWER);
var linePreviewTop = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 0, blue: 255},
alpha: 1,
@ -37,7 +37,7 @@ var linePreviewTop = Overlays.addOverlay("line3d", {
});
var linePreviewBottom = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 0, blue: 255},
alpha: 1,
@ -46,7 +46,7 @@ var linePreviewBottom = Overlays.addOverlay("line3d", {
});
var linePreviewLeft = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 0, blue: 255},
alpha: 1,
@ -55,7 +55,7 @@ var linePreviewLeft = Overlays.addOverlay("line3d", {
});
var linePreviewRight = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 0, blue: 255},
alpha: 1,
@ -362,10 +362,10 @@ function showPreviewLines() {
if (intersection.intersects) {
var 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 });
Overlays.editOverlay(linePreviewTop, { start: resultVoxel.topLeft, end: resultVoxel.topRight, visible: true });
Overlays.editOverlay(linePreviewBottom, { start: resultVoxel.bottomLeft, end: resultVoxel.bottomRight, visible: true });
Overlays.editOverlay(linePreviewLeft, { start: resultVoxel.topLeft, end: resultVoxel.bottomLeft, visible: true });
Overlays.editOverlay(linePreviewRight, { start: resultVoxel.topRight, end: resultVoxel.bottomRight, visible: true });
} else {
Overlays.editOverlay(linePreviewTop, { visible: false });
Overlays.editOverlay(linePreviewBottom, { visible: false });
@ -645,4 +645,4 @@ Script.update.connect(update);
Script.scriptEnding.connect(scriptEnding);
Voxels.setMaxPacketSize(1); //this is needed or a bug occurs :(
Voxels.setPacketsPerSecond(10000);
Voxels.setPacketsPerSecond(10000);

View file

@ -75,7 +75,7 @@ var warpSphere = Overlays.addOverlay("sphere", {
var WARP_LINE_HEIGHT = 10;
var warpLine = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z:0 },
start: { x: 0, y: 0, z:0 },
end: { x: 0, y: 0, z: 0 },
color: { red: 0, green: 255, blue: 255},
alpha: 1,
@ -131,7 +131,7 @@ function updateWarp() {
visible: true,
});
Overlays.editOverlay(warpLine, {
position: warpPosition,
start: warpPosition,
end: Vec3.sum(warpPosition, { x: 0, y: WARP_LINE_HEIGHT, z: 0 }),
visible: true,
});

View file

@ -27,7 +27,7 @@ var MIN_VOXEL_SCALE = Math.pow(2.0, MIN_VOXEL_SCALE_POWER);
var linePreviewTop = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 255, blue: 0},
alpha: 1,
@ -36,7 +36,7 @@ var linePreviewTop = Overlays.addOverlay("line3d", {
});
var linePreviewBottom = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 255, blue: 0},
alpha: 1,
@ -45,7 +45,7 @@ var linePreviewBottom = Overlays.addOverlay("line3d", {
});
var linePreviewLeft = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 255, blue: 0},
alpha: 1,
@ -54,7 +54,7 @@ var linePreviewLeft = Overlays.addOverlay("line3d", {
});
var linePreviewRight = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z: 0},
start: { x: 0, y: 0, z: 0},
end: { x: 0, y: 0, z: 0},
color: { red: 0, green: 255, blue: 0},
alpha: 1,
@ -362,10 +362,10 @@ function showPreviewLines() {
if (intersection.intersects) {
var 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 });
Overlays.editOverlay(linePreviewTop, { start: resultVoxel.topLeft, end: resultVoxel.topRight, visible: true });
Overlays.editOverlay(linePreviewBottom, { start: resultVoxel.bottomLeft, end: resultVoxel.bottomRight, visible: true });
Overlays.editOverlay(linePreviewLeft, { start: resultVoxel.topLeft, end: resultVoxel.bottomLeft, visible: true });
Overlays.editOverlay(linePreviewRight, { start: resultVoxel.topRight, end: resultVoxel.bottomRight, visible: true });
} else {
Overlays.editOverlay(linePreviewTop, { visible: false });
Overlays.editOverlay(linePreviewBottom, { visible: false });

View file

@ -36,7 +36,7 @@ var warpSphere = Overlays.addOverlay("sphere", {
var WARP_LINE_HEIGHT = 5;
var warpLine = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z:0 },
start: { x: 0, y: 0, z:0 },
end: { x: 0, y: 0, z: 0 },
color: { red: 0, green: 255, blue: 255},
alpha: 1,
@ -120,7 +120,7 @@ function updateWarp() {
visible: willMove,
});
Overlays.editOverlay(warpLine, {
position: Vec3.sum(warpPosition, { x: 0, y: -WARP_LINE_HEIGHT / 2.0, z: 0 }),
start: Vec3.sum(warpPosition, { x: 0, y: -WARP_LINE_HEIGHT / 2.0, z: 0 }),
end: Vec3.sum(warpPosition, { x: 0, y: WARP_LINE_HEIGHT / 2.0, z: 0 }),
visible: willMove,
});

View file

@ -154,7 +154,7 @@ var sphere = Overlays.addOverlay("sphere", {
});
var line3d = Overlays.addOverlay("line3d", {
position: { x: 0, y: 0, z:0 },
start: { x: 0, y: 0, z:0 },
end: { x: 10, y: 10, z:10 },
color: { red: 0, green: 255, blue: 255},
alpha: 1,