recast-navigation 0.34.0 → 0.35.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 CHANGED
@@ -14,7 +14,7 @@
14
14
  - 🚧 ‎ Temporary obstacles
15
15
  - 🌐 ‎ Web and Node support
16
16
  - 💙 ‎ TypeScript friendly
17
- - 🖇 ‎ [Easy integration with three.js via @recast-navigation/three](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-three)
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 library in different environments (such as NodeJS, CommonJS) can be found in the [examples](./examples) directory.
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
- "@recast-navigation/core": "https://unpkg.com/@recast-navigation/core@0.29.0/dist/index.mjs",
61
- "@recast-navigation/wasm": "https://unpkg.com/@recast-navigation/wasm@0.29.0/dist/recast-navigation.wasm-compat.js",
62
- "@recast-navigation/generators": "https://unpkg.com/@recast-navigation/generators@0.29.0/dist/index.mjs",
63
- "@recast-navigation/three": "https://unpkg.com/@recast-navigation/three@0.29.0/dist/index.mjs"
72
+ // required
73
+ "@recast-navigation/core": "https://unpkg.com/@recast-navigation/core@0.30.0/dist/index.mjs",
74
+ "@recast-navigation/wasm": "https://unpkg.com/@recast-navigation/wasm@0.30.0/dist/recast-navigation.wasm-compat.js",
75
+
76
+ // easy to use generators
77
+ "@recast-navigation/generators": "https://unpkg.com/@recast-navigation/generators@0.30.0/dist/index.mjs",
78
+
79
+ // optional integrations
80
+ "@recast-navigation/three": "https://unpkg.com/@recast-navigation/three@0.30.0/dist/index.mjs",
81
+ "@recast-navigation/playcanvas": "https://unpkg.com/@recast-navigation/three@0.30.0/dist/index.mjs",
64
82
  }
65
83
  }
66
84
  </script>
@@ -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` package](https://github.com/isaac-mason/recast-navigation-js/tree/main/packages/recast-navigation-three/README.md).
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, with the `recast-navigation` acting as an umbrella package.
603
+ Functionality is spread across packages in the `@recast-navigation/*` organization.
586
604
 
587
- You can choose between picking the scoped packages you need, or using the umbrella `recast-navigation` package, which provides additional entrypoints for specific frameworks and libraries.
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
  [![Version](https://img.shields.io/npm/v/@recast-navigation/core)](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
+ [![Version](https://img.shields.io/npm/v/@recast-navigation/playcanvas)](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
  [![Version](https://img.shields.io/npm/v/@recast-navigation/wasm)](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, as `@recast-navigation/core` uses it internally.
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/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "email": "isaac@isaacmason.com",
19
19
  "url": "https://isaacmason.com/"
20
20
  },
21
- "version": "0.34.0",
21
+ "version": "0.35.0",
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 three.mjs three.d.ts || true)",
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.34.0",
71
- "@recast-navigation/generators": "0.34.0",
72
- "@recast-navigation/three": "0.34.0"
62
+ "@recast-navigation/core": "0.35.0",
63
+ "@recast-navigation/generators": "0.35.0"
73
64
  },
74
65
  "devDependencies": {
75
66
  "@babel/core": "^7.24.5",
@@ -94,7 +85,7 @@
94
85
  "@storybook/react-vite": "^8.0.9",
95
86
  "@types/react": "^18.3.1",
96
87
  "@types/react-dom": "^18.2.8",
97
- "@types/three": "^0.167.1",
88
+ "@types/three": "^0.169.0",
98
89
  "@vitejs/plugin-react": "^4.2.1",
99
90
  "eslint": "^9.6.0",
100
91
  "leva": "^0.9.35",
@@ -105,11 +96,11 @@
105
96
  "rollup-plugin-filesize": "^10.0.0",
106
97
  "storybook": "^8.0.9",
107
98
  "suspend-react": "^0.1.3",
108
- "three": "^0.167.1",
99
+ "three": "^0.169.0",
109
100
  "three-pathfinding": "^1.2.0",
110
101
  "typescript": "^5.4.3",
111
- "vite": "^5.2.10",
112
- "vitest": "^1.5.2",
102
+ "vite": "^5.4.8",
103
+ "vitest": "^2.1.2",
113
104
  "zustand": "^4.5.2"
114
105
  },
115
106
  "packageManager": "yarn@3.2.2"
package/three.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from '@recast-navigation/three';
package/three.mjs DELETED
@@ -1,2 +0,0 @@
1
- export*from"@recast-navigation/three";
2
- //# sourceMappingURL=three.mjs.map
package/three.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"three.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}