refactoring/cleanups
This commit is contained in:
@@ -331,6 +331,8 @@ void MapView3D::draw() {
|
||||
|
||||
static RenderSettings rs = RenderSettings(new Shader(), this);
|
||||
|
||||
const Point3 c = center - floorplanRendererModel->getBBox().getCenter();
|
||||
|
||||
// view
|
||||
QMatrix4x4 V;
|
||||
|
||||
@@ -339,7 +341,7 @@ void MapView3D::draw() {
|
||||
V.rotate(rot.x, 1.0, 0.0, 0.0);
|
||||
V.rotate(rot.y, 0.0, 1.0, 0.0);
|
||||
V.rotate(rot.z, 0.0, 0.0, 1.0);
|
||||
V.translate(center.x, center.y, center.z);
|
||||
V.translate(c.x, c.y, c.z);
|
||||
|
||||
float farPlane = 200; // TODO
|
||||
|
||||
|
||||
@@ -70,6 +70,10 @@ Floorplan3D::FloorplanMesh& FloorplanRendererModel::getMesh() {
|
||||
return mesh;
|
||||
}
|
||||
|
||||
BBox3 FloorplanRendererModel::getBBox() const {
|
||||
return bbox;
|
||||
}
|
||||
|
||||
const RenderTriangle& FloorplanRendererModel::getTriaSolid() {
|
||||
return triaSolid;
|
||||
}
|
||||
@@ -106,6 +110,10 @@ void FloorplanRendererModel::rebuild(Floorplan::IndoorMap* im) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update bbox
|
||||
bbox = mesh.getBBox();
|
||||
|
||||
}
|
||||
catch(const std::exception& e) {
|
||||
std::cout << "Can't create 3D view. Failed to get mesh from model factory with error: '" << e.what() << "'" << std::endl;
|
||||
|
||||
@@ -19,6 +19,8 @@ private:
|
||||
RenderTriangle triaSolid;
|
||||
RenderTriangle triaTransp;
|
||||
|
||||
BBox3 bbox;
|
||||
|
||||
int getMaterial(const Floorplan3D::Obstacle3D& o) const;
|
||||
|
||||
|
||||
@@ -31,6 +33,8 @@ public:
|
||||
|
||||
Floorplan3D::FloorplanMesh& getMesh();
|
||||
|
||||
BBox3 getBBox() const;
|
||||
|
||||
const RenderTriangle& getTriaSolid();
|
||||
|
||||
const RenderTriangle& getTriaTransp();
|
||||
|
||||
Reference in New Issue
Block a user