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