navmesh
navmesh copied to clipboard
how to get a random point on navmesh
trafficstars
Hi there,
Thanks so much for a great library,
I'm trying to get a random point on the navmesh, is this someting possible? And what would be the best way about it?
I know this is a not issue as such, but I have no idea where to ask this question, and it could be a feature? :)
If you're using Phaser, you could use Phaser.Geom.Rectangle#getRandomPoint to get a random position and then use NavMesh#isPointInMesh to see if it's inside the navigable area. Otherwise you could reverse engineer the Phaser implementation as it's rather straight forward.