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:
@@ -25,6 +25,7 @@ namespace Ray3D {
|
||||
DOOR,
|
||||
WALL,
|
||||
WINDOW,
|
||||
OBJECT,
|
||||
};
|
||||
|
||||
Type type;
|
||||
@@ -37,6 +38,27 @@ namespace Ray3D {
|
||||
/** ctor */
|
||||
Obstacle3D(Type type, Floorplan::Material mat) : type(type), mat(mat) {;}
|
||||
|
||||
|
||||
/** translated copy */
|
||||
Obstacle3D translated(const Point3 pos) const {
|
||||
Obstacle3D copy = *this;
|
||||
for (Triangle3& tria : copy.triangles) {
|
||||
tria += pos;
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
/** rotated [around (0,0,0)] copy */
|
||||
Obstacle3D rotated_deg(const Point3 rot) const {
|
||||
Obstacle3D copy = *this;
|
||||
for (Triangle3& tria : copy.triangles) {
|
||||
tria.p1 = tria.p1.rot(rot.x/180.0f*M_PI, rot.y/180.0f*M_PI, rot.z/180.0f*M_PI);
|
||||
tria.p2 = tria.p2.rot(rot.x/180.0f*M_PI, rot.y/180.0f*M_PI, rot.z/180.0f*M_PI);
|
||||
tria.p3 = tria.p3.rot(rot.x/180.0f*M_PI, rot.y/180.0f*M_PI, rot.z/180.0f*M_PI);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user