avbd-babylon 0.4.2 → 0.4.4
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 +48 -6
- package/dist/avbd.global.js +102 -59
- package/dist/avbd.js +95 -52
- package/dist/babylonAvbd.d.ts +4 -0
- package/dist/nativeScenes.d.ts +2 -0
- package/docs/BABYLON_API.md +13 -1
- package/package.json +3 -2
- package/tests/README.md +1 -0
package/dist/babylonAvbd.d.ts
CHANGED
|
@@ -45,6 +45,10 @@ export interface AvbdWorldOptions {
|
|
|
45
45
|
solverMode?: AvbdSolverMode;
|
|
46
46
|
/** Automatically batch a closed jointless world of up to 32 bodies. */
|
|
47
47
|
smallGroups?: boolean;
|
|
48
|
+
/** Advanced: reserve 0–64 parallel solve groups for dense or waking contacts. */
|
|
49
|
+
minimumColors?: number;
|
|
50
|
+
/** Advanced: minimum coloring rounds, an even integer from 0–32. */
|
|
51
|
+
minimumColorRounds?: number;
|
|
48
52
|
bvh?: { rebuildInterval?: number };
|
|
49
53
|
/** Optional GPU sleeping. Large worlds wake conservative connected groups on impact. */
|
|
50
54
|
sleeping?: boolean | AvbdSleepOptions;
|
package/dist/nativeScenes.d.ts
CHANGED
|
@@ -242,7 +242,9 @@ export interface AvbdGpuParameters2D extends AvbdGpuParameters {
|
|
|
242
242
|
}
|
|
243
243
|
/** 3D tracks current awake groups and retains sleeping support connections. */
|
|
244
244
|
export interface AvbdSleepOptions {
|
|
245
|
+
/** Combined linear and radius-scaled angular motion, world units/second. Default 0.03. */
|
|
245
246
|
speedThreshold?: number;
|
|
247
|
+
/** Seconds continuously below the speed threshold while supported. Default 0.5. */
|
|
246
248
|
timeThreshold?: number;
|
|
247
249
|
/** 3D: automatic for large desktop worlds; false selects whole-world waking. */
|
|
248
250
|
islands?: boolean;
|
package/docs/BABYLON_API.md
CHANGED
|
@@ -81,6 +81,12 @@ compatibility. These names identify internal implementations, not quality
|
|
|
81
81
|
levels or paper results. Overrides preserve live GPU state; first use may
|
|
82
82
|
compile pipelines. Start with the automatic default.
|
|
83
83
|
|
|
84
|
+
For dense piles that gain many dynamic contacts at once, `minimumColors` reserves
|
|
85
|
+
parallel solve groups (integer 0–64) and `minimumColorRounds` reserves coloring
|
|
86
|
+
rounds (even integer 0–32). Pass them to `AvbdPhysics.create()` before initialization.
|
|
87
|
+
The mixed collider gallery uses `32` for both. These control work scheduling;
|
|
88
|
+
they do not change solver iterations or contact equations.
|
|
89
|
+
|
|
84
90
|
Box, sphere and capsule collisions are native. Capsules use an exact rounded
|
|
85
91
|
segment along local Y; height includes both caps and X/Z diameters must match.
|
|
86
92
|
`CYLINDER` and `CONVEX_HULL` use a polygonal convex hull, with a 32-vertex limit. Mesh geometry,
|
|
@@ -147,7 +153,13 @@ reserve storage; `readContactEvents()` reports dropped events or a full pair
|
|
|
147
153
|
table. End events do not retain an old position. Callbacks run asynchronously.
|
|
148
154
|
|
|
149
155
|
`sleeping: true` or `{ speedThreshold: 0.03, timeThreshold: 0.5 }` enables an
|
|
150
|
-
optional GPU policy. Supported quiet bodies sleep.
|
|
156
|
+
optional GPU policy. Supported quiet bodies sleep. Speed combines translation
|
|
157
|
+
and radius-scaled rotation in world units/second; `0.03` is 3 cm/second if units
|
|
158
|
+
are meters. The quiet timer resets above that speed. Thresholds remain manual
|
|
159
|
+
so applications can choose values appropriate to their size and camera distance.
|
|
160
|
+
Sleeping preserves the body's physical mass while skipping its movement solve;
|
|
161
|
+
impacts and support removal restore dynamic participation.
|
|
162
|
+
Large desktop 3D worlds
|
|
151
163
|
automatically wake conservative connected groups on impact, keeping unrelated
|
|
152
164
|
piles asleep; the shared static floor does not join them. `islands:true` opts
|
|
153
165
|
into group waking in smaller worlds, and `islands:false` selects whole-world
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "avbd-babylon",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
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,7 +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
|
+
"test:sleeping": "node scripts/build.mjs && node scripts/check-lab-sleep.mjs && node scripts/check-sleep-stability.mjs --drag && node scripts/check-sleeping-impact-scenes.mjs && node scripts/check-jointed-settling.mjs",
|
|
19
19
|
"test:all": "node scripts/test-all.mjs",
|
|
20
20
|
"test:complete": "node scripts/test-all.mjs --strict",
|
|
21
21
|
"test:scenes": "node scripts/build.mjs && node scripts/check-scenes.mjs",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"benchmark:backends": "node scripts/build.mjs && node scripts/benchmark-backends.mjs",
|
|
45
45
|
"benchmark:native": "node scripts/benchmark-package.mjs",
|
|
46
46
|
"benchmark:sleeping": "node scripts/benchmark-package.mjs",
|
|
47
|
+
"benchmark:scene-sleep": "node scripts/benchmark-scene-sleep.mjs && node scripts/build.mjs && node scripts/report-solver.mjs",
|
|
47
48
|
"benchmark:connected-sleep": "node scripts/benchmark-connected-sleep.mjs",
|
|
48
49
|
"benchmark:small-groups": "node scripts/benchmark-small-groups.mjs",
|
|
49
50
|
"benchmark:native-edits": "node scripts/check-native-performance.mjs",
|
package/tests/README.md
CHANGED
|
@@ -26,6 +26,7 @@ run on the host because they inspect files and JavaScript APIs.
|
|
|
26
26
|
| `npm run test:fracture` | Voronoi partition, breakable face bonds, wrecking-ball impact and persistent rubble |
|
|
27
27
|
| `npm run test:reference` | Explicitly requested upstream CPU comparison; excluded from normal validation |
|
|
28
28
|
| `npm run benchmark:native` | 2D/3D movement/spin, property edits, grouped queries, sleeping and selected reads; three repeats |
|
|
29
|
+
| `npm run benchmark:scene-sleep` | Every demo scene: paired sleeping-on/off runs, complete physics timings during motion and later settling, and generated demo defaults |
|
|
29
30
|
| `npm run benchmark:connected-sleep` | 505,923-body walls: all-awake overhead and later impacts with whole-world versus automatic connected-group waking; two alternating paired runs |
|
|
30
31
|
| `npm run benchmark:small-groups` | 9- and 32-body closed worlds: automatic workgroup movement versus separate dispatches, three paired runs and exact final body-state comparisons |
|
|
31
32
|
| `npm run benchmark:native-edits` | 100K motion updates, 10K property edits and 64 ray queries in 2D/3D; API overhead and GPU completion |
|