recast-navigation 0.34.0 → 0.35.1
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 +45 -12
- package/generators.mjs +1 -2
- package/index.mjs +1 -2
- package/package.json +8 -18
- package/generators.mjs.map +0 -1
- package/index.mjs.map +0 -1
- package/three.d.ts +0 -1
- package/three.mjs +0 -2
- package/three.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
- 🚧 Temporary obstacles
|
|
15
15
|
- 🌐 Web and Node support
|
|
16
16
|
- 💙 TypeScript friendly
|
|
17
|
-
- 🖇
|
|
17
|
+
- 🖇 Easy integration with [three.js via @recast-navigation/three](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-three) and [playcanvas via @recast-navigation/playcanvas](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-playcanvas)
|
|
18
18
|
|
|
19
19
|
## Overview
|
|
20
20
|
|
|
@@ -29,7 +29,7 @@ Go to the [examples website](https://recast-navigation-js.isaacmason.com) to see
|
|
|
29
29
|
- live: [https://recast-navigation-js.isaacmason.com](https://recast-navigation-js.isaacmason.com).
|
|
30
30
|
- examples source code: [./packages/recast-navigation/.storybook/stories](./packages/recast-navigation/.storybook/stories).
|
|
31
31
|
|
|
32
|
-
Demonstrations of how to use the
|
|
32
|
+
Demonstrations of how to use the recast-navigation-js with different libraries and environments can be found in the [examples](./examples) directory.
|
|
33
33
|
|
|
34
34
|
## Installation
|
|
35
35
|
|
|
@@ -49,6 +49,18 @@ export default defineConfig(() => ({
|
|
|
49
49
|
)}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
If you are planning to use the library with three.js, install the `@recast-navigation/three` package for three.js helpers:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm install @recast-navigation/three
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If you are planning to use the library with playcanvas, install the `@recast-navigation/playcanvas` package for playcanvas helpers:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
npm install @recast-navigation/playcanvas
|
|
62
|
+
```
|
|
63
|
+
|
|
52
64
|
**Usage without bundlers**
|
|
53
65
|
|
|
54
66
|
You can use import maps to use the library without a bundler:
|
|
@@ -57,10 +69,16 @@ You can use import maps to use the library without a bundler:
|
|
|
57
69
|
<script type="importmap">
|
|
58
70
|
{
|
|
59
71
|
"imports": {
|
|
60
|
-
|
|
61
|
-
"@recast-navigation/
|
|
62
|
-
"@recast-navigation/
|
|
63
|
-
|
|
72
|
+
// required
|
|
73
|
+
"@recast-navigation/core": "https://unpkg.com/@recast-navigation/core@0.35.0/dist/index.mjs",
|
|
74
|
+
"@recast-navigation/wasm": "https://unpkg.com/@recast-navigation/wasm@0.35.0/dist/recast-navigation.wasm-compat.js",
|
|
75
|
+
|
|
76
|
+
// easy to use generators
|
|
77
|
+
"@recast-navigation/generators": "https://unpkg.com/@recast-navigation/generators@0.35.0/dist/index.mjs",
|
|
78
|
+
|
|
79
|
+
// optional integrations
|
|
80
|
+
"@recast-navigation/three": "https://unpkg.com/@recast-navigation/three@0.35.0/dist/index.mjs",
|
|
81
|
+
"@recast-navigation/playcanvas": "https://unpkg.com/@recast-navigation/three@0.35.0/dist/index.mjs",
|
|
64
82
|
}
|
|
65
83
|
}
|
|
66
84
|
</script>
|
|
@@ -71,7 +89,7 @@ You can use import maps to use the library without a bundler:
|
|
|
71
89
|
</script>
|
|
72
90
|
```
|
|
73
91
|
|
|
74
|
-
A full example can be found here: https://github.com/isaac-mason/recast-navigation-js/tree/main/examples/
|
|
92
|
+
A full example can be found here: https://github.com/isaac-mason/recast-navigation-js/tree/main/examples/three-vanilla-example/index.html
|
|
75
93
|
|
|
76
94
|
## Documentation
|
|
77
95
|
|
|
@@ -153,7 +171,7 @@ See the docs for more information on generator options: https://docs.recast-navi
|
|
|
153
171
|
|
|
154
172
|
It's possible to build a NavMesh in a Web Worker. This can be useful for offloading heavy computation from the main thread.
|
|
155
173
|
|
|
156
|
-
The library doesn't include a web worker, but it's straightforward to create your own. An example of solo nav mesh generation in a web worker can be found here: https://github.com/isaac-mason/recast-navigation-js/tree/next/examples/vite-worker-example
|
|
174
|
+
The library doesn't include a web worker, but it's straightforward to create your own. An example of solo nav mesh generation in a web worker can be found here: https://github.com/isaac-mason/recast-navigation-js/tree/next/examples/three-vite-worker-example
|
|
157
175
|
|
|
158
176
|
The example uses `importNavMesh` and `exportNavMesh` to serialize and deserialize a NavMesh for transfer between the main thread and the web worker.
|
|
159
177
|
|
|
@@ -486,7 +504,7 @@ const debugNavMesh = navMesh.getDebugNavMesh();
|
|
|
486
504
|
const { positions, indices } = debugNavMesh;
|
|
487
505
|
```
|
|
488
506
|
|
|
489
|
-
If you are using three.js, you can use built-in helpers from the [`@recast-navigation/three`
|
|
507
|
+
If you are using three.js or playcanvas, you can use built-in helpers from the integration libraries [`@recast-navigation/three`](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-three/README.md) / [`@recast-navigation/playcanvas`](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-playcanvas/README.md).
|
|
490
508
|
|
|
491
509
|
#### Detour Status Codes
|
|
492
510
|
|
|
@@ -582,9 +600,9 @@ const { navMesh, tileCache, allocator, compressor } = importTileCache(
|
|
|
582
600
|
|
|
583
601
|
## Packages
|
|
584
602
|
|
|
585
|
-
Functionality is spread across packages in the `@recast-navigation/*` organization
|
|
603
|
+
Functionality is spread across packages in the `@recast-navigation/*` organization.
|
|
586
604
|
|
|
587
|
-
|
|
605
|
+
The `recast-navigation` package is the umbrella package for core packages, and has entrypoints for `@recast-navigation/core` and `@recast-navigation/generators`.
|
|
588
606
|
|
|
589
607
|
All packages ship as ECMAScript modules, and are compatible with Node.js and browser environments.
|
|
590
608
|
|
|
@@ -598,6 +616,11 @@ The umbrella package for `recast-navigation`.
|
|
|
598
616
|
> npm install recast-navigation
|
|
599
617
|
```
|
|
600
618
|
|
|
619
|
+
```ts
|
|
620
|
+
import { init } from 'recast-navigation';
|
|
621
|
+
import { generateSoloNavMesh } from 'recast-navigation/generators';
|
|
622
|
+
```
|
|
623
|
+
|
|
601
624
|
### [**`@recast-navigation/core`**](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-core)
|
|
602
625
|
|
|
603
626
|
[](https://www.npmjs.com/package/@recast-navigation/core)
|
|
@@ -628,13 +651,23 @@ Helpers for three.js.
|
|
|
628
651
|
> npm install @recast-navigation/three
|
|
629
652
|
```
|
|
630
653
|
|
|
654
|
+
### [**`@recast-navigation/playcanvas`**](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-playcanvas)
|
|
655
|
+
|
|
656
|
+
[](https://www.npmjs.com/package/@recast-navigation/playcanvas)
|
|
657
|
+
|
|
658
|
+
Helpers for playcanvas.
|
|
659
|
+
|
|
660
|
+
```bash
|
|
661
|
+
> npm install @recast-navigation/playcanvas
|
|
662
|
+
```
|
|
663
|
+
|
|
631
664
|
### [**`@recast-navigation/wasm`**](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-wasm)
|
|
632
665
|
|
|
633
666
|
[](https://www.npmjs.com/package/@recast-navigation/wasm)
|
|
634
667
|
|
|
635
668
|
The WebAssembly build of the Recast and Detour libraries.
|
|
636
669
|
|
|
637
|
-
You regularly won't need to use this package directly,
|
|
670
|
+
You regularly won't need to use this package directly, `@recast-navigation/core` uses it internally.
|
|
638
671
|
|
|
639
672
|
```bash
|
|
640
673
|
> npm install @recast-navigation/wasm
|
package/generators.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export*from
|
|
2
|
-
//# sourceMappingURL=generators.mjs.map
|
|
1
|
+
export * from '@recast-navigation/generators';
|
package/index.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export*from
|
|
2
|
-
//# sourceMappingURL=index.mjs.map
|
|
1
|
+
export * from '@recast-navigation/core';
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"email": "isaac@isaacmason.com",
|
|
19
19
|
"url": "https://isaacmason.com/"
|
|
20
20
|
},
|
|
21
|
-
"version": "0.
|
|
21
|
+
"version": "0.35.1",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"homepage": "https://github.com/isaac-mason/recast-navigation-js",
|
|
24
24
|
"bugs": {
|
|
@@ -38,11 +38,6 @@
|
|
|
38
38
|
"types": "./generators.d.ts",
|
|
39
39
|
"import": "./generators.mjs",
|
|
40
40
|
"default": "./generators.mjs"
|
|
41
|
-
},
|
|
42
|
-
"./three": {
|
|
43
|
-
"types": "./three.d.ts",
|
|
44
|
-
"import": "./three.mjs",
|
|
45
|
-
"default": "./three.mjs"
|
|
46
41
|
}
|
|
47
42
|
},
|
|
48
43
|
"files": [
|
|
@@ -52,14 +47,11 @@
|
|
|
52
47
|
"generators.mjs",
|
|
53
48
|
"generators.mjs.map",
|
|
54
49
|
"generators.d.ts",
|
|
55
|
-
"three.mjs",
|
|
56
|
-
"three.mjs.map",
|
|
57
|
-
"three.d.ts",
|
|
58
50
|
"LICENSE",
|
|
59
51
|
"README.md"
|
|
60
52
|
],
|
|
61
53
|
"scripts": {
|
|
62
|
-
"clean": "(rm index.mjs index.d.ts generators.mjs generators.d.ts
|
|
54
|
+
"clean": "(rm index.mjs index.d.ts generators.mjs generators.d.ts || true)",
|
|
63
55
|
"build": "yarn clean && rollup --config rollup.config.js --bundleConfigAsCjs",
|
|
64
56
|
"storybook": "storybook dev -p 6006",
|
|
65
57
|
"build-storybook": "storybook build",
|
|
@@ -67,9 +59,8 @@
|
|
|
67
59
|
"lint": "eslint src"
|
|
68
60
|
},
|
|
69
61
|
"dependencies": {
|
|
70
|
-
"@recast-navigation/core": "0.
|
|
71
|
-
"@recast-navigation/generators": "0.
|
|
72
|
-
"@recast-navigation/three": "0.34.0"
|
|
62
|
+
"@recast-navigation/core": "0.35.1",
|
|
63
|
+
"@recast-navigation/generators": "0.35.1"
|
|
73
64
|
},
|
|
74
65
|
"devDependencies": {
|
|
75
66
|
"@babel/core": "^7.24.5",
|
|
@@ -83,7 +74,6 @@
|
|
|
83
74
|
"@rollup/plugin-babel": "^6.0.4",
|
|
84
75
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
85
76
|
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
86
|
-
"@rollup/plugin-terser": "^0.4.3",
|
|
87
77
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
88
78
|
"@storybook/addon-actions": "^8.0.9",
|
|
89
79
|
"@storybook/addon-essentials": "^8.0.9",
|
|
@@ -94,7 +84,7 @@
|
|
|
94
84
|
"@storybook/react-vite": "^8.0.9",
|
|
95
85
|
"@types/react": "^18.3.1",
|
|
96
86
|
"@types/react-dom": "^18.2.8",
|
|
97
|
-
"@types/three": "^0.
|
|
87
|
+
"@types/three": "^0.169.0",
|
|
98
88
|
"@vitejs/plugin-react": "^4.2.1",
|
|
99
89
|
"eslint": "^9.6.0",
|
|
100
90
|
"leva": "^0.9.35",
|
|
@@ -105,11 +95,11 @@
|
|
|
105
95
|
"rollup-plugin-filesize": "^10.0.0",
|
|
106
96
|
"storybook": "^8.0.9",
|
|
107
97
|
"suspend-react": "^0.1.3",
|
|
108
|
-
"three": "^0.
|
|
98
|
+
"three": "^0.169.0",
|
|
109
99
|
"three-pathfinding": "^1.2.0",
|
|
110
100
|
"typescript": "^5.4.3",
|
|
111
|
-
"vite": "^5.
|
|
112
|
-
"vitest": "^1.
|
|
101
|
+
"vite": "^5.4.8",
|
|
102
|
+
"vitest": "^2.1.2",
|
|
113
103
|
"zustand": "^4.5.2"
|
|
114
104
|
},
|
|
115
105
|
"packageManager": "yarn@3.2.2"
|
package/generators.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generators.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/index.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/three.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@recast-navigation/three';
|
package/three.mjs
DELETED
package/three.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"three.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|