A WebAssembly port of Recast Navigation, plus other goodies.
Warning This library is still in early development. Versions in the 0.x.x range may have breaking changes.
- 📐 NavMesh generation
- 🧭 Pathfinding
- 🧑🤝🧑 Crowd simulation
- 🌐 Web and Node support
- 💙 TypeScript support
- 🖇 Easy integration with three.js via @recast-navigation/three
Documentation can be found at https://docs.recast-navigation-js.isaacmason.com.
Some demonstrations of how to use the library in different environments can be found in the examples directory.
There are also storybooks that demonstrate the library in action: https://recast-navigation-js.isaacmason.com. The source code for the storybooks can be found in ./packages/recast-navigation/.storybook/stories.
Functionality is spread across packages in the @recast-navigation/*
organization, with the recast-navigation
acting as an umbrella package.
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.
All packages ship as ECMAScript modules, and are compatible with Node.js and browser environments.
The umbrella package for recast-navigation
.
> npm install recast-navigation
The core library!
> npm install @recast-navigation/core
Helpers for three.js.
> npm install @recast-navigation/three
A website for generating navmeshes for your game. Drag 'n' drop your GLTF, fine tune your settings, and download your navmesh!
(source)
The repository is structured as a monorepo. You will find all published packages inside ./packages
, reference examples in ./examples
, and deployed applications in ./apps
.
Before building, ensure you have the following installed:
- Node 18
- Python 3.10.5
- Emsdk v3.1.44
To build the project, run the following:
> yarn install
> yarn build
- This would not exist without Recast Navigation itself!
- The demos use recastnavigation's level mesh
- The WASM build was based on the Babylon.js Recast Extension