update cam client's use of space api

This commit is contained in:
Stewart Allen 2021-12-27 16:46:43 -05:00
commit d4d68c2870

View file

@ -1224,7 +1224,7 @@
}); });
camStock = new THREE.Mesh(geo, mat); camStock = new THREE.Mesh(geo, mat);
camStock.renderOrder = 2; camStock.renderOrder = 2;
SPACE.platform.add(camStock); SPACE.world.add(camStock);
} }
stock = settings.stock = { stock = settings.stock = {
x: csx, x: csx,
@ -1244,7 +1244,7 @@
camStock.position.z = csz / 2; camStock.position.z = csz / 2;
delta = csz - topZ; delta = csz - topZ;
} else if (camStock) { } else if (camStock) {
SPACE.platform.remove(camStock); SPACE.world.remove(camStock);
camStock = null; camStock = null;
delta = 0; delta = 0;
} }
@ -1252,7 +1252,7 @@
const {x, y, z} = stock; const {x, y, z} = stock;
if (x && y && z && !STACKS.getStack('bounds')) { if (x && y && z && !STACKS.getStack('bounds')) {
const render = new KIRI.Layers().setLayer('bounds', { face: 0xaaaaaa, line: 0xaaaaaa }); const render = new KIRI.Layers().setLayer('bounds', { face: 0xaaaaaa, line: 0xaaaaaa });
const stack = STACKS.setFreeMem(false).create('bounds', SPACE.platform.world); const stack = STACKS.setFreeMem(false).create('bounds', SPACE.world);
stack.add(render.addPolys([ stack.add(render.addPolys([
newPolygon().centerRectangle({x:csox, y:csoy, z:0}, x, y), newPolygon().centerRectangle({x:csox, y:csoy, z:0}, x, y),
newPolygon().centerRectangle({x:csox, y:csoy, z}, x, y) newPolygon().centerRectangle({x:csox, y:csoy, z}, x, y)