@ignifx/physics 0.7.0 → 0.9.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/dist/index.d.ts +82 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +158 -201
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/skills/physics/SKILL.md +12 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ignifx/physics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "ignifx 3D physics on Havok through Babylon Lite: rigidbodies, colliders, triggers, character controller, queries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ignifx",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
36
36
|
"@babylonjs/havok": "^1.3.14",
|
|
37
|
-
"@babylonjs/lite": "1.
|
|
37
|
+
"@babylonjs/lite": "1.34.0",
|
|
38
38
|
"@microsoft/api-extractor": "^7.59.0",
|
|
39
39
|
"@types/node": "^24.13.3",
|
|
40
40
|
"@types/webxr": "^0.5.0",
|
|
@@ -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.
|
|
49
|
-
"@ignifx/terrain": "0.
|
|
48
|
+
"@ignifx/core": "0.9.0",
|
|
49
|
+
"@ignifx/terrain": "0.9.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@babylonjs/havok": "^1.3.14",
|
|
53
|
-
"@babylonjs/lite": "1.
|
|
54
|
-
"@ignifx/core": "0.
|
|
53
|
+
"@babylonjs/lite": "1.34.0",
|
|
54
|
+
"@ignifx/core": "0.9.0"
|
|
55
55
|
},
|
|
56
56
|
"ignifx": {
|
|
57
57
|
"extension": true,
|
package/skills/physics/SKILL.md
CHANGED
|
@@ -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.
|
|
6
|
+
ignifx-version: "0.9.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# @ignifx/physics
|
|
@@ -21,8 +21,8 @@ through, or has to be asked "what is under the crosshair".
|
|
|
21
21
|
|
|
22
22
|
## Environment
|
|
23
23
|
|
|
24
|
-
- Engine: ignifx `0.
|
|
25
|
-
- Peer dependencies: `@babylonjs/lite` (exactly `1.
|
|
24
|
+
- Engine: ignifx `0.9.0`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
|
|
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
|
|
28
28
|
binary out of the installed `@babylonjs/havok` package, so a headless test needs no setup.
|
|
@@ -113,6 +113,11 @@ app.log.info("crate at y:", crate.transform.position.y);
|
|
|
113
113
|
Every query needs at least one completed fixed step — Havok builds its broadphase there — and
|
|
114
114
|
reports `IGX-0902` before that.
|
|
115
115
|
|
|
116
|
+
Queries hit `Rigidbody` bodies, collider-only statics, and `CharacterController` capsules. A capsule
|
|
117
|
+
hit names the character's entity with `collider: null`. A ray whose `layerMask` leaves out the
|
|
118
|
+
character's layer passes through the capsule; a `shapeCast` still stops on it, because a sweep
|
|
119
|
+
cannot be layer-filtered, and reports `entity: null` — use `options.ignore` to sweep through it.
|
|
120
|
+
|
|
116
121
|
### `Rigidbody`
|
|
117
122
|
|
|
118
123
|
| Field / member | Default | Meaning |
|
|
@@ -229,10 +234,9 @@ collides with everything. Havok tests a pair in both directions, so one side ref
|
|
|
229
234
|
- **`MeshCollider` needs a GPU app.** Babylon Lite cannot build mesh or convex-hull shapes on the
|
|
230
235
|
null engine and a headless `MeshAsset` uploads no geometry, so a headless mesh collider reports
|
|
231
236
|
`IGX-0906`. Use a primitive collider in headless tests.
|
|
232
|
-
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
that recovers the identities.
|
|
237
|
+
- **A collision reaches only the two entities in the contact**, and each gets the other as
|
|
238
|
+
`collision.other`. `other` is `null` only when the other body is not an entity's, such as a
|
|
239
|
+
`CharacterController`'s capsule; use `CharacterController.onCollided` for what a character pushes.
|
|
236
240
|
- **Event objects are pooled.** `TriggerEvent` and `Collision` (and its `contacts`) are reused for
|
|
237
241
|
every event of a step: copy anything you keep past the callback.
|
|
238
242
|
- **Type the callback parameter, do not cast it.** Core declares `onTriggerEnter?(trigger: unknown)`
|
|
@@ -258,5 +262,4 @@ None (pre-1.0: no deprecation window; breaking changes are listed in the changel
|
|
|
258
262
|
## Where to look next
|
|
259
263
|
|
|
260
264
|
`skills/ignifx/SKILL.md` for the engine entry skill · `skills/ignifx/references/api/physics.md` for
|
|
261
|
-
the generated API · `docs/architecture/09-physics.md` and ADR-0003
|
|
262
|
-
rationale.
|
|
265
|
+
the generated API · `docs/architecture/09-physics.md` and ADR-0003 for the design rationale.
|