fix use of platform.world

This commit is contained in:
Stewart Allen 2022-01-02 19:29:28 -05:00
commit fd645737e2
6 changed files with 9 additions and 8 deletions

View file

@ -26,7 +26,7 @@ self.kiri.loader.push(function() {
CAM.animate_clear = function(api) {
KIRI.client.animate_cleanup();
SPACE = (API = api).const.SPACE;
WORLD = SPACE.platform.world;
WORLD = SPACE.world;
$('layer-animate').innerHTML = '';
$('layer-toolpos').innerHTML = '';
Object.keys(meshes).forEach(id => deleteMesh(id));
@ -35,7 +35,7 @@ self.kiri.loader.push(function() {
if (KIRI.client)
CAM.animate = function(api, delay) {
SPACE = (API = api).const.SPACE;
WORLD = SPACE.platform.world;
WORLD = SPACE.world;
KIRI.client.animate_setup(API.conf.get(), data => {
checkMeshCommands(data);
if (!(data && data.mesh_add)) {

View file

@ -148,7 +148,7 @@
api.event.on("code.loaded", (info) => {
if (isCamMode && camStock) {
isParsed = true;
STACKS.getStack("parse", SPACE.platform.world).button("animate", animate);
STACKS.getStack("parse", SPACE.world).button("animate", animate);
}
});

View file

@ -1206,7 +1206,7 @@
tshadow = POLY.union(tshadow.slice().appendAll(data.tops).appendAll(shadowAt), 0.01, true);
tslices.push(data.slice);
data.slice.shadow = tshadow;
if (true) {
if (false) {
const slice = data.slice;
sliceAll.push(slice);
slice.output()

View file

@ -526,7 +526,7 @@
));
}
xpdebug = new KIRI.Stack(SPACE.platform.world, false);
xpdebug = new KIRI.Stack(SPACE.world, false);
xpdebug.addLayers(layers);
xpdebug.setVisible(0,Infinity);
xpdebug.show();

View file

@ -1436,7 +1436,7 @@
}, (layers, maxSpeed, minSpeed) => {
API.show.progress(0);
STACKS.clear();
const stack = STACKS.create('parse', SPACE.platform.world);
const stack = STACKS.create('parse', SPACE.world);
layers.forEach(layer => stack.add(layer));
updateSliderMax(true);
updateSpeeds(maxSpeed, minSpeed);
@ -1513,7 +1513,7 @@
// mesh.castShadow = true;
// mesh.receiveShadow = true;
//
// SPACE.platform.world.add(mesh);
// SPACE.world.add(mesh);
let widget = newWidget().loadVertices(bigv)
widget.meta.file = opt.file;
platform.add(widget);

View file

@ -997,7 +997,8 @@
onMove: (f) => { platformOnMove = f },
onHover: (f) => { platformHover = f },
onClick: (f) => { platformClick = f},
size: () => { return platform.scale }
size: () => { return platform.scale },
get world() { throw "platform.world deprecated" }
},
view: {