minor changes to grid walking
This commit is contained in:
@@ -111,14 +111,12 @@ public:
|
||||
return Base::get(distance);
|
||||
}
|
||||
|
||||
/** is the given position part of a floor (or in the air) */
|
||||
bool isOnFloor(const float distance) const {
|
||||
const Point3 pos = getPosAfterDistance(distance);
|
||||
for (const Floorplan::Floor* floor : map->floors) {
|
||||
const float delta = std::abs(floor->atHeight - pos.z);
|
||||
if (delta < 0.1) {return true;}
|
||||
}
|
||||
return false;
|
||||
/** at the given distance: are we walking on a plain surface or up/down? */
|
||||
bool isPlain(const float distance) const {
|
||||
const Point3 pos1 = getPosAfterDistance(distance);
|
||||
const Point3 pos2 = getPosAfterDistance(distance + 0.1);
|
||||
const float delta = std::abs(pos1.z - pos2.z);
|
||||
return delta < 0.01;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user