@woosh/meep-engine 2.85.0 → 2.85.2

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/build/meep.cjs CHANGED
@@ -89387,6 +89387,7 @@ class GraphicsEngine {
89387
89387
  return intersectObject;
89388
89388
  })();
89389
89389
  }
89390
+
89390
89391
  /**
89391
89392
  *
89392
89393
  * @returns {MaterialManager}
@@ -89470,7 +89471,7 @@ class GraphicsEngine {
89470
89471
 
89471
89472
  start() {
89472
89473
  const canvas = document.createElement("canvas");
89473
- const context = canvas.getContext("webgl2", {antialias: false});
89474
+ const context = canvas.getContext("webgl2", { antialias: false });
89474
89475
 
89475
89476
  const rendererParameters = {
89476
89477
  antialias: true,
@@ -89667,6 +89668,10 @@ class GraphicsEngine {
89667
89668
  // TODO designate opaque output buffer
89668
89669
  const frameBuffer = buffers.getById(StandardFrameBuffers.ColorAndDepth);
89669
89670
 
89671
+ if (frameBuffer === undefined) {
89672
+ throw new Error(`No color-depth frame buffer`);
89673
+ }
89674
+
89670
89675
  renderTextureToScreenQuad(frameBuffer.renderTarget.texture, renderer);
89671
89676
 
89672
89677
  this.on.postOpaquePass.send0();
@@ -91076,7 +91081,21 @@ class StaticKnowledgeDatabase {
91076
91081
  * @private
91077
91082
  */
91078
91083
  __specs = [];
91079
-
91084
+
91085
+ /**
91086
+ *
91087
+ * @type {boolean}
91088
+ */
91089
+ #validation_enabled = false;
91090
+
91091
+ /**
91092
+ *
91093
+ * @param {boolean} v
91094
+ */
91095
+ set validation_enabled(v) {
91096
+ this.#validation_enabled = v;
91097
+ }
91098
+
91080
91099
 
91081
91100
  /**
91082
91101
  * Reset database, drop all table data
@@ -91319,7 +91338,7 @@ class StaticKnowledgeDatabase {
91319
91338
  return Promise.all(promises).then(() => {
91320
91339
  let p = this.link(am, executor);
91321
91340
 
91322
- if (!ENV_PRODUCTION) {
91341
+ if (this.#validation_enabled) {
91323
91342
  p = p.then(() => this.validate(executor));
91324
91343
  }
91325
91344
 
@@ -103166,14 +103185,16 @@ class Engine {
103166
103185
  *
103167
103186
  * @param {EnginePlatform} platform
103168
103187
  * @param {EntityManager} [entityManager]
103169
- * @param enableGraphics
103170
- * @param enableAudio
103188
+ * @param {boolean} [enableGraphics]
103189
+ * @param {boolean} [enableAudio]
103190
+ * @param {boolean} [validation]
103171
103191
  * @constructor
103172
103192
  */
103173
103193
  constructor(platform, {
103174
103194
  entityManager,
103175
103195
  enableGraphics = true,
103176
- enableAudio = true
103196
+ enableAudio = true,
103197
+ validation = true
103177
103198
  } = {}) {
103178
103199
 
103179
103200
  /**
@@ -103187,6 +103208,7 @@ class Engine {
103187
103208
  * @type {StaticKnowledgeDatabase}
103188
103209
  */
103189
103210
  this.staticKnowledge = new StaticKnowledgeDatabase();
103211
+ this.staticKnowledge.validation_enabled = validation;
103190
103212
 
103191
103213
  /**
103192
103214
  *
@@ -103348,7 +103370,7 @@ class Engine {
103348
103370
  try {
103349
103371
  graphicsEngine.start();
103350
103372
  } catch (e) {
103351
- logger.info("Failed to start GraphicEngine: ", e);
103373
+ logger.error(`Failed to start GraphicEngine: ${e}`);
103352
103374
  }
103353
103375
 
103354
103376
  } else {
@@ -103580,7 +103602,7 @@ class Engine {
103580
103602
  requestAnimationFrame(this.#animation_frame);
103581
103603
 
103582
103604
  //start simulation
103583
- this.ticker.start({maxTimeout: 200});
103605
+ this.ticker.start({ maxTimeout: 200 });
103584
103606
  //self.uiController.init(self);
103585
103607
 
103586
103608
  //load options