@woosh/meep-engine 2.37.8 → 2.37.9
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.
|
@@ -49,7 +49,7 @@ export class MicronRenderPlugin extends EnginePlugin {
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
*
|
|
52
|
-
* @type {AsyncRemoteHashMap}
|
|
52
|
+
* @type {AsyncRemoteHashMap<THREE.BufferGeometry, MicronGeometry>}
|
|
53
53
|
* @private
|
|
54
54
|
*/
|
|
55
55
|
this.__persisted_geometry = new AsyncRemoteHashMap({
|
|
@@ -60,6 +60,7 @@ export class MicronRenderPlugin extends EnginePlugin {
|
|
|
60
60
|
storageKeyPrefix: STORAGE_KEY,
|
|
61
61
|
|
|
62
62
|
});
|
|
63
|
+
|
|
63
64
|
/**
|
|
64
65
|
*
|
|
65
66
|
* @type {AbstractAsyncMap<THREE.BufferGeometry, MicronGeometry>}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AbstractRenderAdapter } from "../../../ecs/mesh-v2/render/adapters/AbstractRenderAdapter.js";
|
|
2
2
|
import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
3
|
-
import { buildMicronGeometryFromBufferGeometry } from "../../build/buildMicronGeometryFromBufferGeometry.js";
|
|
4
3
|
import { ShadedGeometryFlags } from "../../../ecs/mesh-v2/ShadedGeometryFlags.js";
|
|
5
4
|
import { MaterialVertexSpec, MaterialVertexSpecFlags } from "../../render/v1/MaterialVertexSpec.js";
|
|
6
5
|
import { compute_geometry_polycount } from "../../../geometry/compute_geometry_polycount.js";
|
|
@@ -26,7 +25,11 @@ const MICRON_POLYCOUNT_THRESHOLD_MAX = 10000;
|
|
|
26
25
|
|
|
27
26
|
export class MicronShadedGeometryRenderAdapter extends AbstractRenderAdapter {
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {AbstractAsyncMap<THREE.BufferGeometry, MicronGeometry>} cache
|
|
31
|
+
*/
|
|
32
|
+
constructor(cache) {
|
|
30
33
|
super();
|
|
31
34
|
|
|
32
35
|
/**
|
|
@@ -48,6 +51,13 @@ export class MicronShadedGeometryRenderAdapter extends AbstractRenderAdapter {
|
|
|
48
51
|
* @private
|
|
49
52
|
*/
|
|
50
53
|
this.__geometry_building_promises = new Map();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @type {AbstractAsyncMap<THREE.BufferGeometry, MicronGeometry>}
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
this.__cache = cache;
|
|
51
61
|
}
|
|
52
62
|
|
|
53
63
|
score(geometry, material, instance_count) {
|
|
@@ -72,9 +82,10 @@ export class MicronShadedGeometryRenderAdapter extends AbstractRenderAdapter {
|
|
|
72
82
|
return micron_geometry;
|
|
73
83
|
|
|
74
84
|
} else {
|
|
85
|
+
|
|
75
86
|
// no micron geometry
|
|
76
87
|
if (!this.__geometry_building_promises.has(geometry_id)) {
|
|
77
|
-
const p =
|
|
88
|
+
const p = this.__cache.get(sg.geometry);
|
|
78
89
|
|
|
79
90
|
this.__geometry_building_promises.set(geometry_id, p);
|
|
80
91
|
|
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.37.
|
|
8
|
+
"version": "2.37.9",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|