Get height of navmesh at x/z world position

I’m trying to get the height of a navmesh (from the RecastJSPlugin) at a x/z world coordinate.

I’m guessing I can get that using the Uint8Array returned by getNavMeshData(). However, I’m not experienced with meshes etc., so I’m not sure how to interpret the array.
So, is it possible to get the y value of the navmesh at world coordinates x/z?

cc @Cedric

I see 2 ‘easy’ ways:

If your navmesh can be represented by a heightmap, then, it will be enough. If you have multiple levels (2 valid heights for a x/z position), then you will have to take care of the height in the query or picking.

Thanks, I went with raypicking and some customized checks for my case.

2 Likes