@woosh/meep-engine 2.110.6 → 2.110.8
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 +25 -14
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +25 -14
- package/package.json +1 -1
- package/src/core/geom/2d/aabb/AABB2.d.ts +2 -0
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +3 -1
- package/src/core/geom/3d/tetrahedra/prototypeTetrahedraBuilder.js +42 -39
- package/src/core/process/worker/WorkerBuilder.js +1 -1
- package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
- package/src/core/process/worker/extractTransferables.js +3 -1
- package/src/engine/asset/loaders/material/computeTextureEquality.d.ts.map +1 -1
- package/src/engine/asset/loaders/material/computeTextureEquality.js +4 -6
- package/src/engine/asset/loaders/material/computeTextureHash.d.ts.map +1 -1
- package/src/engine/asset/loaders/material/computeTextureHash.js +6 -6
- package/src/engine/graphics/ecs/trail2d/Trail2DSystem.js +1 -1
- package/src/engine/graphics/material/manager/MaterialManager.js +3 -3
- package/src/engine/graphics/texture/isImageBitmap.d.ts +7 -0
- package/src/engine/graphics/texture/isImageBitmap.d.ts.map +1 -0
- package/src/engine/graphics/texture/isImageBitmap.js +12 -0
- package/src/engine/graphics/trail/x/RibbonXPlugin.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonXPlugin.js +9 -1
package/build/meep.module.js
CHANGED
|
@@ -63807,7 +63807,7 @@ class WorkerBuilder {
|
|
|
63807
63807
|
result.push(obj);
|
|
63808
63808
|
} else if (obj.buffer instanceof ArrayBuffer) {
|
|
63809
63809
|
result.push(obj.buffer);
|
|
63810
|
-
} else if (obj instanceof ImageBitmap) {
|
|
63810
|
+
} else if (typeof ImageBitmap !== "undefined" && obj instanceof ImageBitmap) {
|
|
63811
63811
|
result.push(obj);
|
|
63812
63812
|
} else {
|
|
63813
63813
|
for (var i in obj) {
|
|
@@ -76225,6 +76225,19 @@ function murmur3_32(key, seed) {
|
|
|
76225
76225
|
return h1 >>> 0;
|
|
76226
76226
|
}
|
|
76227
76227
|
|
|
76228
|
+
/**
|
|
76229
|
+
* Guards against cases where ImageBitmap doesn't exist
|
|
76230
|
+
* @param {*} image
|
|
76231
|
+
* @return {boolean}
|
|
76232
|
+
*/
|
|
76233
|
+
function isImageBitmap(image) {
|
|
76234
|
+
/**
|
|
76235
|
+
* check that browser/environment has the class at all to avoid potential exceptions
|
|
76236
|
+
* Required for Safari below version 15.6
|
|
76237
|
+
*/
|
|
76238
|
+
return typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap;
|
|
76239
|
+
}
|
|
76240
|
+
|
|
76228
76241
|
/**
|
|
76229
76242
|
* Transfer bitmap contents to Sampler2D, effectively moving data to CPU, making it readable
|
|
76230
76243
|
* @param {WebGL2RenderingContext} gl
|
|
@@ -76447,15 +76460,14 @@ function computeImageDataHash(image) {
|
|
|
76447
76460
|
|
|
76448
76461
|
let result = 0;
|
|
76449
76462
|
|
|
76450
|
-
if (
|
|
76451
|
-
|
|
76452
|
-
// Required for Safari below version 15.6
|
|
76453
|
-
ImageBitmap !== undefined
|
|
76454
|
-
&& (image instanceof ImageBitmap)
|
|
76455
|
-
) {
|
|
76463
|
+
if (isImageBitmap(image)) {
|
|
76464
|
+
|
|
76456
76465
|
result = computeImageBitmapHash(image);
|
|
76466
|
+
|
|
76457
76467
|
} else if (image instanceof HTMLImageElement) {
|
|
76468
|
+
|
|
76458
76469
|
result = computeStringHash(image.src);
|
|
76470
|
+
|
|
76459
76471
|
}
|
|
76460
76472
|
|
|
76461
76473
|
let width = 0;
|
|
@@ -76652,13 +76664,10 @@ function textureImagesEqual(a, b) {
|
|
|
76652
76664
|
return false;
|
|
76653
76665
|
}
|
|
76654
76666
|
|
|
76655
|
-
if (
|
|
76656
|
-
|
|
76657
|
-
// Required for Safari below version 15.6
|
|
76658
|
-
ImageBitmap !== undefined
|
|
76659
|
-
&& (a instanceof ImageBitmap && b instanceof ImageBitmap)
|
|
76660
|
-
) {
|
|
76667
|
+
if (isImageBitmap(a) && isImageBitmap(b)) {
|
|
76668
|
+
|
|
76661
76669
|
return computeImageBitmapEquality(a, b);
|
|
76670
|
+
|
|
76662
76671
|
}
|
|
76663
76672
|
|
|
76664
76673
|
if (Array.isArray(a) && Array.isArray(b)) {
|
|
@@ -80698,8 +80707,10 @@ class AABB2 {
|
|
|
80698
80707
|
*
|
|
80699
80708
|
* @param {Vector2} result
|
|
80700
80709
|
*/
|
|
80701
|
-
getCenter(result) {
|
|
80710
|
+
getCenter(result = new Vector2()) {
|
|
80702
80711
|
result.set(this.centerX, this.centerY);
|
|
80712
|
+
|
|
80713
|
+
return result;
|
|
80703
80714
|
}
|
|
80704
80715
|
|
|
80705
80716
|
/**
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/AABB2.js"],"names":[],"mappings":";AAYA;;;GAGG;AACH;IACI;;;;;;OAMG;IACH,gEA+BC;IApBG;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IAGhB;;;OAGG;IACH,WAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,aAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QA8BlB;IAED;;;OAGG;IACH,sBAFW,MAAM,QAShB;IAED;;;;;OAKG;IACH,sBAJW,KAAK,UACL,KAAK,GACH,OAAO,CAcnB;IAED;;;;OAIG;IACH,qBAHW,KAAK,GACH,OAAO,CAcnB;IAED;;;;;;;OAOG;IACH,0EAMC;IAED;;;;OAIG;IACH,qBAHW,MAAM,KACN,MAAM,QAKhB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,0BALW,OAAO,MACP,OAAO,UACP,OAAO,GACL,OAAO,CA0BnB;IAED;;;;OAIG;IACH,kCAHW,OAAO,UACP,OAAO,QAmBjB;IAED;;;;OAIG;IACH,wBAHW,KAAK,GACH,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,sBANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CA4BlB;IAED;;;OAGG;IACH,eAFa,MAAM,CASlB;IAED;;;OAGG;IACH,sBAFY,MAAM,CAYjB;IAED;;;;;OAKG;IACH,iBAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,mBAFW,KAAK,QAIf;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/AABB2.js"],"names":[],"mappings":";AAYA;;;GAGG;AACH;IACI;;;;;;OAMG;IACH,gEA+BC;IApBG;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IAGhB;;;OAGG;IACH,WAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,aAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QA8BlB;IAED;;;OAGG;IACH,sBAFW,MAAM,QAShB;IAED;;;;;OAKG;IACH,sBAJW,KAAK,UACL,KAAK,GACH,OAAO,CAcnB;IAED;;;;OAIG;IACH,qBAHW,KAAK,GACH,OAAO,CAcnB;IAED;;;;;;;OAOG;IACH,0EAMC;IAED;;;;OAIG;IACH,qBAHW,MAAM,KACN,MAAM,QAKhB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,0BALW,OAAO,MACP,OAAO,UACP,OAAO,GACL,OAAO,CA0BnB;IAED;;;;OAIG;IACH,kCAHW,OAAO,UACP,OAAO,QAmBjB;IAED;;;;OAIG;IACH,wBAHW,KAAK,GACH,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,sBANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CA4BlB;IAED;;;OAGG;IACH,eAFa,MAAM,CASlB;IAED;;;OAGG;IACH,sBAFY,MAAM,CAYjB;IAED;;;;;OAKG;IACH,iBAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,mBAFW,KAAK,QAIf;IAED;;;OAGG;IACH,mBAFW,OAAO,WAMjB;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,sBAGC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,aAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,qBAEC;IAED;;;;;;;OAOG;IACH,0DAiBC;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;;OAIG;IACH,aAHW,MAAM,UACN,MAAM,QAIhB;IAED;;;OAGG;IACH,SAFa,KAAK,CAIjB;IAED;;;;OAIG;IACH,YAHW,KAAK,GACH,KAAK,CAIjB;IAED;;;;OAIG;IACH,cAHW,KAAK,GACH,OAAO,CAOnB;IAED;;;;;;OAMG;IACH,UALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;;OAMG;IACH,uBALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAsBhB;IAED;;OAEG;IACH,oCAEC;IAED,mBAEC;IAED;;;;;MAOC;IAED,0BAEC;CACJ;;;qBAqCS,KAAK;qBAML,KAAK;;oBAhlBK,kBAAkB;AAwiBtC;;;;;;;GAOG;AACH,gDANW,KAAK,MACL,KAAK,MACL,OAAO,MACP,OAAO,GACL,OAAO,CAsBnB"}
|
|
@@ -7,6 +7,7 @@ import { ShadedGeometry } from "../../../../engine/graphics/ecs/mesh-v2/ShadedGe
|
|
|
7
7
|
import { ShadedGeometrySystem } from "../../../../engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js";
|
|
8
8
|
import { Gizmo } from "../../../../engine/graphics/render/gizmo/Gizmo.js";
|
|
9
9
|
import { GizmoRenderingPlugin } from "../../../../engine/graphics/render/gizmo/GizmoRenderingPlugin.js";
|
|
10
|
+
import { randomFloatBetween } from "../../../math/random/randomFloatBetween.js";
|
|
10
11
|
import { seededRandom } from "../../../math/random/seededRandom.js";
|
|
11
12
|
import { number_pretty_print } from "../../../primitives/numbers/number_pretty_print.js";
|
|
12
13
|
import { delay } from "../../../process/delay.js";
|
|
@@ -14,8 +15,38 @@ import { AABB3 } from "../aabb/AABB3.js";
|
|
|
14
15
|
import { make_justified_point_grid } from "../util/make_justified_point_grid.js";
|
|
15
16
|
import { build_tetrahedral_mesh_buffer_geometry } from "./build_tetrahedral_mesh_buffer_geometry.js";
|
|
16
17
|
import { compute_delaunay_tetrahedral_mesh } from "./delaunay/compute_delaunay_tetrahedral_mesh.js";
|
|
18
|
+
import { tetrahedral_mesh_build_from_grid } from "./delaunay/tetrahedral_mesh_build_from_grid.js";
|
|
17
19
|
import { TetrahedralMesh } from "./TetrahedralMesh.js";
|
|
18
20
|
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {TetrahedralMesh} tetrahedra
|
|
25
|
+
* @param {number[]} points
|
|
26
|
+
*/
|
|
27
|
+
function make_delaunay_grid(tetrahedra, points) {
|
|
28
|
+
|
|
29
|
+
const random = seededRandom();
|
|
30
|
+
|
|
31
|
+
for (let i = 0; i < 600; i++) {
|
|
32
|
+
points.push(
|
|
33
|
+
randomFloatBetween(random, -100, 100),
|
|
34
|
+
randomFloatBetween(random, 0, 150),
|
|
35
|
+
randomFloatBetween(random, -100, 100),
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
make_justified_point_grid(
|
|
40
|
+
new AABB3(-100, 0, -100, 100, 150, 100),
|
|
41
|
+
20,
|
|
42
|
+
(x, y, z) => {
|
|
43
|
+
points.push(x, y, z);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
compute_delaunay_tetrahedral_mesh(tetrahedra, points, points.length / 3);
|
|
48
|
+
}
|
|
49
|
+
|
|
19
50
|
/**
|
|
20
51
|
*
|
|
21
52
|
* @param {Engine} engine
|
|
@@ -30,51 +61,23 @@ async function main(engine) {
|
|
|
30
61
|
const offset = [7.5, 1, 7.5];
|
|
31
62
|
const scale = [.5, .5, .5];
|
|
32
63
|
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @type {number[]}
|
|
67
|
+
*/
|
|
33
68
|
const points = [];
|
|
34
69
|
|
|
35
|
-
|
|
36
|
-
// 0, 0, 0,
|
|
37
|
-
// 10, 0, 0,
|
|
38
|
-
// 10, 0, 10,
|
|
39
|
-
// 0, 0, 10,
|
|
40
|
-
//
|
|
41
|
-
// 0, 10, 0,
|
|
42
|
-
// 10, 10, 0,
|
|
43
|
-
// 10, 10, 10,
|
|
44
|
-
// 0, 10, 10,
|
|
45
|
-
// );
|
|
46
|
-
|
|
47
|
-
const random = seededRandom();
|
|
48
|
-
|
|
49
|
-
// for (let i = 0; i < 600; i++) {
|
|
50
|
-
// points.push(
|
|
51
|
-
// randomFloatBetween(random, -100, 100),
|
|
52
|
-
// randomFloatBetween(random, 0, 150),
|
|
53
|
-
// randomFloatBetween(random, -100, 100),
|
|
54
|
-
// );
|
|
55
|
-
// }
|
|
56
|
-
|
|
57
|
-
make_justified_point_grid(
|
|
58
|
-
new AABB3(-100, 0, -100, 100, 150, 100),
|
|
59
|
-
20,
|
|
60
|
-
(x, y, z) => {
|
|
61
|
-
points.push(x, y, z);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
70
|
+
const tetrahedra = new TetrahedralMesh();
|
|
64
71
|
|
|
65
72
|
await delay(1000);
|
|
66
73
|
|
|
67
|
-
const tetrahedra = new TetrahedralMesh();
|
|
68
74
|
console.time('mesh build');
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// 64, 32, 64
|
|
76
|
-
// )
|
|
77
|
-
// console.profileEnd('mesh build');
|
|
75
|
+
tetrahedral_mesh_build_from_grid(
|
|
76
|
+
tetrahedra,
|
|
77
|
+
points,
|
|
78
|
+
new AABB3(-10, 0, -10, 10, 10, 10),
|
|
79
|
+
8, 4, 8
|
|
80
|
+
)
|
|
78
81
|
console.timeEnd('mesh build');
|
|
79
82
|
console.log(`Mesh build for ${number_pretty_print(points.length / 3)} points`)
|
|
80
83
|
|
|
@@ -115,7 +115,7 @@ class WorkerBuilder {
|
|
|
115
115
|
result.push(obj);
|
|
116
116
|
} else if (obj.buffer instanceof ArrayBuffer) {
|
|
117
117
|
result.push(obj.buffer);
|
|
118
|
-
} else if (obj instanceof ImageBitmap) {
|
|
118
|
+
} else if (typeof ImageBitmap !== "undefined" && obj instanceof ImageBitmap) {
|
|
119
119
|
result.push(obj);
|
|
120
120
|
} else {
|
|
121
121
|
for (var i in obj) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractTransferables.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/extractTransferables.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractTransferables.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/extractTransferables.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,oEAgBC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isImageBitmap } from "../../../engine/graphics/texture/isImageBitmap.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
*
|
|
3
5
|
* @param {*} obj
|
|
@@ -11,7 +13,7 @@ export function extractTransferables(obj, result) {
|
|
|
11
13
|
result.push(obj);
|
|
12
14
|
} else if (obj.buffer instanceof ArrayBuffer) {
|
|
13
15
|
result.push(obj.buffer);
|
|
14
|
-
} else if (obj
|
|
16
|
+
} else if (isImageBitmap(obj)) {
|
|
15
17
|
result.push(obj);
|
|
16
18
|
} else {
|
|
17
19
|
for (let i in obj) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeTextureEquality.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/asset/loaders/material/computeTextureEquality.js"],"names":[],"mappings":"
|
|
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,5 +1,6 @@
|
|
|
1
1
|
import { fastArrayEquals } from "../../../../core/collection/array/fastArrayEquals.js";
|
|
2
2
|
import { isTypedArray } from "../../../../core/collection/array/typed/isTypedArray.js";
|
|
3
|
+
import { isImageBitmap } from "../../../graphics/texture/isImageBitmap.js";
|
|
3
4
|
import { computeImageBitmapEquality } from "./computeImageBitmapEquality.js";
|
|
4
5
|
|
|
5
6
|
//
|
|
@@ -93,13 +94,10 @@ export function textureImagesEqual(a, b) {
|
|
|
93
94
|
return false;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
// Required for Safari below version 15.6
|
|
99
|
-
ImageBitmap !== undefined
|
|
100
|
-
&& (a instanceof ImageBitmap && b instanceof ImageBitmap)
|
|
101
|
-
) {
|
|
97
|
+
if (isImageBitmap(a) && isImageBitmap(b)) {
|
|
98
|
+
|
|
102
99
|
return computeImageBitmapEquality(a, b);
|
|
100
|
+
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
if (Array.isArray(a) && Array.isArray(b)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeTextureHash.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/asset/loaders/material/computeTextureHash.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computeTextureHash.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/asset/loaders/material/computeTextureHash.js"],"names":[],"mappings":"AAwBA;;;;GAIG;AACH;;WAHoD,MAAM;YAAQ,MAAM;IAC5D,MAAM,CAsCjB;AA4CD;;;;GAIG;AACH,sCAHW,UAAQ,MAAM,OAAO,GACnB,MAAM,CAqClB"}
|
|
@@ -2,6 +2,7 @@ import { computeHashIntegerArray } from "../../../../core/collection/array/compu
|
|
|
2
2
|
import { murmur3_32 } from "../../../../core/math/hash/murmur3_32.js";
|
|
3
3
|
import { computeHashFloat } from "../../../../core/primitives/numbers/computeHashFloat.js";
|
|
4
4
|
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
|
|
5
|
+
import { isImageBitmap } from "../../../graphics/texture/isImageBitmap.js";
|
|
5
6
|
import { computeImageBitmapHash } from "./computeImageBitmapHash.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -35,15 +36,14 @@ export function computeImageDataHash(image) {
|
|
|
35
36
|
|
|
36
37
|
let result = 0;
|
|
37
38
|
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
// Required for Safari below version 15.6
|
|
41
|
-
ImageBitmap !== undefined
|
|
42
|
-
&& (image instanceof ImageBitmap)
|
|
43
|
-
) {
|
|
39
|
+
if (isImageBitmap(image)) {
|
|
40
|
+
|
|
44
41
|
result = computeImageBitmapHash(image);
|
|
42
|
+
|
|
45
43
|
} else if (image instanceof HTMLImageElement) {
|
|
44
|
+
|
|
46
45
|
result = computeStringHash(image.src);
|
|
46
|
+
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
let width = 0;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HashMap } from "../../../../core/collection/map/HashMap.js";
|
|
2
|
-
import { ManagedMaterial } from "./ManagedMaterial.js";
|
|
3
1
|
import { Cache } from "../../../../core/cache/Cache.js";
|
|
4
|
-
import {
|
|
2
|
+
import { HashMap } from "../../../../core/collection/map/HashMap.js";
|
|
5
3
|
import { computeMaterialEquality } from "../../../asset/loaders/material/computeMaterialEquality.js";
|
|
4
|
+
import { computeMaterialHash } from "../../../asset/loaders/material/computeMaterialHash.js";
|
|
5
|
+
import { ManagedMaterial } from "./ManagedMaterial.js";
|
|
6
6
|
|
|
7
7
|
export class MaterialManager {
|
|
8
8
|
constructor() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isImageBitmap.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics/texture/isImageBitmap.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,2CAFY,OAAO,CAQlB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guards against cases where ImageBitmap doesn't exist
|
|
3
|
+
* @param {*} image
|
|
4
|
+
* @return {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export function isImageBitmap(image) {
|
|
7
|
+
/**
|
|
8
|
+
* check that browser/environment has the class at all to avoid potential exceptions
|
|
9
|
+
* Required for Safari below version 15.6
|
|
10
|
+
*/
|
|
11
|
+
return typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap;
|
|
12
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RibbonXPlugin.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/x/RibbonXPlugin.js"],"names":[],"mappings":"AASA;IACI,8BA6BC;IA1BG,WAA2B;IAE3B;;;;OAIG;IACH,+BAKE;IAEF;;;;MAIC;IAED;;;;OAIG;IACH,oBAAwC;IAG5C,sCAIC;IAED,wBAMC;IAED,yBAKC;IAED;;;;OAIG;IACH,0EAIC;IAED;;;;OAIG;IACH,8CAFa,eAAe,CAe3B;IAGD;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"RibbonXPlugin.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/trail/x/RibbonXPlugin.js"],"names":[],"mappings":"AASA;IACI,8BA6BC;IA1BG,WAA2B;IAE3B;;;;OAIG;IACH,+BAKE;IAEF;;;;MAIC;IAED;;;;OAIG;IACH,oBAAwC;IAG5C,sCAIC;IAED,wBAMC;IAED,yBAKC;IAED;;;;OAIG;IACH,0EAIC;IAED;;;;OAIG;IACH,8CAFa,eAAe,CAe3B;IAGD;;;;;OAKG;IACH,yBAsCC;CACJ;6BAtI4B,iCAAiC;wBAL1B,OAAO;gCAOX,sBAAsB"}
|
|
@@ -119,7 +119,15 @@ export class RibbonXPlugin extends EnginePlugin {
|
|
|
119
119
|
path: spec.diffuse,
|
|
120
120
|
type: GameAssetType.Texture,
|
|
121
121
|
callback: (asset) => {
|
|
122
|
-
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @type {Texture}
|
|
125
|
+
*/
|
|
126
|
+
const texture = asset.create();
|
|
127
|
+
|
|
128
|
+
texture.generateMipmaps = true;
|
|
129
|
+
|
|
130
|
+
material.uniforms.uDiffuse.value = texture;
|
|
123
131
|
}, failure: console.warn
|
|
124
132
|
});
|
|
125
133
|
|