@aura3d/navigation-recast 2.0.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/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @aura3d/navigation-recast
2
+
3
+ Optional Recast/Detour navigation for Aura3D, backed by exact
4
+ `recast-navigation@0.43.1`. Static worlds should normally build and serialize
5
+ their navmesh offline, then lazily initialize this package and import that data
6
+ at runtime. Runtime generation remains available for procedural worlds.
7
+
8
+ The package is absent from core, product, and arcade-game entries. It owns
9
+ navmesh generation, path queries, serialization, Detour crowd simulation, and
10
+ temporary-obstacle integration; it does not depend on Three.js.
11
+
12
+ Projects migrating from the removed `@aura3d/physics` grid/crowd/steering
13
+ surface should follow `docs/migration/navigation-recast-2.0.md`; the old and new
14
+ APIs are not falsely aliased because their coordinate and world-geometry
15
+ semantics differ.
16
+
17
+ ## Public API
18
+
19
+ - `createRecastNavigation()` initializes the WASM runtime once and returns a
20
+ thin factory/query adapter.
21
+ - `generateSolo()` creates a small-world navmesh from indexed triangle data.
22
+ - `import()` restores an offline-generated navmesh.
23
+ - `importAsset()` loads a CLI-generated `AuraAssetRef<"navigation">`, verifies
24
+ its SHA-256 hash, and imports the serialized navmesh.
25
+ - `RecastNavMeshHandle` owns queries, serialization, and deterministic cleanup.
26
+ - `rawModule` and `rawNavMesh` are public escape hatches for advanced Detour
27
+ operations without private imports.
28
+
29
+ ## Verification
30
+
31
+ Run `pnpm exec vitest run tests/unit/navigation-recast` for generation, query,
32
+ serialization, lifecycle, and optional-boundary tests. Browser and worker
33
+ evidence is produced by the navigation bake-off before release.
@@ -0,0 +1,88 @@
1
+ import type * as Recast from "recast-navigation";
2
+ export type NavigationVec3 = readonly [number, number, number];
3
+ export type RecastModule = typeof import("recast-navigation");
4
+ export type RecastGenerators = typeof import("recast-navigation/generators");
5
+ export interface NavigationTriangleSoup {
6
+ readonly positions: readonly number[] | Float32Array;
7
+ readonly indices: readonly number[] | Uint32Array;
8
+ }
9
+ export interface RecastNavigationOptions {
10
+ readonly moduleLoader?: () => Promise<RecastModule>;
11
+ readonly generatorLoader?: () => Promise<RecastGenerators>;
12
+ }
13
+ export interface NavigationPathResult {
14
+ readonly success: boolean;
15
+ readonly points: readonly NavigationVec3[];
16
+ readonly error?: string;
17
+ }
18
+ /** Structural match for `AuraAssetRef<"navigation">` without coupling this optional package to the engine barrel. */
19
+ export interface NavigationAssetRef {
20
+ readonly kind: "aura-asset-ref";
21
+ readonly id: string;
22
+ readonly type: "navigation";
23
+ readonly format: "navmesh";
24
+ readonly url: string;
25
+ readonly hash?: string;
26
+ }
27
+ export interface NavigationAssetFetchResponse {
28
+ readonly ok: boolean;
29
+ readonly status: number;
30
+ arrayBuffer(): Promise<ArrayBuffer>;
31
+ }
32
+ export interface ImportNavigationAssetOptions {
33
+ readonly fetch?: (url: string) => Promise<NavigationAssetFetchResponse>;
34
+ readonly verifyHash?: boolean;
35
+ }
36
+ export interface NavigationCrowdAgentOptions {
37
+ readonly radius?: number;
38
+ readonly height?: number;
39
+ readonly maxAcceleration?: number;
40
+ readonly maxSpeed?: number;
41
+ readonly collisionQueryRange?: number;
42
+ readonly pathOptimizationRange?: number;
43
+ readonly separationWeight?: number;
44
+ }
45
+ export declare class RecastNavMeshHandle {
46
+ #private;
47
+ constructor(module: RecastModule, navMesh: Recast.NavMesh);
48
+ get disposed(): boolean;
49
+ computePath(start: NavigationVec3, end: NavigationVec3): NavigationPathResult;
50
+ createCrowd(maxAgents: number, maxAgentRadius: number): RecastCrowdHandle;
51
+ serialize(): Uint8Array;
52
+ /** Stable escape hatch. The handle retains ownership and frees this object. */
53
+ unsafeRecastNavMesh(): Recast.NavMesh;
54
+ dispose(): void;
55
+ }
56
+ export declare class RecastCrowdHandle {
57
+ #private;
58
+ constructor(module: RecastModule, navMesh: Recast.NavMesh, maxAgents: number, maxAgentRadius: number);
59
+ addAgent(position: NavigationVec3, options?: NavigationCrowdAgentOptions): Recast.CrowdAgent;
60
+ requestMoveTarget(agent: Recast.CrowdAgent, target: NavigationVec3): boolean;
61
+ update(dt: number): void;
62
+ positions(): readonly NavigationVec3[];
63
+ /** Stable escape hatch. The handle owns and destroys this crowd. */
64
+ unsafeRecastCrowd(): Recast.Crowd;
65
+ dispose(): void;
66
+ }
67
+ export declare class RecastTileCacheHandle {
68
+ #private;
69
+ readonly navMesh: RecastNavMeshHandle;
70
+ constructor(module: RecastModule, navMesh: Recast.NavMesh, tileCache: Recast.TileCache);
71
+ addCylinderObstacle(position: NavigationVec3, radius: number, height: number): Recast.Obstacle;
72
+ removeObstacle(obstacle: Recast.Obstacle): void;
73
+ update(maxIterations?: number): number;
74
+ serialize(): Uint8Array;
75
+ dispose(): void;
76
+ }
77
+ export declare class RecastNavigation {
78
+ #private;
79
+ constructor(module: RecastModule, generators: RecastGenerators);
80
+ generateSolo(input: NavigationTriangleSoup, config: Parameters<RecastGenerators["generateSoloNavMesh"]>[2]): RecastNavMeshHandle;
81
+ generateTileCache(input: NavigationTriangleSoup, config?: Parameters<RecastGenerators["generateTileCache"]>[2]): RecastTileCacheHandle;
82
+ import(bytes: Uint8Array): RecastNavMeshHandle;
83
+ importAsset(asset: NavigationAssetRef, options?: ImportNavigationAssetOptions): Promise<RecastNavMeshHandle>;
84
+ /** Stable typed escape hatch for Crowd, TileCache, and advanced Detour APIs. */
85
+ get rawModule(): RecastModule;
86
+ }
87
+ export declare function createRecastNavigation(options?: RecastNavigationOptions): Promise<RecastNavigation>;
88
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/navigation-recast/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC/D,MAAM,MAAM,YAAY,GAAG,cAAc,mBAAmB,CAAC,C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
3
+ throw new TypeError("Navigation coordinates must be finite.");
4
+ return { x: value[0], y: value[1], z: value[2] };
5
+ }
6
+ export class RecastNavMeshHandle {
7
+ #module;
8
+ #navMesh;
9
+ #query;
10
+ #disposed = false;
11
+ constructor(module, navMesh) {
12
+ this.#module = module;
13
+ this.#navMesh = navMesh;
14
+ this.#query = new module.NavMeshQuery(navMesh);
15
+ }
16
+ get disposed() { return this.#disposed; }
17
+ computePath(start, end) {
18
+ this.#assertAlive();
19
+ const result = this.#query.computePath(vector(start), vector(end));
20
+ if (!result.success)
21
+ return { success: false, points: [], error: String(result.error ?? "Detour path query failed.") };
22
+ return { success: true, points: result.path.map((point) => [point.x, point.y, point.z]) };
23
+ }
24
+ createCrowd(maxAgents, maxAgentRadius) {
25
+ this.#assertAlive();
26
+ return new RecastCrowdHandle(this.#module, this.#navMesh, maxAgents, maxAgentRadius);
27
+ }
28
+ serialize() { this.#assertAlive(); return this.#module.exportNavMesh(this.#navMesh); }
29
+ /** Stable escape hatch. The handle retains ownership and frees this object. */
30
+ unsafeRecastNavMesh() { this.#assertAlive(); return this.#navMesh; }
31
+ dispose() {
32
+ if (this.#disposed)
33
+ return;
34
+ this.#query.destroy();
35
+ this.#navMesh.destroy();
36
+ this.#disposed = true;
37
+ }
38
+ #assertAlive() { if (this.#disposed)
39
+ throw new Error("RecastNavMeshHandle is disposed."); }
40
+ }
41
+ export class RecastCrowdHandle {
42
+ #crowd;
43
+ #disposed = false;
44
+ constructor(module, navMesh, maxAgents, maxAgentRadius) {
45
+ if (!Number.isInteger(maxAgents) || maxAgents < 1)
46
+ throw new RangeError("maxAgents must be an integer >= 1.");
47
+ if (!Number.isFinite(maxAgentRadius) || maxAgentRadius <= 0)
48
+ throw new RangeError("maxAgentRadius must be positive.");
49
+ this.#crowd = new module.Crowd(navMesh, { maxAgents, maxAgentRadius });
50
+ }
51
+ addAgent(position, options = {}) {
52
+ this.#assertAlive();
53
+ return this.#crowd.addAgent(vector(position), options);
54
+ }
55
+ requestMoveTarget(agent, target) {
56
+ this.#assertAlive();
57
+ return agent.requestMoveTarget(vector(target));
58
+ }
59
+ update(dt) {
60
+ this.#assertAlive();
61
+ if (!Number.isFinite(dt) || dt <= 0)
62
+ throw new RangeError("Crowd dt must be positive and finite.");
63
+ this.#crowd.update(dt);
64
+ }
65
+ positions() {
66
+ this.#assertAlive();
67
+ return this.#crowd.getAgents().map((agent) => { const point = agent.position(); return [point.x, point.y, point.z]; });
68
+ }
69
+ /** Stable escape hatch. The handle owns and destroys this crowd. */
70
+ unsafeRecastCrowd() { this.#assertAlive(); return this.#crowd; }
71
+ dispose() { if (!this.#disposed) {
72
+ this.#crowd.destroy();
73
+ this.#disposed = true;
74
+ } }
75
+ #assertAlive() { if (this.#disposed)
76
+ throw new Error("RecastCrowdHandle is disposed."); }
77
+ }
78
+ export class RecastTileCacheHandle {
79
+ navMesh;
80
+ #module;
81
+ #tileCache;
82
+ #disposed = false;
83
+ constructor(module, navMesh, tileCache) {
84
+ this.#module = module;
85
+ this.#tileCache = tileCache;
86
+ this.navMesh = new RecastNavMeshHandle(module, navMesh);
87
+ }
88
+ addCylinderObstacle(position, radius, height) {
89
+ this.#assertAlive();
90
+ const result = this.#tileCache.addCylinderObstacle(vector(position), radius, height);
91
+ if (!result.success || !result.obstacle)
92
+ throw new Error(`Recast obstacle creation failed with status ${result.status}.`);
93
+ return result.obstacle;
94
+ }
95
+ removeObstacle(obstacle) {
96
+ this.#assertAlive();
97
+ const result = this.#tileCache.removeObstacle(obstacle);
98
+ if (!result.success)
99
+ throw new Error(`Recast obstacle removal failed with status ${result.status}.`);
100
+ }
101
+ update(maxIterations = 64) {
102
+ this.#assertAlive();
103
+ for (let iteration = 1; iteration <= maxIterations; iteration += 1) {
104
+ const result = this.#tileCache.update(this.navMesh.unsafeRecastNavMesh());
105
+ if (!result.success)
106
+ throw new Error(`Recast tile-cache update failed with status ${result.status}.`);
107
+ if (result.upToDate)
108
+ return iteration;
109
+ }
110
+ throw new Error(`Recast tile cache did not settle within ${maxIterations} updates.`);
111
+ }
112
+ serialize() {
113
+ this.#assertAlive();
114
+ return this.#module.exportTileCache(this.navMesh.unsafeRecastNavMesh(), this.#tileCache);
115
+ }
116
+ dispose() {
117
+ if (this.#disposed)
118
+ return;
119
+ this.#tileCache.destroy();
120
+ this.navMesh.dispose();
121
+ this.#disposed = true;
122
+ }
123
+ #assertAlive() { if (this.#disposed)
124
+ throw new Error("RecastTileCacheHandle is disposed."); }
125
+ }
126
+ export class RecastNavigation {
127
+ #module;
128
+ #generators;
129
+ constructor(module, generators) { this.#module = module; this.#generators = generators; }
130
+ generateSolo(input, config) {
131
+ const result = this.#generators.generateSoloNavMesh([...input.positions], [...input.indices], config);
132
+ if (!result.success || !result.navMesh)
133
+ throw new Error(`Recast navmesh generation failed: ${String(result.error ?? "unknown error")}`);
134
+ return new RecastNavMeshHandle(this.#module, result.navMesh);
135
+ }
136
+ generateTileCache(input, config = {}) {
137
+ const result = this.#generators.generateTileCache(input.positions, input.indices, config);
138
+ if (!result.success || !result.navMesh || !result.tileCache)
139
+ throw new Error(`Recast tile-cache generation failed: ${String(result.error ?? "unknown error")}`);
140
+ return new RecastTileCacheHandle(this.#module, result.navMesh, result.tileCache);
141
+ }
142
+ import(bytes) {
143
+ const result = this.#module.importNavMesh(bytes);
144
+ return new RecastNavMeshHandle(this.#module, result.navMesh);
145
+ }
146
+ async importAsset(asset, options = {}) {
147
+ if (asset.kind !== "aura-asset-ref" || asset.type !== "navigation" || asset.format !== "navmesh") {
148
+ throw new TypeError("Recast navigation import requires a typed Aura navigation/navmesh asset reference.");
149
+ }
150
+ const fetchAsset = options.fetch ?? ((url) => fetch(url));
151
+ const response = await fetchAsset(asset.url);
152
+ if (!response.ok)
153
+ throw new Error(`Navigation asset ${asset.id} failed to load (${response.status}) from ${asset.url}.`);
154
+ const bytes = new Uint8Array(await response.arrayBuffer());
155
+ if (bytes.byteLength === 0)
156
+ throw new Error(`Navigation asset ${asset.id} is empty.`);
157
+ if (options.verifyHash !== false && asset.hash)
158
+ await verifyNavigationAssetHash(asset, bytes);
159
+ return this.import(bytes);
160
+ }
161
+ /** Stable typed escape hatch for Crowd, TileCache, and advanced Detour APIs. */
162
+ get rawModule() { return this.#module; }
163
+ }
164
+ async function verifyNavigationAssetHash(asset, bytes) {
165
+ const expected = asset.hash?.match(/^sha256-([a-f0-9]{64})$/i)?.[1]?.toLowerCase();
166
+ if (!expected)
167
+ throw new Error(`Navigation asset ${asset.id} has an unsupported integrity value; expected sha256-<64 hex characters>.`);
168
+ if (!globalThis.crypto?.subtle)
169
+ throw new Error(`Navigation asset ${asset.id} cannot verify SHA-256 because Web Crypto is unavailable.`);
170
+ const digest = new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256", Uint8Array.from(bytes).buffer));
171
+ const actual = [...digest].map((value) => value.toString(16).padStart(2, "0")).join("");
172
+ if (actual !== expected)
173
+ throw new Error(`Navigation asset ${asset.id} failed SHA-256 verification.`);
174
+ }
175
+ export async function createRecastNavigation(options = {}) {
176
+ const module = await (options.moduleLoader ?? (() => import("recast-navigation")))();
177
+ await module.init();
178
+ const generators = await (options.generatorLoader ?? (() => import("recast-navigation/generators")))();
179
+ return new RecastNavigation(module, generators);
180
+ }
181
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/navigation-recast/src/index.ts"],"names":[],"mappings":"AAqDA,SAAS,MAAM,CAAC,KAAqB;IACnC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,CAAC;IAClH,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC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,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/G,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxF,IAAI,MAAM,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,KAAK,CAAC,EAAE,+BAA+B,CAAC,CAAC;AACxG,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,UAAmC,EAAE;IAChF,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;IACrF,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IACpB,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC,EAAE,CAAC;IACvG,OAAO,IAAI,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAClD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@aura3d/navigation-recast",
3
+ "version": "2.0.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "sideEffects": false,
8
+ "dependencies": {
9
+ "recast-navigation": "0.43.1"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "description": "Optional asynchronously initialized Recast/Detour navigation adapter for Aura3D.",
18
+ "keywords": [
19
+ "aura3d",
20
+ "navigation",
21
+ "recast",
22
+ "detour",
23
+ "navmesh",
24
+ "crowd",
25
+ "wasm"
26
+ ],
27
+ "homepage": "https://aura3d.auraone.ai",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/auraoneai/aura3d.git",
31
+ "directory": "packages/navigation-recast"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/auraoneai/aura3d/issues"
35
+ },
36
+ "license": "MIT",
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "files": [
41
+ "README.md",
42
+ "dist"
43
+ ]
44
+ }