@woosh/meep-engine 2.36.25 → 2.36.26

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.
@@ -92,7 +92,6 @@ export class ShadedGeometrySystem extends System {
92
92
  name: 'ShadedGeometry Draw Method optimizer',
93
93
  initializer: () => {
94
94
  optimizer.__system = this;
95
- optimizer.__ecd = this.entityManager.dataset
96
95
  },
97
96
  cycleFunction() {
98
97
  if (optimizer.step()) {
@@ -70,7 +70,7 @@ export class InstancedRendererAdapter extends AbstractRenderAdapter {
70
70
  }
71
71
 
72
72
  score(geometry, material, instance_count) {
73
- if (instance_count > 64) {
73
+ if (instance_count > 16) {
74
74
  return 1;
75
75
  } else if (instance_count < 4) {
76
76
  return -1;
@@ -2,12 +2,6 @@ import { ShadedGeometry } from "../../ShadedGeometry.js";
2
2
 
3
3
  export class RuntimeDrawMethodOptimizer {
4
4
  constructor() {
5
- /**
6
- *
7
- * @type {EntityComponentDataset|null}
8
- * @private
9
- */
10
- this.__ecd = null;
11
5
 
12
6
  /**
13
7
  *
@@ -29,7 +23,13 @@ export class RuntimeDrawMethodOptimizer {
29
23
  * @returns {boolean} true if a change was made, false otherwise
30
24
  */
31
25
  step() {
32
- const ecd = this.__ecd;
26
+ const system = this.__system;
27
+
28
+ if (system === null) {
29
+ return false;
30
+ }
31
+
32
+ const ecd = system.entityManager.dataset;
33
33
 
34
34
  if (ecd === null) {
35
35
  // no dataset attached
@@ -64,13 +64,13 @@ export class RuntimeDrawMethodOptimizer {
64
64
  return false;
65
65
  }
66
66
 
67
- const use_count = this.__system.getGeometryUsageCounters().get(sg.geometry.id);
67
+ const use_count = system.getGeometryUsageCounters().get(sg.geometry.id);
68
68
 
69
69
  /**
70
70
  *
71
71
  * @type {ShadedGeometryRendererContext|undefined}
72
72
  */
73
- const first_context = this.__system.__view_contexts.values().next().value;
73
+ const first_context = system.__view_contexts.values().next().value;
74
74
 
75
75
  if (first_context === undefined) {
76
76
  return false;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "productName": "Meep",
6
6
  "description": "production-ready JavaScript game engine based on Entity Component System Architecture",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.36.25",
8
+ "version": "2.36.26",
9
9
  "dependencies": {
10
10
  "gl-matrix": "3.4.3",
11
11
  "fast-levenshtein": "2.0.6",