avbd-babylon 0.4.0 → 0.4.1
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/README.md +17 -6
- package/dist/avbd.global.js +182 -109
- package/dist/avbd.js +182 -109
- package/dist/nativeScenes.d.ts +4 -2
- package/docs/BABYLON_API.md +16 -2
- package/package.json +2 -1
- package/tests/README.md +9 -1
package/dist/nativeScenes.d.ts
CHANGED
|
@@ -240,12 +240,14 @@ export interface AvbdGpuParameters2D extends AvbdGpuParameters {
|
|
|
240
240
|
vbd: boolean;
|
|
241
241
|
vbdStiffness: number;
|
|
242
242
|
}
|
|
243
|
-
/** 3D
|
|
243
|
+
/** 3D tracks current awake groups and retains sleeping support connections. */
|
|
244
244
|
export interface AvbdSleepOptions {
|
|
245
245
|
speedThreshold?: number;
|
|
246
246
|
timeThreshold?: number;
|
|
247
|
-
/** 3D: automatic for large
|
|
247
|
+
/** 3D: automatic for large desktop worlds; false selects whole-world waking. */
|
|
248
248
|
islands?: boolean;
|
|
249
|
+
/** 3D island mode: build contacts once and sleep stationary, supported groups at startup. */
|
|
250
|
+
startAsleep?: boolean;
|
|
249
251
|
}
|
|
250
252
|
export interface AvbdGpuOptions {
|
|
251
253
|
bodyBuffer?: GPUBuffer;
|
package/docs/BABYLON_API.md
CHANGED
|
@@ -147,15 +147,29 @@ reserve storage; `readContactEvents()` reports dropped events or a full pair
|
|
|
147
147
|
table. End events do not retain an old position. Callbacks run asynchronously.
|
|
148
148
|
|
|
149
149
|
`sleeping: true` or `{ speedThreshold: 0.03, timeThreshold: 0.5 }` enables an
|
|
150
|
-
optional GPU policy. Supported quiet bodies sleep. Large
|
|
150
|
+
optional GPU policy. Supported quiet bodies sleep. Large desktop 3D worlds
|
|
151
151
|
automatically wake conservative connected groups on impact, keeping unrelated
|
|
152
152
|
piles asleep; the shared static floor does not join them. `islands:true` opts
|
|
153
153
|
into group waking in smaller worlds, and `islands:false` selects whole-world
|
|
154
|
-
waking.
|
|
154
|
+
waking. Awake groups rebuild their connections from current contacts; sleeping
|
|
155
|
+
groups retain the support connections omitted by collision detection. A group
|
|
156
|
+
settles together after its eligible members stay quiet, so sleeping one course
|
|
157
|
+
does not repeatedly disturb the courses above it. Contact waking checks closing
|
|
158
|
+
speed at each contact point, including rotation. Updating a grab anchor wakes
|
|
159
|
+
the held body; ordinary edits and changes to supports wake the world.
|
|
160
|
+
Unsupported bodies
|
|
155
161
|
under gravity stay awake. `wakeAll()`, `body.wakeUp()` and `readSleepStats()` are
|
|
156
162
|
available. Suspended jointed objects are not guaranteed to sleep. Defaults and
|
|
157
163
|
paper-comparison benchmarks keep sleeping disabled.
|
|
158
164
|
|
|
165
|
+
For a 3D assembly placed at rest, use
|
|
166
|
+
`{ islands: true, startAsleep: true }`. Native solver initialization takes one
|
|
167
|
+
support-validation physics step and sleeps stationary groups connected to
|
|
168
|
+
stationary solid support. Moving, floating and sleep-excluded groups stay awake.
|
|
169
|
+
Babylon applies this check on its first physics step. This option is intended
|
|
170
|
+
for assembled stacks, rather than objects already in motion. Interactive
|
|
171
|
+
half-million walls use it; timing comparisons with the paper keep sleeping off.
|
|
172
|
+
|
|
159
173
|
Closed jointless 3D worlds with at most 32 bodies automatically batch movement
|
|
160
174
|
iterations in one GPU workgroup. Body poses stay in shared memory, with the
|
|
161
175
|
same contact order, reductions and equations. Adding a joint or exceeding the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "avbd-babylon",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "GPU AVBD rigid-body physics with a Babylon.js aggregate API",
|
|
5
5
|
"main": "./dist/avbd.js",
|
|
6
6
|
"types": "./dist/avbd.d.ts",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"test": "node scripts/test-gpu.mjs",
|
|
16
16
|
"test:reference": "node --experimental-transform-types --test reference/three-avbd/tests/*.test.ts",
|
|
17
17
|
"test:gpu": "node scripts/test-gpu.mjs",
|
|
18
|
+
"test:sleeping": "node scripts/build.mjs && node scripts/check-lab-sleep.mjs && node scripts/check-sleep-stability.mjs --drag && node scripts/check-jointed-settling.mjs",
|
|
18
19
|
"test:all": "node scripts/test-all.mjs",
|
|
19
20
|
"test:complete": "node scripts/test-all.mjs --strict",
|
|
20
21
|
"test:scenes": "node scripts/build.mjs && node scripts/check-scenes.mjs",
|
package/tests/README.md
CHANGED
|
@@ -7,6 +7,7 @@ run on the host because they inspect files and JavaScript APIs.
|
|
|
7
7
|
| Command | Scope |
|
|
8
8
|
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
9
9
|
| `npm test` | GPU numerical and stability regressions |
|
|
10
|
+
| `npm run test:sleeping` | Local grab waking, rotating impacts, startup sleeping, long 28K-ring settling and the 34K jointed drop through landing and settling |
|
|
10
11
|
| `npm run test:complete` | GPU suite, shared pipeline contract, package, pinned-source integrity and live Babylon example |
|
|
11
12
|
| `npm run test:pipelines` | Same 2D/3D package application calls on CPU and WebGPU: bulk edits, queries, joints, triggers, bounce, sleeping, scene attachment and disposal |
|
|
12
13
|
| `npm run test:cpu` | CPU compatibility scene views, controls, screenshots and physics measurements |
|
|
@@ -46,7 +47,14 @@ poses with direct drawing, Babylon, shared-input workers and CPU compatibility.
|
|
|
46
47
|
`check-lab-timing.mjs` checks fixed-step clocks at 30–240 display frames per second
|
|
47
48
|
and bounded catch-up under load. `check-lab-sleep.mjs` checks live sleeping
|
|
48
49
|
toggles, large-scene defaults and bowling balls in all sixteen wall lanes.
|
|
49
|
-
|
|
50
|
+
`check-sleep-stability.mjs --drag` follows the 28K brick ring for 900 steps and
|
|
51
|
+
checks that repeated grab-anchor updates leave resting debris asleep.
|
|
52
|
+
`check-jointed-settling.mjs` measures GPU collision and movement time while the
|
|
53
|
+
34K jointed drop lands, comparing sleeping off, whole-world waking and automatic
|
|
54
|
+
group sleeping. It checks contact capacity and solve-group conflicts on every
|
|
55
|
+
step, then measures the rendered worker view separately. These longer checks run
|
|
56
|
+
through `test:sleeping` and `test:web`; the live toggle checks also run through
|
|
57
|
+
`test:playgrounds`.
|
|
50
58
|
|
|
51
59
|
`check-lab-step-rate.mjs` checks live physics step-rate changes, retained poses,
|
|
52
60
|
scene defaults and URL settings with CPU, WebGPU, Babylon and worker execution.
|