@jgengine/navbake 0.25.0 → 0.26.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.
Files changed (2) hide show
  1. package/README.md +7 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -4,10 +4,15 @@ Deterministic navigation-mesh baking for authored JGengine geometry, backed by [
4
4
 
5
5
  ```ts
6
6
  import { bakeNavMesh, initNavBake } from "@jgengine/navbake";
7
- import { createNavMeshQuery } from "@jgengine/core/nav/navMesh";
7
+ import { createNavRuntime, createNavCrowd, navMeshFromBake } from "@jgengine/core/world";
8
8
 
9
9
  await initNavBake();
10
10
  const mesh = bakeNavMesh({ positions, indices, agentRadius: 0.4, agentHeight: 1.8, maxSlope: 45, maxClimb: 0.4 });
11
+
12
+ // The editor stores that mesh as a `nav` bake on the scene document; runtime reads it back.
13
+ const nav = createNavRuntime({ mesh: navMeshFromBake(document.bakes)!, links: [{ id: "ladder", kind: "ladder", from, to }] });
14
+ nav.applyMesh(bakeNavMesh({ ...edited, agentRadius: 0.4, agentHeight: 1.8, maxSlope: 45, maxClimb: 0.4 }));
15
+ const crowd = createNavCrowd({ nav });
11
16
  ```
12
17
 
13
- Walkable triangles wind counter-clockwise seen from above (three.js front faces up). The result is plain `NavMeshData`: store it as an editor `nav` bake and route on it with `@jgengine/core/nav/navMesh`.
18
+ Walkable triangles wind counter-clockwise seen from above (three.js front faces up). The result is plain `NavMeshData`: store it as an editor `nav` bake and consume it with `createNavRuntime` (`@jgengine/core/nav/navRuntime`), which resolves authored off-mesh links and keeps polygon identity across re-bakes so only the routes over changed geometry need re-planning.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jgengine/navbake",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Deterministic navigation-mesh baking for JGengine scenes.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "test": "bun test src"
33
33
  },
34
34
  "dependencies": {
35
- "@jgengine/core": "^0.25.0",
35
+ "@jgengine/core": "^0.26.0",
36
36
  "recast-navigation": "^0.34.0"
37
37
  },
38
38
  "publishConfig": {