worked on nav-mesh

added dijkstra support for nav mesh
some minor changes to distributions
minor fixes
This commit is contained in:
k-a-z-u
2018-01-17 16:36:37 +01:00
parent e81e8c112d
commit 3c72bc814c
15 changed files with 696 additions and 48 deletions

View File

@@ -68,13 +68,13 @@ namespace NM {
re.location = pwalk.end;
for (int i = 0; i < 25; ++i) {
for (int i = 0; i < 10; ++i) {
const float distance = params.getToBeWalkedDistance() * dDist.draw();
const Heading head = params.heading + dHead.draw();
// only forward!
if (distance < 0.01) {continue;}
if (distance < 0.01) {--i; continue;}
// get the to-be-reached destination's position (using start+distance+heading)
const Point2 dir = head.asVector();
@@ -123,7 +123,7 @@ namespace NM {
const Heading head = params.heading + dHead.draw();
// only forward!
if (distance < 0.01) {continue;}
if (distance < 0.01) {--i; continue;}
// get the to-be-reached destination's position (using start+distance+heading)
const Point2 dir = head.asVector();