recast-navigation-js
recast-navigation-js copied to clipboard
Add storybook demonstrating how to correct navmesh height with raycasting
Depending on the cell height of a nav mesh, agents can appear to be floating.
A common solution for this problem is raycasting to determine how to adjust an agents display position.
Should add a storybook demonstrating this common scenario.
Experimenting with this in isaac-mason/sketches: https://github.com/isaac-mason/sketches/tree/70b43b0df475e796b2d6f169ea718b69cc392504/src/sketches/recast-navigation/character-controller
This isn't a general solution yet though. That sketch only uses one ray, which leads to undesired behaviour when traversing over terrain that has gaps, e.g. a wooden plank bridge. A sphere intersection test / shapecast may be a more general solution for this.