worked on 3d models within map

adjusted grid factory
adjusted nav mesh factory
minoor changes/fixes
new helper classes
refactoring
This commit is contained in:
2018-04-03 14:55:59 +02:00
parent f3b6155157
commit 1c2081d406
25 changed files with 620 additions and 93 deletions

View File

@@ -740,14 +740,11 @@ namespace NM {
Floorplan::Polygon2 res;
std::vector<Point2> src;
Ray3D::Obstacle3D obs = Ray3D::OBJPool::get().getObject(obj->file).rotated_deg(obj->rot).translated(obj->pos);
for (const Triangle3& tria : obs.triangles) {
src.push_back(tria.p1.xy());
src.push_back(tria.p2.xy());
src.push_back(tria.p3.xy());
}
res.points = ConvexHull2::get(src);
// fetch object from pool
const Ray3D::Obstacle3D obs = Ray3D::OBJPool::get().getObject(obj->file).rotated_deg(obj->rot).translated(obj->pos);
// construct 2D convex hull
res.points = ConvexHull2::get(obs.getPoints2D());
return res;
}