added new sanity-check assertions
fixed issue with angles [bad interface] - adjusted other parts accordingly - added corresponding test-cases started working on absolute heading
This commit is contained in:
@@ -104,9 +104,19 @@ public:
|
||||
//if (cnt != 0) {probability /= cnt;} else {probability = 1.0;}
|
||||
probability = 1.0;
|
||||
//probability = (maxEdgeProb.isValid()) ? (maxEdgeProb.get()) : (1.0); // dist_m might be zero -> no edges -> no maximum
|
||||
probability *= curNode->getWalkImportance();// < 0.4f ? (0.1) : (1.0); // "kill" particles that walk near walls (most probably trapped ones)
|
||||
|
||||
// add the walk importance to the probabiliy [each node has a to-be-walked-probability depending on its distance to walls, etc...]
|
||||
const float walkImportance = curNode->getWalkImportance();
|
||||
Assert::isNotNaN(walkImportance, "grid-node's walk-importance is NaN. Did you forget to calculate the importance values after building the grid?");
|
||||
Assert::isBetween(walkImportance, 0.0f, 2.5f, "grid-node's walk-importance is out of range. Did you forget to calculate the importance values after building the grid?");
|
||||
probability *= walkImportance;// < 0.4f ? (0.1) : (1.0); // "kill" particles that walk near walls (most probably trapped ones)
|
||||
|
||||
|
||||
//probability = std::pow(probability, 5);
|
||||
|
||||
// sanity check
|
||||
Assert::isNotNaN(probability, "detected NaN grid-walk probability");
|
||||
|
||||
// update after
|
||||
updateAfter(currentState, *startNode, *curNode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user