tabbing...

This commit is contained in:
toni
2018-11-24 17:21:49 +01:00
parent 9de1e7142b
commit cb61e0fe68
3 changed files with 19 additions and 19 deletions

View File

@@ -70,7 +70,7 @@ namespace NM {
// to-be-walked distance;
const float toBeWalkedDist = params.getToBeWalkedDistance();
const float toBeWalkedDistSafe = 0.75 + toBeWalkedDist * 1.1;
const float toBeWalkedDistSafe = 0.75 + toBeWalkedDist * 1.1;
// construct reachable region
NavMeshSub<Tria> reachable(params.start, toBeWalkedDistSafe);
@@ -84,23 +84,23 @@ namespace NM {
// is above destination reachable?
if (dstTria) {
re.heading = params.heading; // heading was OK -> keep
re.location.pos = dstTria->toPoint3(dst); // new destination position
re.location.tria = dstTria; // new destination triangle
re.heading = params.heading; // heading was OK -> keep
re.location.pos = dstTria->toPoint3(dst); // new destination position
re.location.tria = dstTria; // new destination triangle
++hits;
} else {
NavMeshRandom<Tria> rnd = reachable.getRandom(); // random-helper
re.location = rnd.draw(); // get a random destianation
re.heading = Heading(params.start.pos.xy(), re.location.pos.xy()); // update the heading
NavMeshRandom<Tria> rnd = reachable.getRandom(); // random-helper
re.location = rnd.draw(); // get a random destianation
re.heading = Heading(params.start.pos.xy(), re.location.pos.xy()); // update the heading
++misses;
}
const int total = (hits + misses);
if (total % 10000 == 0) {
//std::cout << "hits: " << (hits*100/total) << "%" << std::endl;
//std::cout << "hits: " << (hits*100/total) << "%" << std::endl;
}
// calculate probability