@ignifx/physics-2d 0.10.0 → 0.11.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 +98 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +273 -15
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/skills/physics-2d/SKILL.md +9 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ignifx/physics-2d",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "ignifx 2D physics: Rigidbody2D, 2D colliders, CharacterController2D, queries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ignifx",
|
|
@@ -45,12 +45,12 @@
|
|
|
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/2d": "0.
|
|
49
|
-
"@ignifx/core": "0.
|
|
48
|
+
"@ignifx/2d": "0.11.0",
|
|
49
|
+
"@ignifx/core": "0.11.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@ignifx/2d": "0.
|
|
53
|
-
"@ignifx/core": "0.
|
|
52
|
+
"@ignifx/2d": "0.11.0",
|
|
53
|
+
"@ignifx/core": "0.11.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
56
56
|
"@ignifx/2d": {
|
|
@@ -3,7 +3,7 @@ name: physics-2d
|
|
|
3
3
|
description: Adds 2D physics to an ignifx game with @ignifx/physics-2d: Rapier 2D simulation on the fixed loop, Rigidbody2D, box/circle/capsule/polygon/edge/tilemap colliders, physics materials, 2D triggers, CharacterController2D with slopes, autostep, snap-to-ground and one-way platforms, 2D raycasts and shape queries, the collision layer matrix, and render interpolation. Use when adding or editing 2D physics bodies, 2D colliders, platformer movement, 2D triggers, or 2D queries in an ignifx project, or when the user mentions @ignifx/physics-2d, Rigidbody2D, Rapier, or CharacterController2D.
|
|
4
4
|
license: Apache-2.0
|
|
5
5
|
metadata:
|
|
6
|
-
ignifx-version: "0.
|
|
6
|
+
ignifx-version: "0.11.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# @ignifx/physics-2d
|
|
@@ -24,7 +24,7 @@ A world uses **either** `physics()` **or** `physics2d()`. Registering both throw
|
|
|
24
24
|
|
|
25
25
|
## Environment
|
|
26
26
|
|
|
27
|
-
- Engine: ignifx `0.
|
|
27
|
+
- Engine: ignifx `0.11.0`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
|
|
28
28
|
- Dependency: `@dimforge/rapier2d-compat` `^0.20.0`. The `-compat` build **inlines** its WebAssembly
|
|
29
29
|
as base64, so nothing has to be served and Node, the browser, and Electron all take the same path.
|
|
30
30
|
- `@ignifx/2d` is an **optional** peer: you need it only for `TilemapCollider2D`'s tilemap, so a
|
|
@@ -132,7 +132,8 @@ Colliders share `offset`, `isTrigger`, `material` (a `.physicsmaterial.json` ass
|
|
|
132
132
|
`groundNormal`, and `onCollided`.
|
|
133
133
|
|
|
134
134
|
`app.physics2d` — `gravity`, `raycast`, `raycastAll`, `overlapCircle`, `overlapBox`, `shapeCast`,
|
|
135
|
-
|
|
135
|
+
`colliderOutlines(entity)` (Rapier's drawing of each collider as world-space XY segments, for an
|
|
136
|
+
editor's gizmos), and `rapier` (the unstable escape hatch). Full signatures:
|
|
136
137
|
`skills/ignifx/references/api/physics-2d.md`.
|
|
137
138
|
|
|
138
139
|
## Recipes
|
|
@@ -312,10 +313,11 @@ Component field tables: `skills/ignifx/references/formats/components.md`.
|
|
|
312
313
|
the authoritative pose. Everything outside the fixed loop — `update`, `lateUpdate`, animation,
|
|
313
314
|
`Camera2DFollow`, rendering — sees the interpolated one, because the display pose is written at the
|
|
314
315
|
top of `Update`. That is what keeps a follow camera locked to the sprite the frame actually draws.
|
|
315
|
-
- **In an edit-mode app (`createApp({ editMode: true })`) nothing simulates.**
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
- **In an edit-mode app (`createApp({ editMode: true })`) bodies exist but nothing simulates.**
|
|
317
|
+
Bodies are built, rebuilt, and removed as components and tiles change and follow every transform
|
|
318
|
+
the editor moves, so queries answer from the first frame. No fixed step runs: nothing falls, no
|
|
319
|
+
collision or trigger callback fires, and no simulated pose is written to a transform.
|
|
320
|
+
`colliderOutlines(entity)` gives an editor its collider gizmos, tile collision included.
|
|
319
321
|
|
|
320
322
|
## Deprecated (current window)
|
|
321
323
|
|