added walker sanity checks
This commit is contained in:
@@ -64,6 +64,10 @@ namespace NM {
|
||||
return _toBeWalkedDistance;
|
||||
}
|
||||
|
||||
void check() const {
|
||||
Assert::isFalse(numSteps == 0, "num Steps = 0 is currently not supported. must be >= 1");
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// precalc
|
||||
|
||||
@@ -50,6 +50,9 @@ namespace NM {
|
||||
|
||||
ResultEntry getOne(const NavMeshWalkParams<Tria>& params) const {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
ResultEntry res;
|
||||
res.probability = 0;
|
||||
|
||||
@@ -94,6 +97,9 @@ namespace NM {
|
||||
|
||||
ResultList getMany(const NavMeshWalkParams<Tria>& params) const {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
ResultList res;
|
||||
|
||||
// to-be-walked distance;
|
||||
|
||||
@@ -50,6 +50,9 @@ namespace NM {
|
||||
|
||||
ResultEntry getOne(const NavMeshWalkParams<Tria>& params) {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
ResultEntry re;
|
||||
|
||||
static Distribution::Uniform<float> dHead(-0.10, +0.10, 1337);
|
||||
@@ -117,7 +120,12 @@ namespace NM {
|
||||
}
|
||||
|
||||
ResultList getMany(const NavMeshWalkParams<Tria>& params) {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
return {getOne(params)};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -53,6 +53,9 @@ namespace NM {
|
||||
|
||||
ResultEntry getOne(const NavMeshWalkParams<Tria>& params) const {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
static Distribution::Normal<float> dDist(1.0, 0.4);
|
||||
static Distribution::Normal<float> dHead(0.0, 1.0);
|
||||
|
||||
@@ -106,6 +109,9 @@ namespace NM {
|
||||
|
||||
ResultList getMany(const NavMeshWalkParams<Tria>& params) const {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
static Distribution::Normal<float> dDist(1.0, 0.4);
|
||||
static Distribution::Normal<float> dHead(0.0, 1.0);
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace NM {
|
||||
|
||||
ResultEntry getOne(const NavMeshWalkParams<Tria>& params) {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
ResultEntry re;
|
||||
|
||||
// to-be-walked distance;
|
||||
@@ -103,7 +106,12 @@ namespace NM {
|
||||
}
|
||||
|
||||
ResultList getMany(const NavMeshWalkParams<Tria>& params) {
|
||||
|
||||
// sanity checks
|
||||
params.check();
|
||||
|
||||
return {getOne(params)};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user