added support for .obj objects within the floorplan

include objects within navmesh calculation
include objects within 3d mesh generation
minor changes/fixes
This commit is contained in:
2018-02-17 17:20:43 +01:00
parent 42a3a47317
commit 8358f45674
15 changed files with 770 additions and 114 deletions

View File

@@ -391,6 +391,7 @@ namespace Floorplan {
if (std::string("line") == n->Name()) {obstacles.push_back(parseFloorObstacleLine(n));}
if (std::string("circle") == n->Name()) {obstacles.push_back(parseFloorObstacleCircle(n));}
if (std::string("door") == n->Name()) {obstacles.push_back(parseFloorObstacleDoor(n));}
if (std::string("object") == n->Name()) {obstacles.push_back(parseFloorObstacleObject(n));}
}
return obstacles;
}
@@ -426,6 +427,15 @@ namespace Floorplan {
);
}
/** parse one object */
static FloorObstacleObject* parseFloorObstacleObject(const XMLElem* el) {
return new FloorObstacleObject(
el->Attribute("file"),
Point3(el->FloatAttribute("x"), el->FloatAttribute("y"), el->FloatAttribute("z")),
Point3(el->FloatAttribute("rx"), el->FloatAttribute("ry"), el->FloatAttribute("rz"))
);
}
/** parse a floor's <outline> tag */
static FloorOutline parseFloorOutline(const XMLElem* el) {
FloorOutline outline;