@woosh/meep-engine 2.117.3 → 2.117.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.
@@ -76732,8 +76732,30 @@ function computeTextureEquality(a, b) {
76732
76732
 
76733
76733
  /**
76734
76734
  *
76735
- * @param {Image|[]|{width:number, height:number}} a
76736
- * @param {Image|[]|{width:number, height:number}} b
76735
+ * @param {HTMLCanvasElement} a
76736
+ * @param {HTMLCanvasElement} b
76737
+ * @returns {boolean}
76738
+ */
76739
+ function computeImageCanvasEquality(a, b) {
76740
+ if (
76741
+ a.width !== b.width
76742
+ || a.height !== b.height
76743
+ ) {
76744
+ return false;
76745
+ }
76746
+
76747
+ if (a.toDataURL() !== b.toDataURL()) {
76748
+ // kinda slow, but pretty reliable, as we don't actually know what canvases hold, i.e. webgl, 2d etc.
76749
+ return false;
76750
+ }
76751
+
76752
+ return true;
76753
+ }
76754
+
76755
+ /**
76756
+ *
76757
+ * @param {Image|ImageBitmap|HTMLCanvasElement|[]|{width:number, height:number}} a
76758
+ * @param {Image|ImageBitmap|HTMLCanvasElement|[]|{width:number, height:number}} b
76737
76759
  * @returns {boolean}
76738
76760
  */
76739
76761
  function textureImagesEqual(a, b) {
@@ -76763,7 +76785,11 @@ function textureImagesEqual(a, b) {
76763
76785
  if (isImageBitmap(a) && isImageBitmap(b)) {
76764
76786
 
76765
76787
  return computeImageBitmapEquality(a, b);
76766
-
76788
+
76789
+ }
76790
+
76791
+ if (a instanceof HTMLCanvasElement && b instanceof HTMLCanvasElement) {
76792
+ return computeImageCanvasEquality(a, b);
76767
76793
  }
76768
76794
 
76769
76795
  if (Array.isArray(a) && Array.isArray(b)) {
@@ -76788,16 +76814,15 @@ function textureImagesEqual(a, b) {
76788
76814
  }
76789
76815
  }
76790
76816
 
76817
+ return true;
76791
76818
  }
76792
76819
 
76793
76820
  if (isTypedArray(a.data) && isTypedArray(b.data)) {
76794
- if (!textureMipmapEqual(a, b)) {
76795
- return false;
76796
- }
76821
+ return textureMipmapEqual(a, b);
76797
76822
  }
76798
76823
 
76799
- // assume equivalent
76800
- return true;
76824
+ // assume different
76825
+ return false;
76801
76826
  }
76802
76827
 
76803
76828
  /**
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.117.3",
8
+ "version": "2.117.5",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -94,5 +94,7 @@ export default class Quaternion {
94
94
 
95
95
  asArray(): number[]
96
96
 
97
+ static fromEulerAngles(x:number, y:number, z:number):Quaternion;
98
+
97
99
  static readonly identity: Quaternion
98
100
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ *
3
+ * @param {number[]|Float32Array} array
4
+ * @param {number} offset
5
+ * @param {number} x
6
+ * @param {number} y
7
+ * @param {number} z
8
+ */
9
+ export function v3_array_add_in_place(array: number[] | Float32Array, offset: number, x: number, y: number, z: number): void;
10
+ //# sourceMappingURL=v3_array_add_in_place.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v3_array_add_in_place.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec3/v3_array_add_in_place.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,6CANW,MAAM,EAAE,GAAC,YAAY,UACrB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QAMhB"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ *
3
+ * @param {number[]|Float32Array} array
4
+ * @param {number} offset
5
+ * @param {number} x
6
+ * @param {number} y
7
+ * @param {number} z
8
+ */
9
+ export function v3_array_add_in_place(array, offset, x, y, z) {
10
+ array[offset] += x;
11
+ array[offset + 1] += y;
12
+ array[offset + 2] += z;
13
+ }
@@ -7,14 +7,14 @@
7
7
  export function computeTextureEquality(a: Texture, b: Texture): boolean;
8
8
  /**
9
9
  *
10
- * @param {Image|[]|{width:number, height:number}} a
11
- * @param {Image|[]|{width:number, height:number}} b
10
+ * @param {Image|ImageBitmap|HTMLCanvasElement|[]|{width:number, height:number}} a
11
+ * @param {Image|ImageBitmap|HTMLCanvasElement|[]|{width:number, height:number}} b
12
12
  * @returns {boolean}
13
13
  */
14
- export function textureImagesEqual(a: (new (width?: number, height?: number) => HTMLImageElement) | [] | {
14
+ export function textureImagesEqual(a: (new (width?: number, height?: number) => HTMLImageElement) | ImageBitmap | HTMLCanvasElement | [] | {
15
15
  width: number;
16
16
  height: number;
17
- }, b: (new (width?: number, height?: number) => HTMLImageElement) | [] | {
17
+ }, b: (new (width?: number, height?: number) => HTMLImageElement) | ImageBitmap | HTMLCanvasElement | [] | {
18
18
  width: number;
19
19
  height: number;
20
20
  }): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"computeTextureEquality.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/asset/loaders/material/computeTextureEquality.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,gEAFa,OAAO,CAoDnB;AAGD;;;;;GAKG;AACH,sCAJW,8DAAM,EAAE,GAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAC,MAAM,EAAC,MAAM,CAAA;CAAC,KACtC,8DAAM,EAAE,GAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAC,MAAM,EAAC,MAAM,CAAA;CAAC,GACpC,OAAO,CAgEnB"}
1
+ {"version":3,"file":"computeTextureEquality.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/asset/loaders/material/computeTextureEquality.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,gEAFa,OAAO,CAoDnB;AAyBD;;;;;GAKG;AACH,sCAJW,8DAAM,WAAW,GAAC,iBAAiB,GAAC,EAAE,GAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAC,MAAM,EAAC,MAAM,CAAA;CAAC,KACpE,8DAAM,WAAW,GAAC,iBAAiB,GAAC,EAAE,GAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAC,MAAM,EAAC,MAAM,CAAA;CAAC,GAClE,OAAO,CAmEnB"}
@@ -66,8 +66,30 @@ export function computeTextureEquality(a, b) {
66
66
 
67
67
  /**
68
68
  *
69
- * @param {Image|[]|{width:number, height:number}} a
70
- * @param {Image|[]|{width:number, height:number}} b
69
+ * @param {HTMLCanvasElement} a
70
+ * @param {HTMLCanvasElement} b
71
+ * @returns {boolean}
72
+ */
73
+ function computeImageCanvasEquality(a, b) {
74
+ if (
75
+ a.width !== b.width
76
+ || a.height !== b.height
77
+ ) {
78
+ return false;
79
+ }
80
+
81
+ if (a.toDataURL() !== b.toDataURL()) {
82
+ // kinda slow, but pretty reliable, as we don't actually know what canvases hold, i.e. webgl, 2d etc.
83
+ return false;
84
+ }
85
+
86
+ return true;
87
+ }
88
+
89
+ /**
90
+ *
91
+ * @param {Image|ImageBitmap|HTMLCanvasElement|[]|{width:number, height:number}} a
92
+ * @param {Image|ImageBitmap|HTMLCanvasElement|[]|{width:number, height:number}} b
71
93
  * @returns {boolean}
72
94
  */
73
95
  export function textureImagesEqual(a, b) {
@@ -97,7 +119,11 @@ export function textureImagesEqual(a, b) {
97
119
  if (isImageBitmap(a) && isImageBitmap(b)) {
98
120
 
99
121
  return computeImageBitmapEquality(a, b);
100
-
122
+
123
+ }
124
+
125
+ if (a instanceof HTMLCanvasElement && b instanceof HTMLCanvasElement) {
126
+ return computeImageCanvasEquality(a, b);
101
127
  }
102
128
 
103
129
  if (Array.isArray(a) && Array.isArray(b)) {
@@ -122,16 +148,15 @@ export function textureImagesEqual(a, b) {
122
148
  }
123
149
  }
124
150
 
151
+ return true;
125
152
  }
126
153
 
127
154
  if (isTypedArray(a.data) && isTypedArray(b.data)) {
128
- if (!textureMipmapEqual(a, b)) {
129
- return false;
130
- }
155
+ return textureMipmapEqual(a, b);
131
156
  }
132
157
 
133
- // assume equivalent
134
- return true;
158
+ // assume different
159
+ return false;
135
160
  }
136
161
 
137
162
  /**