added lint for doors
small obj-pool fix
This commit is contained in:
@@ -116,7 +116,7 @@ namespace Ray3D {
|
||||
|
||||
|
||||
|
||||
private:
|
||||
public:
|
||||
|
||||
/** convert a floor (floor/ceiling) into triangles */
|
||||
std::vector<Obstacle3D> getFloor(const Floorplan::Floor* f) {
|
||||
@@ -426,10 +426,18 @@ namespace Ray3D {
|
||||
return (line->from == door->from || line->to == door->from || line->from == door->to || line->to == door->to);
|
||||
};
|
||||
auto it = std::find_if(f->obstacles.begin(), f->obstacles.end(), comp);
|
||||
|
||||
// there is absolutely nothing attached directly to the door...
|
||||
if (it == f->obstacles.end()) {
|
||||
throw Exception("did not find a matching element to place above the door");
|
||||
}
|
||||
|
||||
// try to convert the element directly connected to the door into a line-obstacle
|
||||
const Floorplan::FloorObstacleLine* line = dynamic_cast<const Floorplan::FloorObstacleLine*> (*it);
|
||||
|
||||
// there seems to be no wall (but something else?!) attached to the door. fishy..
|
||||
if (!line) {
|
||||
throw Exception("did not find a matching element to place above the door");
|
||||
throw Exception("did not find a matching wall to place above the door");
|
||||
}
|
||||
|
||||
// get the obstacle to place above the door
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace Ray3D {
|
||||
scanFolder(folder);
|
||||
} catch (...) {;}
|
||||
}
|
||||
initDone = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user