recast-navigation-js icon indicating copy to clipboard operation
recast-navigation-js copied to clipboard

Add storybook demonstrating how to correct navmesh height with raycasting

Open isaac-mason opened this issue 1 year ago • 1 comments

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.

isaac-mason avatar Aug 30 '23 15:08 isaac-mason

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.

isaac-mason avatar Sep 24 '23 12:09 isaac-mason