add grid lines toggling

This commit is contained in:
Stewart Allen 2022-01-07 21:32:53 -05:00
commit 798bf1750d
4 changed files with 18 additions and 3 deletions

View file

@ -923,7 +923,8 @@
function setPlatform(opt = {}) {
let platform = Space.platform;
let { color, round, size, grid, opacity, volume, zOffset, origin } = opt;
let { color, round, size, grid, opacity } = opt;
let { visible, volume, zOffset, origin } = opt;
if (color) {
platform.setColor(color);
}
@ -953,6 +954,9 @@
if (zOffset !== undefined) {
platform.setZOff(zOffset);
}
if (visible !== undefined) {
platform.setVisible(visible);
}
}
let Space = MOTO.Space = {
@ -1017,11 +1021,13 @@
setMaxZ: (z) => { panY = z / 2 },
setCenter: (x,y,z) => { panX = x; panY = z, panZ = y },
setHidden: (b) => { showPlatform = !b; platform.visible = !b },
setVisible: (b) => { showPlatform = b; platform.visible = b },
setHiding: (b) => { hidePlatformBelow = b },
setZOff: (z) => { platformZOff = z; updatePlatformPosition() },
setGridZOff:(z) => { gridZOff = z; updatePlatformPosition() },
isHidden: () => { return !showPlatform },
isVisible: () => { return platform.visible },
isGridVisible() { return grid.view.visible },
opacity: (o) => { platform.material.opacity = o },
onMove: (f,t) => { platformOnMove = f, platformOnMoveTime = t || platformOnMoveTime },
onHover: (f) => { platformHover = f },