@woosh/meep-engine 3.4.0 → 3.5.0
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/package.json +1 -1
- package/src/engine/Engine.js +2 -2
- package/src/engine/graphics/CONTEXT_LOSS_RECOVERY_PLAN.md +1 -1
- package/src/engine/graphics3/GraphicsEngine3.d.ts +7 -0
- package/src/engine/graphics3/GraphicsEngine3.d.ts.map +1 -1
- package/src/engine/graphics3/GraphicsEngine3.js +9 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/playground/skinned_blas_refit/README.md +56 -33
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts +2 -1
- package/src/shade/playground/skinned_blas_refit/place_character.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/place_character.js +2 -1
- package/src/view/graphics/{WebGLContextFailureView.d.ts → GraphicsContextFailureView.d.ts} +2 -2
- package/src/view/graphics/GraphicsContextFailureView.d.ts.map +1 -0
- package/src/view/graphics/{WebGLContextFailureView.js → GraphicsContextFailureView.js} +1 -1
- package/src/core/geom/3d/aabb/aabb3_from_three_geometry.d.ts +0 -7
- package/src/core/geom/3d/aabb/aabb3_from_three_geometry.d.ts.map +0 -1
- package/src/core/geom/3d/aabb/aabb3_from_three_geometry.js +0 -18
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.d.ts +0 -7
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.d.ts.map +0 -1
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.js +0 -7
- package/src/engine/ecs/transform/copy_three_transform.d.ts +0 -7
- package/src/engine/ecs/transform/copy_three_transform.d.ts.map +0 -1
- package/src/engine/ecs/transform/copy_three_transform.js +0 -15
- package/src/engine/graphics/ecs/mesh-v2/DeferredBoundsQueue.d.ts +0 -48
- package/src/engine/graphics/ecs/mesh-v2/DeferredBoundsQueue.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/DeferredBoundsQueue.js +0 -88
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.d.ts +0 -63
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +0 -314
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/AbstractRenderAdapter.d.ts +0 -67
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/AbstractRenderAdapter.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/AbstractRenderAdapter.js +0 -130
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/SGCacheKey.d.ts +0 -42
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/SGCacheKey.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/SGCacheKey.js +0 -71
- package/src/engine/graphics/ecs/mesh-v2/render/optimization/RuntimeDrawMethodOptimizer.d.ts +0 -20
- package/src/engine/graphics/ecs/mesh-v2/render/optimization/RuntimeDrawMethodOptimizer.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/render/optimization/RuntimeDrawMethodOptimizer.js +0 -123
- package/src/engine/graphics/ecs/mesh-v2/three_object_to_entity_composition.d.ts +0 -8
- package/src/engine/graphics/ecs/mesh-v2/three_object_to_entity_composition.d.ts.map +0 -1
- package/src/engine/graphics/ecs/mesh-v2/three_object_to_entity_composition.js +0 -55
- package/src/engine/graphics/impostors/octahedral/util/load_mesh_for_bake.d.ts +0 -12
- package/src/engine/graphics/impostors/octahedral/util/load_mesh_for_bake.d.ts.map +0 -1
- package/src/engine/graphics/impostors/octahedral/util/load_mesh_for_bake.js +0 -31
- package/src/view/graphics/WebGLContextFailureView.d.ts.map +0 -1
package/package.json
CHANGED
package/src/engine/Engine.js
CHANGED
|
@@ -10,7 +10,7 @@ import ObservedBoolean from "../core/model/ObservedBoolean.js";
|
|
|
10
10
|
import ConcurrentExecutor from '../core/process/executor/ConcurrentExecutor.js';
|
|
11
11
|
import EmptyView from "../view/elements/EmptyView.js";
|
|
12
12
|
import { ViewStack } from "../view/elements/navigation/ViewStack.js";
|
|
13
|
-
import {
|
|
13
|
+
import { GraphicsContextFailureView } from "../view/graphics/GraphicsContextFailureView.js";
|
|
14
14
|
|
|
15
15
|
import { AssetManager } from './asset/AssetManager.js';
|
|
16
16
|
import { AssetPreloader } from "./asset/preloader/AssetPreloader.js";
|
|
@@ -416,7 +416,7 @@ class Engine {
|
|
|
416
416
|
// Application state is left intact, which keeps a save-on-failure handler viable.
|
|
417
417
|
this.#pause_simulation_for_context_loss();
|
|
418
418
|
|
|
419
|
-
this.viewStack.addChild(new
|
|
419
|
+
this.viewStack.addChild(new GraphicsContextFailureView());
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
#initialize_audio() {
|
|
@@ -203,7 +203,7 @@ already paused is left alone, and never resumed by us — hence the new `Ticker.
|
|
|
203
203
|
accessors, since `pause()`/`resume()` throw when the loop is not cycling.
|
|
204
204
|
|
|
205
205
|
On `Failed`: the simulation is paused, application state is left intact (so a save-on-failure handler
|
|
206
|
-
stays viable), and `
|
|
206
|
+
stays viable), and `GraphicsContextFailureView` explains the situation with a reload button, instead of
|
|
207
207
|
leaving the player looking at a black canvas.
|
|
208
208
|
|
|
209
209
|
---
|
|
@@ -31,6 +31,12 @@ export class GraphicsEngine3 {
|
|
|
31
31
|
* @returns {boolean}
|
|
32
32
|
*/
|
|
33
33
|
get isGraphicsEngine(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Danger zone.
|
|
36
|
+
* Be careful with what you do, with great Renderer comes great responsibility.
|
|
37
|
+
* @returns {Renderer|null}
|
|
38
|
+
*/
|
|
39
|
+
get renderer(): Renderer;
|
|
34
40
|
/**
|
|
35
41
|
* The camera, in the shape the engine's existing consumers read it — `projectionMatrix` and
|
|
36
42
|
* `matrixWorldInverse`, which is what `HeadsUpDisplaySystem` multiplies together. The real
|
|
@@ -317,6 +323,7 @@ export class GraphicsEngine3 {
|
|
|
317
323
|
render(time_delta_seconds?: number): boolean;
|
|
318
324
|
#private;
|
|
319
325
|
}
|
|
326
|
+
import { Renderer } from "../../shade/renderer/Renderer.js";
|
|
320
327
|
import { ShadeCameraAdapter } from "./ShadeCameraAdapter.js";
|
|
321
328
|
import Signal from "../../core/events/signal/Signal.js";
|
|
322
329
|
import Vector1 from "../../core/geom/Vector1.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphicsEngine3.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/GraphicsEngine3.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IACI;;;;;OAKG;IACH,gCAEC;
|
|
1
|
+
{"version":3,"file":"GraphicsEngine3.d.ts","sourceRoot":"","sources":["../../../../src/engine/graphics3/GraphicsEngine3.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IACI;;;;;OAKG;IACH,gCAEC;IAUD;;;;OAIG;IACH,yBAEC;IA0DG;;;;;;OAMG;IACH,QAFU,kBAAkB,CAEsB;IAElD;QACI;;;;;;;;WAQG;mBADO,MAAM;QAIhB;;;;;WAKG;oBADO,MAAM;QAIhB;;;;WAIG;qBADO,MAAM;QAIhB;;;;;;;WAOG;;QAGH;;;;;WAKG;;MAEN;IAED;;OAEG;IACH,YAFU,OAAO,CAEe;IAEhC;;;;;OAKG;IACH,4BAFU,OAAO,CAEyB;IAE1C;;;;;;OAMG;IACH,UAFU,SAAS,CAEY;IAG/B;;OAEG;IACH,YAFU,iBAAiB,GAAC,IAAI,CAEV;IAEtB;;;;;OAKG;IACH,UAFU,OAAO,CAEG;IAEpB;;;;;OAKG;IACH,UAFU,OAAO,CAEG;IAEpB;;OAEG;IACH,YAFU,MAAM,CAEG;IAoBvB;;;;;;;;;;;;OAYG;IACH,mDAEC;IAED;;;;;;;;OAQG;IACH,iBAFW,KAAK,QAoBf;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,iDAOC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,2DAWC;IAED;;;;;;;;;;OAUG;IACH,oCAFa,MAAM,CAclB;IAED;;;;;;OAMG;IACH,8CAFa,OAAO,CAgBnB;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,qBALW,KAAK,GACH,kBAAgB,IAAI,CAehC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,yBARW,KAAK,yBAEL,MAAM,UACN,MAAM,GACJ,QAAQ,SAAS,CAAC,CAwD9B;IAED;;;;OAIG;IACH,0BAEC;IAED;;;;;;;;;;OAUG;IACH,SAFa,QAAQ,IAAI,CAAC,CA4DzB;IAED;;;;;OAKG;IACH,aAiBC;IASD;;;;;;;;OAQG;IACH,8BAHW,OAAO,UAAQ,UACf,OAAO,UAAQ,QAQzB;IAED;;;;;;;;;;;;;;;OAeG;IACH,yBALW,MAAM,KACN,MAAM,6CAMhB;IAED;;;;;;;OAOG;IACH,mBA0BC;IAED;;;;;OAKG;IACH,4BAHW,MAAM,GACJ,OAAO,CAoDnB;;CACJ;yBAxwBwB,kCAAkC;mCAMxB,yBAAyB;mBAbzC,oCAAoC;oBACnC,4BAA4B;wBACxB,4BAA4B;sBAQ9B,kCAAkC;yCAJf,kDAAkD;sBAErE,qCAAqC;0BACjC,0CAA0C"}
|
|
@@ -92,6 +92,15 @@ export class GraphicsEngine3 {
|
|
|
92
92
|
*/
|
|
93
93
|
#renderer = null;
|
|
94
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Danger zone.
|
|
97
|
+
* Be careful with what you do, with great Renderer comes great responsibility.
|
|
98
|
+
* @returns {Renderer|null}
|
|
99
|
+
*/
|
|
100
|
+
get renderer(){
|
|
101
|
+
return this.#renderer;
|
|
102
|
+
}
|
|
103
|
+
|
|
95
104
|
/**
|
|
96
105
|
* Trades internal resolution for frame time — see {@link dynamic_resolution}.
|
|
97
106
|
*
|
|
@@ -64,11 +64,11 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
64
64
|
/**
|
|
65
65
|
* @param {FluidComponent} fluid
|
|
66
66
|
*/
|
|
67
|
-
static "__#
|
|
67
|
+
static "__#349@#refresh_masks"(fluid: FluidComponent): void;
|
|
68
68
|
/**
|
|
69
69
|
* @param {FluidComponent} fluid
|
|
70
70
|
*/
|
|
71
|
-
static "__#
|
|
71
|
+
static "__#349@#clear_field"(fluid: FluidComponent): void;
|
|
72
72
|
/**
|
|
73
73
|
* Mark every cell of `fluid` whose centre lies within `inflation` of the
|
|
74
74
|
* posed shape as solid. Iteration is clipped to the shape's world AABB
|
|
@@ -80,7 +80,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
80
80
|
* @param {number} inflation world-units SDF threshold
|
|
81
81
|
* @param {Float64Array} point length-3 scratch
|
|
82
82
|
*/
|
|
83
|
-
static "__#
|
|
83
|
+
static "__#349@#voxelize"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array): void;
|
|
84
84
|
/**
|
|
85
85
|
* Write the obstacle's translation velocity onto every face of every cell
|
|
86
86
|
* it voxelized — the moving-wall boundary condition. Runs AFTER the mask
|
|
@@ -100,7 +100,7 @@ export class FluidObstacleSystem extends System<any> {
|
|
|
100
100
|
* @param {number} wvy
|
|
101
101
|
* @param {number} wvz
|
|
102
102
|
*/
|
|
103
|
-
static "__#
|
|
103
|
+
static "__#349@#stamp_wall_velocity"(fluid: FluidComponent, posed: PosedShape3D, aabb: Float64Array, inflation: number, point: Float64Array, wvx: number, wvy: number, wvz: number): void;
|
|
104
104
|
constructor();
|
|
105
105
|
dependencies: (typeof FluidObstacle)[];
|
|
106
106
|
components_used: (ResourceAccessSpecification<typeof Transform> | ResourceAccessSpecification<typeof RigidBody> | ResourceAccessSpecification<typeof Collider> | ResourceAccessSpecification<typeof FluidComponent> | ResourceAccessSpecification<typeof FluidObstacle>)[];
|
|
@@ -68,36 +68,59 @@ union, and each clone at its own arena address on a uniform stride.
|
|
|
68
68
|
## Assets
|
|
69
69
|
|
|
70
70
|
`/test_assets/Michelle.glb`, which is gitignored and unpublished — see `test_assets/README.md`.
|
|
71
|
-
|
|
72
|
-
## What the floor disagreement turned out to be
|
|
73
|
-
|
|
74
|
-
For a while the two images disagreed about where the floor ends: a smooth band along its far edge
|
|
75
|
-
that the rasterizer drew and the tracer did not, several thousand pixels at an ordinary camera and
|
|
76
|
-
growing as the camera approached the edge. It read like a hole in a tree, and it was not one.
|
|
77
|
-
|
|
78
|
-
The slab was placed by writing `Node3D.transform_global`, which is **derived** — the doc comment on
|
|
79
|
-
it says so. Its two consumers take placement from opposite ends: `Mesh.updateBoundsBasic` reads
|
|
80
|
-
`transform_global` and publishes the result as the mesh's `meshes` row, and the GPU's `transforms`
|
|
81
|
-
row carries the node's *local* TRS for the hierarchy pass to compose `node.global` from. Writing
|
|
82
|
-
only the first left the second at identity, 0.208 m away:
|
|
83
|
-
|
|
84
|
-
- the rasterizer multiplied positions by `node.global` and drew the slab at the geometry's own
|
|
85
|
-
origin, its far edge ten rows higher up the screen than the floor actually ends;
|
|
86
|
-
- the tracer tested each ray against the *translated* published box before traversing the
|
|
87
|
-
*untranslated* geometry, so rays that would have struck the slab near its far edge were turned
|
|
88
|
-
away by a box that was not around it.
|
|
89
|
-
|
|
90
|
-
Neither renderer was wrong about the data it was given. Padding the published box shrank the band
|
|
91
|
-
because it widened the interval the TLAS test allows — not because anything was tangent, which is
|
|
92
|
-
why a few per cent of pad did what a rounding-scale slack could not.
|
|
93
|
-
|
|
94
|
-
The invariant is in `add_floor.spec.js` and needs no device: published bounds must survive
|
|
95
|
-
`updateMatrices`, because that is the walk which recomputes `transform_global` from the local
|
|
96
|
-
transform. `chunk_ray_query_nearest.spec.js` holds the traversal itself against closed-form slab
|
|
97
|
-
arithmetic in the emulator, including the case where the instance box and the node transform
|
|
98
|
-
disagree.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
71
|
+
|
|
72
|
+
## What the floor disagreement turned out to be
|
|
73
|
+
|
|
74
|
+
For a while the two images disagreed about where the floor ends: a smooth band along its far edge
|
|
75
|
+
that the rasterizer drew and the tracer did not, several thousand pixels at an ordinary camera and
|
|
76
|
+
growing as the camera approached the edge. It read like a hole in a tree, and it was not one.
|
|
77
|
+
|
|
78
|
+
The slab was placed by writing `Node3D.transform_global`, which is **derived** — the doc comment on
|
|
79
|
+
it says so. Its two consumers take placement from opposite ends: `Mesh.updateBoundsBasic` reads
|
|
80
|
+
`transform_global` and publishes the result as the mesh's `meshes` row, and the GPU's `transforms`
|
|
81
|
+
row carries the node's *local* TRS for the hierarchy pass to compose `node.global` from. Writing
|
|
82
|
+
only the first left the second at identity, 0.208 m away:
|
|
83
|
+
|
|
84
|
+
- the rasterizer multiplied positions by `node.global` and drew the slab at the geometry's own
|
|
85
|
+
origin, its far edge ten rows higher up the screen than the floor actually ends;
|
|
86
|
+
- the tracer tested each ray against the *translated* published box before traversing the
|
|
87
|
+
*untranslated* geometry, so rays that would have struck the slab near its far edge were turned
|
|
88
|
+
away by a box that was not around it.
|
|
89
|
+
|
|
90
|
+
Neither renderer was wrong about the data it was given. Padding the published box shrank the band
|
|
91
|
+
because it widened the interval the TLAS test allows — not because anything was tangent, which is
|
|
92
|
+
why a few per cent of pad did what a rounding-scale slack could not.
|
|
93
|
+
|
|
94
|
+
The invariant is in `add_floor.spec.js` and needs no device: published bounds must survive
|
|
95
|
+
`updateMatrices`, because that is the walk which recomputes `transform_global` from the local
|
|
96
|
+
transform. `chunk_ray_query_nearest.spec.js` holds the traversal itself against closed-form slab
|
|
97
|
+
arithmetic in the emulator, including the case where the instance box and the node transform
|
|
98
|
+
disagree.
|
|
99
|
+
|
|
100
|
+
## The quieter version of the same bug: `?count=N`
|
|
101
|
+
|
|
102
|
+
The dancers were placed the same way — by writing `transform_global` — and stacked at the origin
|
|
103
|
+
rather than spreading over a grid. Both renderers agreed about it, so there was no picture to look
|
|
104
|
+
at; the only symptom was that the characters did not go where they were put.
|
|
105
|
+
|
|
106
|
+
They also could not have been fixed by copying the floor's fix, because a skinned mesh's own node
|
|
107
|
+
is not its placement point at all. A skinned vertex lands at
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
mesh.global × inverse(mesh.global) × joint.global × inverse_bind × v
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
— `chunk_skin_blend_mesh_local` folds the leftmost inverse into each joint matrix and the rasterizer
|
|
114
|
+
re-applies `mesh.global`, so the mesh node's transform **cancels exactly**, and
|
|
115
|
+
`compute_skin_world_bounds` composes the published box out of joints without reading it either.
|
|
116
|
+
Michelle's file makes the point structurally: her mesh node `Ch03` carries no local transform, the
|
|
117
|
+
0.01 centimetre scale and the up-axis rotation sit on the root above it, and the joint root
|
|
118
|
+
`mixamorig:Hips` is the mesh node's *sibling*. Nothing under `Ch03` drives a joint.
|
|
119
|
+
|
|
120
|
+
`place_character` therefore hangs each character's roots under a fresh parent whose whole transform
|
|
121
|
+
is the grid offset. That reaches the joints, leaves the file's own transform untouched below it, and
|
|
122
|
+
— because the offset is a *local* transform — survives the walk that recomputes `transform_global`.
|
|
123
|
+
|
|
124
|
+
`place_character.spec.js` holds the invariant the floor's cannot see: **published bounds must move
|
|
125
|
+
by the offset the character was placed at.** Its negative control is the bug itself — writing either
|
|
126
|
+
transform on the mesh node and watching the box not move.
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* actually sit under.
|
|
20
20
|
*
|
|
21
21
|
* Michelle is the shape that makes this concrete. Her file is one root carrying the centimetre
|
|
22
|
-
* scale and the
|
|
22
|
+
* scale and the up-axis rotation (+90° about x, the file's Z-up into the renderer's Y-up), with the
|
|
23
|
+
* mesh node and the joint root as *siblings* beneath it:
|
|
23
24
|
*
|
|
24
25
|
* ```
|
|
25
26
|
* "Character" R=(0.70711, 0, 0, 0.70711) S=(0.01, 0.01, 0.01)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place_character.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/place_character.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"place_character.d.ts","sourceRoot":"","sources":["../../../../../src/shade/playground/skinned_blas_refit/place_character.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,sEAJW,MAAM,KACN,MAAM,GACJ,MAAM,CA+BlB;AAED;;;;;;;;;;;;GAYG;AACH,qCALW,MAAM,SACN,MAAM,WACN,MAAM,GACJ;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAC,CAUlC;uBApHsB,gCAAgC"}
|
|
@@ -21,7 +21,8 @@ import { Node3D } from "../../renderer/scene/Node3D.js";
|
|
|
21
21
|
* actually sit under.
|
|
22
22
|
*
|
|
23
23
|
* Michelle is the shape that makes this concrete. Her file is one root carrying the centimetre
|
|
24
|
-
* scale and the
|
|
24
|
+
* scale and the up-axis rotation (+90° about x, the file's Z-up into the renderer's Y-up), with the
|
|
25
|
+
* mesh node and the joint root as *siblings* beneath it:
|
|
25
26
|
*
|
|
26
27
|
* ```
|
|
27
28
|
* "Character" R=(0.70711, 0, 0, 0.70711) S=(0.01, 0.01, 0.01)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* case where the renderer is dead, which is not a good moment to depend on the localization pipeline
|
|
7
7
|
* having the keys; an application that has them should pass localized strings in.
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class GraphicsContextFailureView extends EmptyView {
|
|
10
10
|
/**
|
|
11
11
|
* @param {string} [title]
|
|
12
12
|
* @param {string} [text]
|
|
@@ -16,4 +16,4 @@ export class WebGLContextFailureView extends EmptyView {
|
|
|
16
16
|
constructor({ title, text, action_label, action }?: string);
|
|
17
17
|
}
|
|
18
18
|
import EmptyView from "../elements/EmptyView.js";
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=GraphicsContextFailureView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphicsContextFailureView.d.ts","sourceRoot":"","sources":["../../../../src/view/graphics/GraphicsContextFailureView.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH;IACI;;;;;OAKG;IACH,oDALW,MAAM,EA4DhB;CACJ;sBA1EqB,0BAA0B"}
|
|
@@ -10,7 +10,7 @@ import LabelView from "../common/LabelView.js";
|
|
|
10
10
|
* case where the renderer is dead, which is not a good moment to depend on the localization pipeline
|
|
11
11
|
* having the keys; an application that has them should pass localized strings in.
|
|
12
12
|
*/
|
|
13
|
-
export class
|
|
13
|
+
export class GraphicsContextFailureView extends EmptyView {
|
|
14
14
|
/**
|
|
15
15
|
* @param {string} [title]
|
|
16
16
|
* @param {string} [text]
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {number[]|ArrayLike<number>|Float32Array} result
|
|
4
|
-
* @param {BufferGeometry} geometry
|
|
5
|
-
*/
|
|
6
|
-
export function aabb3_from_three_geometry(result: number[] | ArrayLike<number> | Float32Array, geometry: BufferGeometry): void;
|
|
7
|
-
//# sourceMappingURL=aabb3_from_three_geometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aabb3_from_three_geometry.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_from_three_geometry.js"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,kDAHW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,kCAYjD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { assert } from "../../../assert.js";
|
|
2
|
-
import { aabb3_from_min_max } from "./aabb3_from_min_max.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @param {number[]|ArrayLike<number>|Float32Array} result
|
|
7
|
-
* @param {BufferGeometry} geometry
|
|
8
|
-
*/
|
|
9
|
-
export function aabb3_from_three_geometry(result, geometry) {
|
|
10
|
-
const gbb = geometry.boundingBox;
|
|
11
|
-
|
|
12
|
-
assert.notNull(gbb, 'boundingBox');
|
|
13
|
-
|
|
14
|
-
const min = gbb.min;
|
|
15
|
-
const max = gbb.max;
|
|
16
|
-
|
|
17
|
-
aabb3_from_min_max(result, min, max);
|
|
18
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Renamed to {@link aabb3_from_three_geometry}. This re-export is kept for backward
|
|
3
|
-
* compatibility (meep is a library; old names are public surface).
|
|
4
|
-
*/
|
|
5
|
-
export const aabb3_from_threejs_geometry: typeof aabb3_from_three_geometry;
|
|
6
|
-
import { aabb3_from_three_geometry } from "./aabb3_from_three_geometry.js";
|
|
7
|
-
//# sourceMappingURL=aabb3_from_threejs_geometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aabb3_from_threejs_geometry.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_from_threejs_geometry.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,2EAAqE;0CAN3B,gCAAgC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { aabb3_from_three_geometry } from "./aabb3_from_three_geometry.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Renamed to {@link aabb3_from_three_geometry}. This re-export is kept for backward
|
|
5
|
-
* compatibility (meep is a library; old names are public surface).
|
|
6
|
-
*/
|
|
7
|
-
export const aabb3_from_threejs_geometry = aabb3_from_three_geometry;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copy_three_transform.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/copy_three_transform.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+FASC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {Transform} transform
|
|
4
|
-
* @param {THREE.Object3D} three_object
|
|
5
|
-
*/
|
|
6
|
-
export function copy_three_transform(transform, three_object) {
|
|
7
|
-
|
|
8
|
-
// copy object transform
|
|
9
|
-
transform.position.copy(three_object.position);
|
|
10
|
-
transform.scale.copy(three_object.scale);
|
|
11
|
-
transform.rotation.copy(three_object.quaternion);
|
|
12
|
-
|
|
13
|
-
//
|
|
14
|
-
transform.matrix.set(three_object.matrix.elements);
|
|
15
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collects {@link ShadedGeometry} components whose bounding box has gone stale under
|
|
3
|
-
* {@link ShadedGeometryFlags.DeferredBoundsUpdate}, until the owner of the BVH is ready
|
|
4
|
-
* to take the updates.
|
|
5
|
-
*
|
|
6
|
-
* WHY THIS EXISTS
|
|
7
|
-
*
|
|
8
|
-
* A {@link Transform} signals `position`, `rotation` and `scale` separately, so one
|
|
9
|
-
* logical move produces several change notifications: two when a caller sets position
|
|
10
|
-
* and rotation, three when the transform is written as a matrix (which is what
|
|
11
|
-
* {@link TransformAttachmentSystem} does for every entity in a hierarchy, and what
|
|
12
|
-
* `Transform.copy` does). Updating bounds on each of those recomputes the same box and
|
|
13
|
-
* walks the same path to the BVH root several times over. Parking the component here
|
|
14
|
-
* instead collapses the batch into one update per component per flush.
|
|
15
|
-
*
|
|
16
|
-
* Entries are appended without a membership test; {@link ShadedGeometry} carries the
|
|
17
|
-
* "already queued" bit so enqueueing stays O(1) and a component appears at most once.
|
|
18
|
-
*/
|
|
19
|
-
export class DeferredBoundsQueue {
|
|
20
|
-
/**
|
|
21
|
-
* Number of components waiting for their bounds to be applied.
|
|
22
|
-
* @returns {number}
|
|
23
|
-
*/
|
|
24
|
-
get size(): number;
|
|
25
|
-
/**
|
|
26
|
-
* Park a component whose bounds have gone stale.
|
|
27
|
-
*
|
|
28
|
-
* The caller must not add a component that is already queued — see
|
|
29
|
-
* {@link ShadedGeometry.updateTransform}, which owns that bit.
|
|
30
|
-
* @param {ShadedGeometry} sg
|
|
31
|
-
* @returns {void}
|
|
32
|
-
*/
|
|
33
|
-
add(sg: ShadedGeometry): void;
|
|
34
|
-
/**
|
|
35
|
-
* Apply every parked update, leaving the BVH consistent with the current transforms.
|
|
36
|
-
*
|
|
37
|
-
* Components that were unlinked while queued, or whose bounds were already settled by
|
|
38
|
-
* a read, are skipped.
|
|
39
|
-
*
|
|
40
|
-
* Must not be re-entered: nothing reached from here writes to a {@link Transform},
|
|
41
|
-
* so no component can go dirty while the batch is being applied.
|
|
42
|
-
* @returns {number} how many components actually had an update applied, which is a
|
|
43
|
-
* useful profiling signal — it is the number of BVH refits the batch cost
|
|
44
|
-
*/
|
|
45
|
-
flush(): number;
|
|
46
|
-
#private;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=DeferredBoundsQueue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeferredBoundsQueue.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/ecs/mesh-v2/DeferredBoundsQueue.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH;IAaI;;;OAGG;IACH,mBAEC;IAED;;;;;;;OAOG;IACH,yBAFa,IAAI,CAIhB;IAED;;;;;;;;;;OAUG;IACH,SAHa,MAAM,CA2BlB;;CACJ"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Collects {@link ShadedGeometry} components whose bounding box has gone stale under
|
|
3
|
-
* {@link ShadedGeometryFlags.DeferredBoundsUpdate}, until the owner of the BVH is ready
|
|
4
|
-
* to take the updates.
|
|
5
|
-
*
|
|
6
|
-
* WHY THIS EXISTS
|
|
7
|
-
*
|
|
8
|
-
* A {@link Transform} signals `position`, `rotation` and `scale` separately, so one
|
|
9
|
-
* logical move produces several change notifications: two when a caller sets position
|
|
10
|
-
* and rotation, three when the transform is written as a matrix (which is what
|
|
11
|
-
* {@link TransformAttachmentSystem} does for every entity in a hierarchy, and what
|
|
12
|
-
* `Transform.copy` does). Updating bounds on each of those recomputes the same box and
|
|
13
|
-
* walks the same path to the BVH root several times over. Parking the component here
|
|
14
|
-
* instead collapses the batch into one update per component per flush.
|
|
15
|
-
*
|
|
16
|
-
* Entries are appended without a membership test; {@link ShadedGeometry} carries the
|
|
17
|
-
* "already queued" bit so enqueueing stays O(1) and a component appears at most once.
|
|
18
|
-
*/
|
|
19
|
-
export class DeferredBoundsQueue {
|
|
20
|
-
/**
|
|
21
|
-
* Retained between flushes and overwritten in place rather than re-allocated.
|
|
22
|
-
* Only the first {@link #size} entries are live.
|
|
23
|
-
* @type {ShadedGeometry[]}
|
|
24
|
-
*/
|
|
25
|
-
#items = [];
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @type {number}
|
|
29
|
-
*/
|
|
30
|
-
#size = 0;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Number of components waiting for their bounds to be applied.
|
|
34
|
-
* @returns {number}
|
|
35
|
-
*/
|
|
36
|
-
get size() {
|
|
37
|
-
return this.#size;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Park a component whose bounds have gone stale.
|
|
42
|
-
*
|
|
43
|
-
* The caller must not add a component that is already queued — see
|
|
44
|
-
* {@link ShadedGeometry.updateTransform}, which owns that bit.
|
|
45
|
-
* @param {ShadedGeometry} sg
|
|
46
|
-
* @returns {void}
|
|
47
|
-
*/
|
|
48
|
-
add(sg) {
|
|
49
|
-
this.#items[this.#size++] = sg;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Apply every parked update, leaving the BVH consistent with the current transforms.
|
|
54
|
-
*
|
|
55
|
-
* Components that were unlinked while queued, or whose bounds were already settled by
|
|
56
|
-
* a read, are skipped.
|
|
57
|
-
*
|
|
58
|
-
* Must not be re-entered: nothing reached from here writes to a {@link Transform},
|
|
59
|
-
* so no component can go dirty while the batch is being applied.
|
|
60
|
-
* @returns {number} how many components actually had an update applied, which is a
|
|
61
|
-
* useful profiling signal — it is the number of BVH refits the batch cost
|
|
62
|
-
*/
|
|
63
|
-
flush() {
|
|
64
|
-
const items = this.#items;
|
|
65
|
-
const size = this.#size;
|
|
66
|
-
|
|
67
|
-
let applied = 0;
|
|
68
|
-
|
|
69
|
-
for (let i = 0; i < size; i++) {
|
|
70
|
-
if (items[i].applyDeferredBoundsUpdate()) {
|
|
71
|
-
applied++;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Drop the references so components unlinked while queued are not held alive
|
|
76
|
-
// until their slot happens to be overwritten — after a teardown the slots may
|
|
77
|
-
// never be reused, and each entry retains a geometry and a material.
|
|
78
|
-
//
|
|
79
|
-
// Done in one sweep rather than per entry inside the loop above: clearing each
|
|
80
|
-
// slot as it was consumed measured ~25% slower per tick on a 2000-mover scene,
|
|
81
|
-
// the store into the object array carrying a GC write barrier each time.
|
|
82
|
-
items.fill(null, 0, size);
|
|
83
|
-
|
|
84
|
-
this.#size = 0;
|
|
85
|
-
|
|
86
|
-
return applied;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export class SGMeshSystem extends System<any> {
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param {Engine} engine
|
|
5
|
-
*/
|
|
6
|
-
constructor(engine: Engine);
|
|
7
|
-
dependencies: (typeof Transform | typeof SGMesh)[];
|
|
8
|
-
components_used: (ResourceAccessSpecification<typeof Transform> | ResourceAccessSpecification<typeof TransformAttachment> | ResourceAccessSpecification<typeof SGMesh> | ResourceAccessSpecification<typeof ShadedGeometry>)[];
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @type {number[]}
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
14
|
-
private __wait_queue;
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @type {number}
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
private __wait_queue_process_index;
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @type {Engine}
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
private __engine;
|
|
27
|
-
/**
|
|
28
|
-
*
|
|
29
|
-
* @type {AssetManager}
|
|
30
|
-
* @private
|
|
31
|
-
*/
|
|
32
|
-
private __assetManager;
|
|
33
|
-
startup(em: any): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @param {number} entity
|
|
37
|
-
* @param {SGMesh} mesh
|
|
38
|
-
* @param {Transform} transform
|
|
39
|
-
*/
|
|
40
|
-
process(entity: number, mesh: SGMesh, transform: Transform): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @param {SGMesh} mesh
|
|
44
|
-
* @param {Transform} transform
|
|
45
|
-
* @param {number} entity
|
|
46
|
-
*/
|
|
47
|
-
link(mesh: SGMesh, transform: Transform, entity: number): void;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @param {SGMesh} mesh
|
|
51
|
-
* @param {Transform} transform
|
|
52
|
-
* @param {number} entity
|
|
53
|
-
*/
|
|
54
|
-
unlink(mesh: SGMesh, transform: Transform, entity: number): void;
|
|
55
|
-
update(time_delta: any): void;
|
|
56
|
-
}
|
|
57
|
-
import { System } from "../../../../ecs/System.js";
|
|
58
|
-
import { Transform } from "../../../../ecs/transform/Transform.js";
|
|
59
|
-
import { SGMesh } from "./SGMesh.js";
|
|
60
|
-
import { ResourceAccessSpecification } from "../../../../../core/model/ResourceAccessSpecification.js";
|
|
61
|
-
import { TransformAttachment } from "../../../../ecs/transform-attachment/TransformAttachment.js";
|
|
62
|
-
import { ShadedGeometry } from "../ShadedGeometry.js";
|
|
63
|
-
//# sourceMappingURL=SGMeshSystem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SGMeshSystem.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js"],"names":[],"mappings":"AA8CA;IAuBI;;;OAGG;IACH,4BAgBC;IA1CD,mDAAmC;IACnC,+NAKE;IAEF;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,mCAA+B;IAS3B;;;;OAIG;IACH,iBAAsB;IAEtB;;;;OAIG;IACH,uBAAyC;IAG7C,gCAMC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,QACN,MAAM,aACN,SAAS,iBA8GnB;IAED;;;;;OAKG;IACH,WAJW,MAAM,aACN,SAAS,UACT,MAAM,QAiBhB;IAED;;;;;OAKG;IACH,aAJW,MAAM,aACN,SAAS,UACT,MAAM,QAehB;IAED,8BAqDC;CACJ;uBAnTsB,2BAA2B;0BAGxB,wCAAwC;uBAK3C,aAAa;4CAZQ,0DAA0D;oCAKlE,6DAA6D;+BAIlE,sBAAsB"}
|