@xeokit/xeokit-sdk 2.5.2-beta-3 → 2.5.2-beta-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.5.2-beta-3",
3
+ "version": "2.5.2-beta-4",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -957,13 +957,14 @@ class XKTLoaderPlugin extends Plugin {
957
957
  sceneModel.once("destroyed", () => {
958
958
  this.viewer.metaScene.destroyMetaModel(metaModel.id);
959
959
  });
960
- sceneModel.scene.once("tick", () => {
960
+ window.setTimeout(() => {
961
+
961
962
  if (sceneModel.destroyed) {
962
963
  return;
963
964
  }
964
965
  sceneModel.scene.fire("modelLoaded", sceneModel.id); // FIXME: Assumes listeners know order of these two events
965
966
  sceneModel.fire("loaded", true, false); // Don't forget the event, for late subscribers
966
- });
967
+ }, 100);
967
968
  }
968
969
 
969
970
  const error = (errMsg) => {
@@ -1041,7 +1042,7 @@ class XKTLoaderPlugin extends Plugin {
1041
1042
  globalizeObjectIds: options.globalizeObjectIds
1042
1043
  });
1043
1044
  i++;
1044
- this.viewer.scene.once("tick", loadNext);
1045
+ window.setTimeout( loadNext, 100);
1045
1046
  }, error);
1046
1047
  }
1047
1048
  }
@@ -1056,7 +1057,7 @@ class XKTLoaderPlugin extends Plugin {
1056
1057
  this._dataSource.getXKT(`${baseDir}${xktFiles[i]}`, (arrayBuffer) => {
1057
1058
  this._parseModel(arrayBuffer, params, options, sceneModel, metaModel, manifestCtx);
1058
1059
  i++;
1059
- this.viewer.scene.once("tick", loadNext);
1060
+ window.setTimeout(loadNext, 100);
1060
1061
  }, error);
1061
1062
  }
1062
1063
  }
@@ -230,4 +230,13 @@ function renderScenes() {
230
230
 
231
231
  (window.requestPostAnimationFrame !== undefined) ? window.requestPostAnimationFrame(frame) : requestAnimationFrame(frame);
232
232
 
233
+ function compileScenes() {
234
+
235
+ for (let id in core.scenes) {
236
+ core.scenes[id].compile();
237
+ }
238
+ }
239
+
240
+ window.setInterval(compileScenes, 1000 / 60);
241
+
233
242
  export {core};
@@ -1192,7 +1192,7 @@ class Scene extends Component {
1192
1192
  }
1193
1193
 
1194
1194
  _deRegisterColorizedObject(entity) {
1195
- delete this.colorizedObjects[entity.id];
1195
+ delete this.colorizedObjects[entity.id];
1196
1196
  this._numColorizedObjects--;
1197
1197
  this._colorizedObjectIds = null; // Lazy regenerate
1198
1198
  }
@@ -1209,7 +1209,7 @@ class Scene extends Component {
1209
1209
  }
1210
1210
 
1211
1211
  _deRegisterOpacityObject(entity) {
1212
- delete this.opacityObjects[entity.id];
1212
+ delete this.opacityObjects[entity.id];
1213
1213
  this._numOpacityObjects--;
1214
1214
  this._opacityObjectIds = null; // Lazy regenerate
1215
1215
  }
@@ -1226,7 +1226,7 @@ class Scene extends Component {
1226
1226
  }
1227
1227
 
1228
1228
  _deRegisterOffsetObject(entity) {
1229
- delete this.offsetObjects[entity.id];
1229
+ delete this.offsetObjects[entity.id];
1230
1230
  this._numOffsetObjects--;
1231
1231
  this._offsetObjectIds = null; // Lazy regenerate
1232
1232
  }
@@ -1499,6 +1499,18 @@ class Scene extends Component {
1499
1499
  this._saveAmbientColor();
1500
1500
  }
1501
1501
 
1502
+
1503
+ /**
1504
+ * @private
1505
+ */
1506
+ compile() {
1507
+ if (this._needRecompile) {
1508
+ this._recompile();
1509
+ this._renderer.imageDirty();
1510
+ this._needRecompile = false;
1511
+ }
1512
+ }
1513
+
1502
1514
  _recompile() {
1503
1515
  for (const id in this._compilables) {
1504
1516
  if (this._compilables.hasOwnProperty(id)) {