added floorplan support for object-sizing

added floorplan support for different wall-heights
minor fixes/changes
This commit is contained in:
k-a-z-u
2018-07-04 20:28:15 +02:00
parent fb8061125f
commit 19d9ce3961
10 changed files with 58 additions and 18 deletions

View File

@@ -52,6 +52,7 @@ private:
bool _buildStairs = true;
bool _removeIsolated = true;
bool _addTightToObstacle = false;
bool _abortOnError = true;
public:
@@ -60,6 +61,8 @@ public:
}
void setAbortOnError(const bool abort) {this->_abortOnError = abort;}
void setAddTightToObstacle(const bool tight) {this->_addTightToObstacle = tight;}
/** whether or not to build stairs */
@@ -181,7 +184,9 @@ public:
// belongs to a "add" polygon? -> remember until all polygons were checked
// [might still belong to a "remove" polygon]
res.outdoor = poly->outdoor;
if (poly->outdoor) {
res.outdoor = true; // belonging to an outdoor region overwrites all other belongings
}
}
}
@@ -219,7 +224,7 @@ public:
if (foo) {
// get the obstacle
const Ray3D::Obstacle3D obs = Ray3D::OBJPool::get().getObject(foo->file).rotated_deg(foo->rot).translated(foo->pos);
const Ray3D::Obstacle3D obs = Ray3D::OBJPool::get().getObject(foo->file).scaled(foo->scale).rotated_deg(foo->rot).translated(foo->pos);
// construct its 2D convex hull (in centimter)
HelperPoly poly;
@@ -295,6 +300,8 @@ public:
void buildStairs(const Floorplan::IndoorMap* map, const Floorplan::Floor* floor, GridFactoryListener* listener = nullptr) {
stairs.setAbortOnError(_abortOnError);
const int total = floor->stairs.size();
int cur = 0;