Missing navMeshWorker.js in docs

On the Create Navigational Mesh Page, the git link for the template navMeshWorker.js is broken

Page: Creating A Navigation Mesh | Babylon.js Documentation
Broken link: https://github.com/BabylonJS/Babylon.js/tree/master/packages/tools/playground/workers/navMeshWorker.js

Any chance we can get it fixed?

Besides fixing the docs, It would be nice to put all the wasm deps sources together on github probably in their own repo. They used to be in the playground’s public folder but after the monorepo change, idk. Tbh too difficult to find stuff now that everything is aliased, at least for me but im a little dumb

1 Like

cc @Cedric the daddy of the nav mesh

If we are re-working the docs the recast setup process in general is not as described. Took me a few hours to sort it out as even the few posts about it in the forums over the last few years did not have accurate solutions. End of the day, I had to:

  1. Include Babylon’s RecastJSPlugin
  2. @npm -i recast-detour
  3. import recast-detour (latest)
  4. add the workers.js

After that the code blocks below became the startup for it. This is coming from a recently re-installed node. Hope I cut and pasted everything needed. I can’t guarantee this is the “right way” but from what I remember this was my process and things are now working.

import { RecastJSPlugin } from "@babylonjs/core";
import * as Recast from "recast-detour";

// Class constructor...
export class navigation{ 
/** Holds the Navigational Plugin instance; */
     public np:any;
/** Home of the JS file for the navigational webworker. Separate JS is used to create as a parellel task as to not slow down BabylonJS  */
    public npNavMeshWorkerURL:String = "./src/navMeshWorker.js"; 

   // form your class

 public async init(){
         return new Promise(async(resolve) => {
             let recast = await (Recast as any)();
             this.np = new RecastJSPlugin(recast);
             this.newNavMesh(); // this is where the existing docs pick up with usage

Wish we could package recast-detour into Babylon so the process is as simple as every other part of BabylonJS to use. But understanding that its not a commonly used feature and that may bloat things.

for the url


We don’t have a doc page for that. Which is a shame. Are you ok to do a doc PR for that?