c-frame / aframe-extras

Add-ons and helpers for A-Frame VR.
https://c-frame.github.io/aframe-extras/examples/
MIT License
967 stars 308 forks source link

[pathfinding] Nav-mesh to avoid collision with moving objects #230

Open rmr-code opened 6 years ago

rmr-code commented 6 years ago

This is more like a feature request (or its integration with physics).

The use-case being that there is a (one or more) moving object in a scene and that could be in the path of the user. How do we avoid colliding with it.

donmccurdy commented 6 years ago

Hi @rajnikantmrao — for now this isn't really supported. The proper way to implement it would be for the navigation system to dynamically modify the navigation mesh around objects with a nav-obstacle component, as those objects move. Maybe in the future, but it's fairly complex and so I can't make any promises there. Using both physics and a navmesh for player movement obstacles is also not supported, although physics can still be used for other interactions while a navmesh is used for movement.

If you have a simpler use case (e.g. a door opens up when the user completes a level) you can change the navigation mesh yourself, and then call navMeshEl.components['nav-mesh'].loadNavMesh().

rmr-code commented 6 years ago

Thanks @donmccurdy for the detailed response. I find the navmesh useful for my use-cases and keenly look forward to the enhancements. The collisions of the avatars is not a serious issue since I am sure, knowingly, folks will not want to "step on one another's toes" ... literally. Thanks for providing such excellent components that lets us focus on the applications.

rmr-code commented 6 years ago

Or should I keep it open? Your call @donmccurdy