@woosh/meep-engine 2.59.3 → 2.59.5

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.
@@ -69105,6 +69105,48 @@ class SGMesh {
69105
69105
  */
69106
69106
  __initial_bounds = new AABB3();
69107
69107
 
69108
+ /**
69109
+ *
69110
+ * @param {SGMesh} other
69111
+ * @returns {boolean}
69112
+ */
69113
+ equals(other) {
69114
+ if (other === undefined || other === null) {
69115
+ return false;
69116
+ }
69117
+
69118
+ return this.__url === other.__url
69119
+ && this.flags === other.flags
69120
+ && this.materialOverride === other.materialOverride;
69121
+ }
69122
+
69123
+ hash() {
69124
+ return computeStringHash(this.__url);
69125
+ }
69126
+
69127
+ /**
69128
+ *
69129
+ * @param {SGMesh} other
69130
+ */
69131
+ copy(other) {
69132
+ this.__url = other.__url;
69133
+ this.__node = null;
69134
+ this.__initial_bounds.copy(other.__initial_bounds);
69135
+ this.#material_override = other.#material_override;
69136
+ }
69137
+
69138
+ /**
69139
+ *
69140
+ * @returns {SGMesh}
69141
+ */
69142
+ clone() {
69143
+ const r = new SGMesh();
69144
+
69145
+ r.copy(this);
69146
+
69147
+ return r;
69148
+ }
69149
+
69108
69150
  /**
69109
69151
  *
69110
69152
  * @param {Material} v
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.59.3",
8
+ "version": "2.59.5",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -5,7 +5,7 @@ interface Type<T> extends Function {
5
5
  }
6
6
 
7
7
  export default class Entity {
8
- public entity: number;
8
+ public id: number;
9
9
 
10
10
  add<T>(component: T): Entity
11
11
 
@@ -16,5 +16,13 @@ export class ShadedGeometry {
16
16
 
17
17
  from(geometry: BufferGeometry, material: Material, draw_mode?: DrawMode): void
18
18
 
19
+ copy(other:ShadedGeometry):void
20
+
21
+ clone():ShadedGeometry
22
+
23
+ equals(other:ShadedGeometry):boolean
24
+
25
+ hash():number
26
+
19
27
  static from(geometry: BufferGeometry, material: Material, draw_mode?: DrawMode): ShadedGeometry
20
28
  }
@@ -14,4 +14,12 @@ export class SGMesh {
14
14
  getUntransformedBoundingBox(out: AABB3): void
15
15
 
16
16
  static fromURL(url: string): SGMesh
17
+
18
+ equals(other: SGMesh): boolean
19
+
20
+ hash(): number
21
+
22
+ copy(other: SGMesh): void
23
+
24
+ clone(): SGMesh
17
25
  }
@@ -1,4 +1,5 @@
1
1
  import {AABB3} from "../../../../../core/geom/3d/aabb/AABB3.js";
2
+ import {computeStringHash} from "../../../../../core/primitives/strings/computeStringHash.js";
2
3
  import {entity_node_compute_bounding_box} from "../../../../ecs/parent/entity_node_compute_bounding_box.js";
3
4
  import {ShadedGeometry} from "../ShadedGeometry.js";
4
5
 
@@ -49,6 +50,48 @@ export class SGMesh {
49
50
  */
50
51
  __initial_bounds = new AABB3();
51
52
 
53
+ /**
54
+ *
55
+ * @param {SGMesh} other
56
+ * @returns {boolean}
57
+ */
58
+ equals(other) {
59
+ if (other === undefined || other === null) {
60
+ return false;
61
+ }
62
+
63
+ return this.__url === other.__url
64
+ && this.flags === other.flags
65
+ && this.materialOverride === other.materialOverride;
66
+ }
67
+
68
+ hash() {
69
+ return computeStringHash(this.__url);
70
+ }
71
+
72
+ /**
73
+ *
74
+ * @param {SGMesh} other
75
+ */
76
+ copy(other) {
77
+ this.__url = other.__url;
78
+ this.__node = null;
79
+ this.__initial_bounds.copy(other.__initial_bounds);
80
+ this.#material_override = other.#material_override;
81
+ }
82
+
83
+ /**
84
+ *
85
+ * @returns {SGMesh}
86
+ */
87
+ clone() {
88
+ const r = new SGMesh();
89
+
90
+ r.copy(this);
91
+
92
+ return r;
93
+ }
94
+
52
95
  /**
53
96
  *
54
97
  * @param {Material} v