minor changes to grid walking

This commit is contained in:
k-a-z-u
2017-12-13 16:37:51 +01:00
parent 1114331fd2
commit d48b0b8fd4
7 changed files with 41 additions and 24 deletions

View File

@@ -213,6 +213,14 @@ public:
return GridNodeBBox(node, gridSize_cm);
}
/** is this node part of a non-plain stair/escalator */
bool isPlain(const T& n1) const {
for (const T& n2 : neighbors(n1)) {
if (n2.z_cm != n1.z_cm) {return false;}
}
return true;
}
/**
* get an UID for the given point.
* this works only for aligned points.
@@ -469,11 +477,11 @@ public:
NeighborForEach neighbors(const int idx) {
NeighborForEach neighbors(const int idx) const {
return neighbors(nodes[idx]);
}
NeighborForEach neighbors(const T& node) {
NeighborForEach neighbors(const T& node) const {
return NeighborForEach(*this, node._idx);
}