@woosh/meep-engine 2.33.59 → 2.33.60
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/core/bvh2/aabb3/AABB3.js +4 -1
- package/core/bvh2/traversal/traverseBinaryNodeUsingVisitor.js +6 -6
- package/core/cache/Cache.js +7 -0
- package/core/collection/array/fastArrayEquals.js +17 -0
- package/core/collection/array/typed/is_typed_array_equals.js +58 -0
- package/core/collection/map/AbstractAsyncMap.js +30 -0
- package/core/collection/map/AsyncMapWrapper.js +16 -0
- package/core/collection/map/AsyncRemoteHashMap.js +358 -0
- package/core/collection/map/CachedAsyncMap.js +34 -0
- package/core/geom/Vector4.js +5 -5
- package/engine/animation/removeEntityGenericEffect.js +22 -31
- package/engine/asset/Asset.js +0 -45
- package/engine/asset/AssetDescription.js +51 -0
- package/engine/asset/AssetManager.d.ts +7 -0
- package/engine/asset/AssetManager.js +98 -2
- package/engine/asset/AssetTransformer.d.ts +5 -0
- package/engine/asset/AssetTransformer.js +15 -0
- package/engine/asset/loaders/GLTFAssetLoader.js +27 -25
- package/engine/asset/loaders/material/computeImageBitmapEquality.js +2 -2
- package/engine/asset/loaders/material/computeTextureEquality.js +2 -2
- package/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +60 -45
- package/engine/ecs/storage/binary/BinaryClassUpgrader.js +1 -0
- package/engine/ecs/util/removeComponentsExcept.js +3 -3
- package/engine/graphics/GraphicsEngine.js +3 -3
- package/engine/graphics/ecs/mesh/Mesh.js +5 -5
- package/engine/graphics/ecs/mesh/MeshSystem.js +12 -20
- package/engine/graphics/ecs/trail2d/Trail2D.js +35 -1
- package/engine/graphics/ecs/trail2d/Trail2DSystem.js +26 -19
- package/engine/graphics/ecs/trail2d/makeGradientTrail.js +68 -0
- package/engine/graphics/micron/convert_three_object_to_micron.js +24 -7
- package/engine/graphics/micron/plugin/MicronRenderPlugin.js +107 -4
- package/engine/graphics/micron/plugin/serialization/BufferGeometrySerializationAdapter.js +176 -0
- package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -2
- package/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.js +3 -1
- package/engine/graphics/shadows/ShadowMapRenderer.js +10 -4
- package/engine/graphics/texture/sampler/Sampler2D.js +24 -45
- package/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +3 -0
- package/engine/save/storage/IndexedDBStorage.js +8 -1
- package/package.json +1 -1
|
@@ -132,6 +132,7 @@ function makeConfig(engine) {
|
|
|
132
132
|
|
|
133
133
|
// Plugins
|
|
134
134
|
config.addPlugin(MicronRenderPlugin);
|
|
135
|
+
config.addPlugin(AmbientOcclusionPostProcessEffect);
|
|
135
136
|
|
|
136
137
|
|
|
137
138
|
// Knowledge
|
|
@@ -159,8 +160,6 @@ async function init(harness) {
|
|
|
159
160
|
await engine.graphics.loadEnvironmentMap(buildCubeURLs('data/textures/cubemaps/hip_miramar/32/', '.png'));
|
|
160
161
|
|
|
161
162
|
|
|
162
|
-
await engine.plugins.acquire(AmbientOcclusionPostProcessEffect);
|
|
163
|
-
|
|
164
163
|
await harness.initialize();
|
|
165
164
|
|
|
166
165
|
main(engine);
|
|
@@ -116,14 +116,16 @@ export function query_bvh_frustum_from_texture(
|
|
|
116
116
|
const radius = source_data[light_address + 3];
|
|
117
117
|
|
|
118
118
|
if (!point_light_inside_volume(light_x, light_y, light_z, radius, points, planes)) {
|
|
119
|
+
// cull
|
|
119
120
|
continue;
|
|
120
121
|
}
|
|
122
|
+
|
|
121
123
|
} else if (light_type === 3) {
|
|
122
124
|
// decal
|
|
123
125
|
debugger;
|
|
124
126
|
|
|
125
127
|
} else {
|
|
126
|
-
throw new Error(
|
|
128
|
+
throw new Error(`Unsupported light type ${light_type}`);
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
// write to output
|
|
@@ -95,12 +95,18 @@ export class ShadowMapRenderer {
|
|
|
95
95
|
|
|
96
96
|
this.onBeforeRender.send3(renderer, shadow_camera, scene);
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
if (target.width <= 0 || target.height <= 0) {
|
|
99
|
+
// no point in rendering
|
|
100
|
+
} else {
|
|
101
|
+
// do the draw
|
|
102
|
+
renderer.render(scene, shadow_camera);
|
|
103
|
+
|
|
104
|
+
if (renderer.shadowMap.type === VSMShadowMap) {
|
|
105
|
+
this.__do_vsm_pass(shadow);
|
|
106
|
+
}
|
|
102
107
|
}
|
|
103
108
|
|
|
109
|
+
|
|
104
110
|
// restore state
|
|
105
111
|
renderer.setRenderTarget(__rt, __acf, __aml);
|
|
106
112
|
renderer.setScissorTest(__scissor);
|
|
@@ -570,6 +570,10 @@ Sampler2D.prototype.sampleChannelBicubic = function (x, y, channel) {
|
|
|
570
570
|
const x1 = clamp(x, 0, x_max) | 0;
|
|
571
571
|
const y1 = clamp(y, 0, y_max) | 0;
|
|
572
572
|
|
|
573
|
+
// fractional texel position (from the nearest low texel)
|
|
574
|
+
const xd = x - x1;
|
|
575
|
+
const yd = y - y1;
|
|
576
|
+
|
|
573
577
|
const x0 = max2(0, x1 - 1);
|
|
574
578
|
const y0 = max2(0, y1 - 1);
|
|
575
579
|
|
|
@@ -595,61 +599,36 @@ Sampler2D.prototype.sampleChannelBicubic = function (x, y, channel) {
|
|
|
595
599
|
const col2_offset = x2 * itemSize;
|
|
596
600
|
const col3_offset = x3 * itemSize;
|
|
597
601
|
|
|
598
|
-
//
|
|
599
|
-
const
|
|
600
|
-
const
|
|
601
|
-
const
|
|
602
|
-
const
|
|
603
|
-
|
|
604
|
-
const j0 = row1_address + col0_offset;
|
|
605
|
-
const j1 = row1_address + col1_offset;
|
|
606
|
-
const j2 = row1_address + col2_offset;
|
|
607
|
-
const j3 = row1_address + col3_offset;
|
|
602
|
+
// read samples
|
|
603
|
+
const vi0 = data[row0_address + col0_offset];
|
|
604
|
+
const vi1 = data[row0_address + col1_offset];
|
|
605
|
+
const vi2 = data[row0_address + col2_offset];
|
|
606
|
+
const vi3 = data[row0_address + col3_offset];
|
|
608
607
|
|
|
609
|
-
const
|
|
610
|
-
const
|
|
611
|
-
const
|
|
612
|
-
const
|
|
608
|
+
const vj0 = data[row1_address + col0_offset];
|
|
609
|
+
const vj1 = data[row1_address + col1_offset];
|
|
610
|
+
const vj2 = data[row1_address + col2_offset];
|
|
611
|
+
const vj3 = data[row1_address + col3_offset];
|
|
613
612
|
|
|
614
|
-
const
|
|
615
|
-
const
|
|
616
|
-
const
|
|
617
|
-
const
|
|
613
|
+
const vk0 = data[row2_address + col0_offset];
|
|
614
|
+
const vk1 = data[row2_address + col1_offset];
|
|
615
|
+
const vk2 = data[row2_address + col2_offset];
|
|
616
|
+
const vk3 = data[row2_address + col3_offset];
|
|
618
617
|
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
const
|
|
622
|
-
const
|
|
623
|
-
const vi3 = data[i3];
|
|
624
|
-
|
|
625
|
-
const vj0 = data[j0];
|
|
626
|
-
const vj1 = data[j1];
|
|
627
|
-
const vj2 = data[j2];
|
|
628
|
-
const vj3 = data[j3];
|
|
629
|
-
|
|
630
|
-
const vk0 = data[k0];
|
|
631
|
-
const vk1 = data[k1];
|
|
632
|
-
const vk2 = data[k2];
|
|
633
|
-
const vk3 = data[k3];
|
|
634
|
-
|
|
635
|
-
const vl0 = data[l0];
|
|
636
|
-
const vl1 = data[l1];
|
|
637
|
-
const vl2 = data[l2];
|
|
638
|
-
const vl3 = data[l3];
|
|
618
|
+
const vl0 = data[row3_address + col0_offset];
|
|
619
|
+
const vl1 = data[row3_address + col1_offset];
|
|
620
|
+
const vl2 = data[row3_address + col2_offset];
|
|
621
|
+
const vl3 = data[row3_address + col3_offset];
|
|
639
622
|
|
|
640
|
-
const xd = x - x1;
|
|
641
|
-
const yd = y - y1;
|
|
642
623
|
|
|
643
|
-
// perform filtering in X
|
|
624
|
+
// perform filtering in X (rows)
|
|
644
625
|
const s0 = bicubic_terp(xd, vi0, vi1, vi2, vi3);
|
|
645
626
|
const s1 = bicubic_terp(xd, vj0, vj1, vj2, vj3);
|
|
646
627
|
const s2 = bicubic_terp(xd, vk0, vk1, vk2, vk3);
|
|
647
628
|
const s3 = bicubic_terp(xd, vl0, vl1, vl2, vl3);
|
|
648
629
|
|
|
649
|
-
// filter in Y
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
return result;
|
|
630
|
+
// filter in Y (columns)
|
|
631
|
+
return bicubic_terp(yd, s0, s1, s2, s3);
|
|
653
632
|
};
|
|
654
633
|
|
|
655
634
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EntityBehavior } from "./EntityBehavior.js";
|
|
2
2
|
import { BehaviorStatus } from "../BehaviorStatus.js";
|
|
3
3
|
import { BinaryClassSerializationAdapter } from "../../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
|
|
4
|
+
import { assert } from "../../../../core/assert.js";
|
|
4
5
|
|
|
5
6
|
export class WaitForEventBehavior extends EntityBehavior {
|
|
6
7
|
constructor() {
|
|
@@ -26,6 +27,8 @@ export class WaitForEventBehavior extends EntityBehavior {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
fromJSON({ event, target = -1 }) {
|
|
30
|
+
assert.isString(event, 'event');
|
|
31
|
+
|
|
29
32
|
this.event = event;
|
|
30
33
|
this.target = target;
|
|
31
34
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import Storage from "../Storage.js";
|
|
2
2
|
import { IndexedDBTransactionMode } from "./IndexedDBTransactionMode.js";
|
|
3
|
+
import { assert } from "../../../core/assert.js";
|
|
3
4
|
|
|
4
5
|
const MAIN_STORE_NAME = 'main';
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* TODO add QuotaExceededError handling
|
|
9
|
+
*/
|
|
6
10
|
export class IndexedDBStorage extends Storage {
|
|
7
11
|
constructor(name) {
|
|
8
12
|
super();
|
|
9
13
|
|
|
14
|
+
assert.isString(name, 'name');
|
|
15
|
+
|
|
10
16
|
/**
|
|
11
17
|
*
|
|
12
18
|
* @param {IDBDatabase} database
|
|
@@ -43,7 +49,7 @@ export class IndexedDBStorage extends Storage {
|
|
|
43
49
|
|
|
44
50
|
const objectStore = transaction.objectStore(MAIN_STORE_NAME);
|
|
45
51
|
|
|
46
|
-
const idbRequest = objectStore.delete(
|
|
52
|
+
const idbRequest = objectStore.delete(key);
|
|
47
53
|
|
|
48
54
|
if (typeof resolve === "function") {
|
|
49
55
|
|
|
@@ -60,6 +66,7 @@ export class IndexedDBStorage extends Storage {
|
|
|
60
66
|
});
|
|
61
67
|
|
|
62
68
|
}
|
|
69
|
+
|
|
63
70
|
});
|
|
64
71
|
|
|
65
72
|
if (typeof reject === "function") {
|
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.33.
|
|
8
|
+
"version": "2.33.60",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|