@ignifx/physics 0.2.1 → 0.3.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/dist/index.d.ts CHANGED
@@ -276,23 +276,8 @@ interface SimulationHandles {
276
276
  //#endregion
277
277
  //#region src/components/collider.d.ts
278
278
  /**
279
- * The collider contract (`docs/architecture/09-physics.md` §2.2). Every collider shares four
280
- * fields — `center`, `isTrigger`, a material, and a layer override — and answers two questions the
281
- * body builder asks: what Havok shape it is, and how big its local bounding box is.
282
- *
283
- * ## The one correction to §2.2
284
- *
285
- * §2.2 writes the material field as `material: asset(PhysicsMaterial) | inline { … }`. A schema
286
- * field has exactly one kind (ADR-0004), so the union is split into two fields:
287
- * {@link Collider.material} (an asset reference) and {@link Collider.inlineMaterial} (a record).
288
- * The asset wins, the inline record is the fallback, and `physics.defaultMaterial` is the last
289
- * resort.
290
- *
291
- * ## Shape sizes and scale
292
- *
293
- * Sizes are authored in local units and multiplied by the entity's lossy scale when the shape is
294
- * built. Havok has no way to rescale a built shape, so changing the scale afterwards needs
295
- * {@link Collider.rebuild}, exactly as §2.2 says.
279
+ * Collider dimensions use local units and the entity's scale at build time; call `rebuild` after
280
+ * changing scale. Material assets take precedence over inline material, then project defaults.
296
281
  */
297
282
  /**
298
283
  * The fields every collider declares. It is a function because a field kind is a function call and
@@ -456,26 +441,10 @@ interface CharacterCollision {
456
441
  //#endregion
457
442
  //#region src/components/rigidbody.d.ts
458
443
  /**
459
- * The `Rigidbody` component (`docs/architecture/09-physics.md` §2.1): what makes an entity's
460
- * colliders a simulated, kinematic, or explicitly static Havok body.
461
- *
462
- * ## Corrections to §2.1, all forced by `@babylonjs/lite@1.27.0`
463
- *
464
- * - **`collisionEvents` is a three-valued enum, not a boolean.** §2.1 describes a field whose value
465
- * is "auto"; a schema field has one kind and one value (ADR-0004), so the field is
466
- * `"auto" | "on" | "off"` and `"auto"` is the default. `"auto"` is what §2.1 actually specifies:
467
- * recomputed from `ctx.entityImplements` whenever a component is added to or removed from the
468
- * entity.
469
- * - **`velocityLimits` is not a per-body field.** Lite exposes `setPhysicsVelocityLimits(world, …)`
470
- * only (`index.d.ts` 10880) — there is no per-body clamp — so the limits live in the `physics`
471
- * settings section and the field is absent.
472
- * - **A body's entity must be a root entity.** Lite's post-step sync writes `node.position` and
473
- * `node.rotationQuaternion`, which are *local* values (`lib/physics/havok.js:_syncBodyToNode`), so
474
- * a parented entity would be simulated in its parent's space. The extension reports `IGX-0907`
475
- * and simulates it anyway rather than silently misplacing it.
476
- *
477
- * Not available in Lite 1.27.0 and therefore absent, as §2.1 already records: per-body damping,
478
- * per-body gravity factor, sleep thresholds, and an explicit `wakeUp()`.
444
+ * Simulate colliders on a root entity; parented bodies log `IGX-0907` because backend pose writes
445
+ * are local. Collision events default to `auto`, following attached callbacks.
446
+ * Velocity limits are world settings; per-body damping, gravity factors, sleep thresholds, and
447
+ * explicit wake-up are unavailable in the pinned Lite adapter.
479
448
  */
480
449
  /**
481
450
  * How a body moves.
@@ -664,25 +633,9 @@ export declare class Rigidbody extends Component implements ComponentHooks {
664
633
  //#endregion
665
634
  //#region src/components/character-controller.d.ts
666
635
  /**
667
- * The `CharacterController` component (`docs/architecture/09-physics.md` §2.3): Lite's kinematic
668
- * capsule with collide-and-slide, support detection, and dynamic-body pushing.
669
- *
670
- * ## How it is driven
671
- *
672
- * Call {@link CharacterController.move} from `fixedUpdate`. The requested displacements of one step
673
- * are summed and handed to Lite's `moveWithCollisions` by the step system, so two scripts moving the
674
- * same character compose instead of fighting. After the step the controller owns the entity's world
675
- * **position**; rotation stays user-controlled.
676
- *
677
- * ## Corrections to §2.3
678
- *
679
- * - `supportState` is read from the last step's `checkSupport` probe, which the step system runs
680
- * once per step; reading it does not probe again.
681
- * - Gravity is **not** applied by this component. §2.3 already says so: a bare controller is purely
682
- * kinematic and the 3D toolkit's controllers integrate gravity through `checkSupport` +
683
- * `integrate` (Phase 7). {@link CharacterController.move} is the whole input.
684
- * - `pushStrength` scales Lite's `characterStrength`, whose default is `1e38` — effectively
685
- * "infinite". A `pushStrength` of `1` therefore means "Lite's default", not "one newton".
636
+ * Sum `move` displacements during `fixedUpdate` and apply them in the physics step.
637
+ * The controller owns world position after the step; game code owns rotation and gravity.
638
+ * `supportState` is the last step's result. `pushStrength` scales Lite's default strength, not newtons.
686
639
  */
687
640
  /**
688
641
  * How the character is supported by whatever is under it.
@@ -1136,21 +1089,9 @@ export declare function physicsError(code: PhysicsErrorCode, message: string, op
1136
1089
  //#endregion
1137
1090
  //#region src/queries.d.ts
1138
1091
  /**
1139
- * The query vocabulary of `app.physics` (`docs/architecture/09-physics.md` §5).
1140
- *
1141
- * ## Two corrections to §5
1142
- *
1143
- * `@babylonjs/lite@1.27.0` reports a body identity for **`physicsRaycast` only**: `ShapeCastResult`
1144
- * and `ShapeProximityResult` carry points and normals but no body (`index.d.ts` 11497, 11540), and
1145
- * `shapeProximity`'s collector has capacity `1`, so it can never list more than one hit
1146
- * (`lib/physics/havok-queries.js:7`). So:
1147
- *
1148
- * - `shapeCast` runs Lite's sweep for the geometry and resolves `entity` against the extension's own
1149
- * body-bounds index. It is exact about *where* the sweep hit and bounds-accurate about *what*.
1150
- * - `overlap` is answered entirely from that index — the entities whose world bounds intersect the
1151
- * query shape's world bounds — because Lite cannot list overlaps at all.
1152
- *
1153
- * Both are documented as bounds-accurate rather than shape-accurate until an upstream API lands.
1092
+ * Raycasts return backend body identities. Shape casts use backend hit geometry and the local
1093
+ * body-bounds index for identity; overlaps use that index entirely. Shape-cast identities and
1094
+ * overlap results are bounds-accurate, not exact shape intersections.
1154
1095
  */
1155
1096
  /**
1156
1097
  * Options every query accepts.
@@ -1729,25 +1670,9 @@ export declare class PhysicsService {
1729
1670
  //#endregion
1730
1671
  //#region src/extension.d.ts
1731
1672
  /**
1732
- * The `@ignifx/physics` extension (`docs/architecture/09-physics.md`, `04-extensions.md` §1).
1733
- *
1734
- * ## Why the world is built in `onStart` rather than in `register`
1735
- *
1736
- * `register` runs before `createApp` builds the Lite engine and the `World`
1737
- * (`packages/core/src/app/app.ts`, `initialize`), and the Havok world needs the world's layer table
1738
- * and the kernel's physics hooks. So `register` declares everything — components, settings, the
1739
- * loader, the error codes, the three systems, the service, the `app.physics` property — against a
1740
- * {@link PhysicsHost} holder, and `onStart` loads Havok, builds the runtime, and fills the holder in.
1741
- *
1742
- * ## Where `HavokPhysics.wasm` comes from
1743
- *
1744
- * The package declares `ignifx.assets.public`, so the Vite plugin copies the binary **unhashed and
1745
- * by base name** into the public asset path (`packages/vite-plugin/src/plugin.ts`,
1746
- * `generateBundle`). The default asset root and the default public path are the same directory, so
1747
- * the address is the bare file name and `app.assets.resolveUrl("HavokPhysics.wasm")` is the URL —
1748
- * not a package-scoped address like `ignifx/HavokPhysics.wasm`, which nothing would serve. Under
1749
- * Node the loader falls back to the installed `@babylonjs/havok` package, so a headless app needs no
1750
- * configuration.
1673
+ * Create the physics runtime in `onStart`, after the world and its layer table exist.
1674
+ * The Vite plugin copies `HavokPhysics.wasm` into public assets under its base name.
1675
+ * Headless loading falls back to the installed Havok package.
1751
1676
  */
1752
1677
  /**
1753
1678
  * What `physics()` accepts.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/settings.ts","../src/material.ts","../src/lite/havok.ts","../src/components/collider.ts","../src/events.ts","../src/components/rigidbody.ts","../src/components/character-controller.ts","../src/components/colliders.ts","../src/errors.ts","../src/queries.ts","../src/runtime/body-record.ts","../src/runtime/runtime.ts","../src/runtime/host.ts","../src/service.ts","../src/extension.ts","../src/schemas.ts"],"mappings":";;;;;;;;;;;;;;qBAea;;;;;;qBAOA;;;;;;;UAQI;;WAEN;;WAEA;;WAEA;;;;;;;;UASM;;WAEN;;WAEA;;;;;;;;;;;;;;;;;;;UAoBM;;WAEN,SAAS;;;;;WAKT,iBAAiB,SAAS;;WAE1B,iBAAiB;;WAEjB,gBAAgB;;WAEhB;;WAEA;;;;;;;;;;;;;wBA8BK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;;;;;;;;;;;;;;;;;;;;;;;;UCzUW;;;;;;WAMN,sBAAsB;;WAEtB;;WAEA,aAAa;;;YAIZ;;aAEC,SAAS;;;;;;;;;;;;;;;;qBAqBT,UAAU,UAAU,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;wBChEpC,mBAAmB,SAAS,eAAe"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/settings.ts","../src/material.ts","../src/lite/havok.ts","../src/components/collider.ts","../src/events.ts","../src/components/rigidbody.ts","../src/components/character-controller.ts","../src/components/colliders.ts","../src/errors.ts","../src/queries.ts","../src/runtime/body-record.ts","../src/runtime/runtime.ts","../src/runtime/host.ts","../src/service.ts","../src/extension.ts","../src/schemas.ts"],"mappings":";;;;;;;;;;;;;;qBAea;;;;;;qBAOA;;;;;;;UAQI;;WAEN;;WAEA;;WAEA;;;;;;;;UASM;;WAEN;;WAEA;;;;;;;;;;;;;;;;;;;UAoBM;;WAEN,SAAS;;;;;WAKT,iBAAiB,SAAS;;WAE1B,iBAAiB;;WAEjB,gBAAgB;;WAEhB;;WAEA;;;;;;;;;;;;;wBA8BK,yBAAyB;;;;;;;;wBAyBzB,0BAA0B;;;;;;;;;;;;;qBC5H7B;;;;;;qBAOA;;;;;;qBAOA;;;;;;qBAOA;;;;;;;;;;;;;qBAcA,2BAA2B;;SAE/B;;WAGE;;WAGA;;WAGA;;WAGA;;;;;;;;EAST,YAAY,cAAc,QAAQ;;;;;;;;;;;;;SAmB3B,WAAW,cAAc,QAAQ,QAAQ,yBAAyB;;;;;;;;;wBAiB3D,+BAA+B,YAAY;;;;;;;;;;;wBAqB3C,qBAAqB,iBAAiB,UAAU,YAAY;;;;;;;;;wBAgC5D,qCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KC9FzC,mBAAmB;;;;;;;KAQnB,kBAAkB;;;;;;KAOlB,mBAAmB;;;;;;;cAQlB;;WAEX;;WAEA;;WAEA;;;;;;;KAQU,qBAAqB,yBAAyB;;UA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cCvtBW;;EAEX,SAAS;;;;;;;;;;UCqBM;;WAEN,OAAO;;WAEP,iBAAiB;;;;;;;UAQX;;;;;EAKf;;;;;;;;;;;;;;;qBAgBW;;;;;;;;;;;EAgCX,YAAY,KAAK,KAAK,MAAM,aAAa,UAAU;;;;;;MAa/C,WAAW;;;;;;MASX,QAAQ,OAAO;;;;;;MAUf,eAAe;;;;;;MASf,QAAQ;;;;;;;;;;;EAcZ,QACE,QAAQ,UACR,WAAW,UACX,sBACA,UAAU,eACT;;;;;;;;;;;;;;;;;;;;;EA6DH,UAAU,OAAO,YAAY,MAAM,UAAU,IAAI,UAAU,UAAU,mBAAmB;;;;;;;;;;;;;;;;;;EAsDxF,QAAQ,OAAO,YAAY,UAAU,UAAU,WAAW,MAAM,UAAU,wBAAwB;;;;;;;;;;;;EA8BlG,kBAAkB,OAAO,YAAY,UAAU,UAAU,qBAAqB,UAAU;;;;;;EAuBxF,sBAAsB;;;;;;EA+BtB;;EAKA;;;;;;;;;MA6BI;;;;;;;;;;;;;;UCzVW;;;;;;WAMN,sBAAsB;;WAEtB;;WAEA,aAAa;;;YAIZ;;aAEC,SAAS;;;;;;;;;;;;;;;;qBAqBT,UAAU,UAAU,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;wBChDpC,mBAAmB,SAAS,eAAe"}
package/dist/index.js CHANGED
@@ -17,26 +17,10 @@ const PhysicsHostKey = createServiceKey("@ignifx/physics:host");
17
17
  //#endregion
18
18
  //#region src/components/rigidbody.ts
19
19
  /**
20
- * The `Rigidbody` component (`docs/architecture/09-physics.md` §2.1): what makes an entity's
21
- * colliders a simulated, kinematic, or explicitly static Havok body.
22
- *
23
- * ## Corrections to §2.1, all forced by `@babylonjs/lite@1.27.0`
24
- *
25
- * - **`collisionEvents` is a three-valued enum, not a boolean.** §2.1 describes a field whose value
26
- * is "auto"; a schema field has one kind and one value (ADR-0004), so the field is
27
- * `"auto" | "on" | "off"` and `"auto"` is the default. `"auto"` is what §2.1 actually specifies:
28
- * recomputed from `ctx.entityImplements` whenever a component is added to or removed from the
29
- * entity.
30
- * - **`velocityLimits` is not a per-body field.** Lite exposes `setPhysicsVelocityLimits(world, …)`
31
- * only (`index.d.ts` 10880) — there is no per-body clamp — so the limits live in the `physics`
32
- * settings section and the field is absent.
33
- * - **A body's entity must be a root entity.** Lite's post-step sync writes `node.position` and
34
- * `node.rotationQuaternion`, which are *local* values (`lib/physics/havok.js:_syncBodyToNode`), so
35
- * a parented entity would be simulated in its parent's space. The extension reports `IGX-0907`
36
- * and simulates it anyway rather than silently misplacing it.
37
- *
38
- * Not available in Lite 1.27.0 and therefore absent, as §2.1 already records: per-body damping,
39
- * per-body gravity factor, sleep thresholds, and an explicit `wakeUp()`.
20
+ * Simulate colliders on a root entity; parented bodies log `IGX-0907` because backend pose writes
21
+ * are local. Collision events default to `auto`, following attached callbacks.
22
+ * Velocity limits are world settings; per-body damping, gravity factors, sleep thresholds, and
23
+ * explicit wake-up are unavailable in the pinned Lite adapter.
40
24
  */
41
25
  /**
42
26
  * How a body moves.
@@ -241,25 +225,9 @@ function rigidbodySchema() {
241
225
  //#endregion
242
226
  //#region src/components/character-controller.ts
243
227
  /**
244
- * The `CharacterController` component (`docs/architecture/09-physics.md` §2.3): Lite's kinematic
245
- * capsule with collide-and-slide, support detection, and dynamic-body pushing.
246
- *
247
- * ## How it is driven
248
- *
249
- * Call {@link CharacterController.move} from `fixedUpdate`. The requested displacements of one step
250
- * are summed and handed to Lite's `moveWithCollisions` by the step system, so two scripts moving the
251
- * same character compose instead of fighting. After the step the controller owns the entity's world
252
- * **position**; rotation stays user-controlled.
253
- *
254
- * ## Corrections to §2.3
255
- *
256
- * - `supportState` is read from the last step's `checkSupport` probe, which the step system runs
257
- * once per step; reading it does not probe again.
258
- * - Gravity is **not** applied by this component. §2.3 already says so: a bare controller is purely
259
- * kinematic and the 3D toolkit's controllers integrate gravity through `checkSupport` +
260
- * `integrate` (Phase 7). {@link CharacterController.move} is the whole input.
261
- * - `pushStrength` scales Lite's `characterStrength`, whose default is `1e38` — effectively
262
- * "infinite". A `pushStrength` of `1` therefore means "Lite's default", not "one newton".
228
+ * Sum `move` displacements during `fixedUpdate` and apply them in the physics step.
229
+ * The controller owns world position after the step; game code owns rotation and gravity.
230
+ * `supportState` is the last step's result. `pushStrength` scales Lite's default strength, not newtons.
263
231
  */
264
232
  /**
265
233
  * How the character is supported by whatever is under it.
@@ -746,23 +714,8 @@ function numberAt(object, key, fallback) {
746
714
  //#endregion
747
715
  //#region src/components/collider.ts
748
716
  /**
749
- * The collider contract (`docs/architecture/09-physics.md` §2.2). Every collider shares four
750
- * fields — `center`, `isTrigger`, a material, and a layer override — and answers two questions the
751
- * body builder asks: what Havok shape it is, and how big its local bounding box is.
752
- *
753
- * ## The one correction to §2.2
754
- *
755
- * §2.2 writes the material field as `material: asset(PhysicsMaterial) | inline { … }`. A schema
756
- * field has exactly one kind (ADR-0004), so the union is split into two fields:
757
- * {@link Collider.material} (an asset reference) and {@link Collider.inlineMaterial} (a record).
758
- * The asset wins, the inline record is the fallback, and `physics.defaultMaterial` is the last
759
- * resort.
760
- *
761
- * ## Shape sizes and scale
762
- *
763
- * Sizes are authored in local units and multiplied by the entity's lossy scale when the shape is
764
- * built. Havok has no way to rescale a built shape, so changing the scale afterwards needs
765
- * {@link Collider.rebuild}, exactly as §2.2 says.
717
+ * Collider dimensions use local units and the entity's scale at build time; call `rebuild` after
718
+ * changing scale. Material assets take precedence over inline material, then project defaults.
766
719
  */
767
720
  /**
768
721
  * The fields every collider declares. It is a function because a field kind is a function call and