@ignifx/physics 0.10.0 → 0.12.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ignifx/physics",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "ignifx 3D physics on Havok through Babylon Lite: rigidbodies, colliders, triggers, character controller, queries.",
5
5
  "keywords": [
6
6
  "ignifx",
@@ -45,13 +45,13 @@
45
45
  "typedoc-plugin-markdown": "^4.13.0",
46
46
  "typescript-native": "npm:typescript@7.0.2",
47
47
  "vitest": "^5.0.0",
48
- "@ignifx/core": "0.10.0",
49
- "@ignifx/terrain": "0.10.0"
48
+ "@ignifx/core": "0.12.0",
49
+ "@ignifx/terrain": "0.12.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@babylonjs/havok": "^1.3.14",
53
53
  "@babylonjs/lite": "1.34.0",
54
- "@ignifx/core": "0.10.0"
54
+ "@ignifx/core": "0.12.0"
55
55
  },
56
56
  "ignifx": {
57
57
  "extension": true,
@@ -3,7 +3,7 @@ name: physics
3
3
  description: Adds 3D physics to an ignifx game with @ignifx/physics: Havok simulation on a separate headless scene, Rigidbody, box/sphere/capsule/mesh colliders, physics materials, triggers, CharacterController, raycasts and shape queries, the collision layer matrix, and render interpolation. Use when adding or editing 3D physics bodies, colliders, triggers, character movement, or physics queries in an ignifx project, or when the user mentions @ignifx/physics, Rigidbody, Havok, or collision layers.
4
4
  license: Apache-2.0
5
5
  metadata:
6
- ignifx-version: "0.10.0"
6
+ ignifx-version: "0.12.0"
7
7
  ---
8
8
 
9
9
  # @ignifx/physics
@@ -21,7 +21,7 @@ through, or has to be asked "what is under the crosshair".
21
21
 
22
22
  ## Environment
23
23
 
24
- - Engine: ignifx `0.10.0`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
24
+ - Engine: ignifx `0.12.0`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
25
25
  - Peer dependencies: `@babylonjs/lite` (exactly `1.34.0`) and `@babylonjs/havok` (`^1.3.0`).
26
26
  - Browsers, Electron, and Node. The Vite plugin copies `HavokPhysics.wasm` into the public asset
27
27
  path, so the browser loads it from `assets/HavokPhysics.wasm`; under Node the extension reads the
@@ -108,10 +108,11 @@ app.log.info("crate at y:", crate.transform.position.y);
108
108
  | `overlap(shape, position, rotation?, options?)` | Entities whose world bounds the shape touches (array is reused) |
109
109
  | `distanceToNearest(shape, position, maxDistance, options?)` | Distance to the closest body, or `Infinity` |
110
110
  | `debugViewer.enabled` | Lite's wireframe overlay on the render scene (needs a GPU) |
111
+ | `colliderOutlines(entity)` | Each enabled collider's outline as world-space line segments (`Float32Array`, six numbers a segment) and `isTrigger`: an editor's collider gizmos; works headless |
111
112
  | `lite` | Unstable escape hatch: the Havok world and the simulation scene |
112
113
 
113
114
  Every query needs at least one completed fixed step — Havok builds its broadphase there — and
114
- reports `IGX-0902` before that.
115
+ reports `IGX-0902` before that, except in an edit-mode app (below).
115
116
 
116
117
  Queries hit `Rigidbody` bodies, collider-only statics, and `CharacterController` capsules. A capsule
117
118
  hit names the character's entity with `collider: null`. A ray whose `layerMask` leaves out the
@@ -254,9 +255,12 @@ collides with everything. Havok tests a pair in both directions, so one side ref
254
255
  of `Update`. That is deliberate: a follow camera in `lateUpdate` must frame the character where the
255
256
  frame draws it, or the two judder against each other.
256
257
  - **A resting body sleeps.** Changing `app.physics.gravity` does not wake it; apply an impulse.
257
- - **In an edit-mode app (`createApp({ editMode: true })`) nothing simulates.** No fixed step runs, so
258
- no body is built, nothing falls, interpolation never touches a transform, and a query throws
259
- `IGX-0902` as it does before a game's first step. Draw collider gizmos from the component fields.
258
+ - **In an edit-mode app (`createApp({ editMode: true })`) bodies exist but nothing simulates.**
259
+ Bodies are built, rebuilt, and removed as components change and follow every transform the editor
260
+ moves, so queries answer from the first frame and `debugViewer` draws them. No fixed step runs:
261
+ nothing falls, no collision or trigger callback fires, `hasStepped` stays `false`, and no
262
+ simulated pose is written to a transform. `colliderOutlines(entity)` gives an editor its collider
263
+ gizmos.
260
264
 
261
265
  ## Deprecated (current window)
262
266