improved 3d rendering, minor changes

added support for thick 3d walls
This commit is contained in:
2017-08-02 14:30:01 +02:00
parent 6f06984c4e
commit 29d5ce19ff
10 changed files with 234 additions and 18 deletions

View File

@@ -212,8 +212,21 @@ void MapView3D::draw() {
} else {
std::vector<MapModelElement*> elements = getModel()->getVisibleElements();
// order: transparent last
auto func = [] (const MapModelElement* e1, const MapModelElement* e2) {
if (e1->getMV3D() == nullptr) {return false;}
if (e2->getMV3D() == nullptr) {return true;}
const bool e1t = e1->getMV3D()->isTransparent();
const bool e2t = e2->getMV3D()->isTransparent();
return e1t < e2t;
};
std::sort(elements.begin(), elements.end(), func);
// show floorplan
for (MapModelElement* el : getModel()->getVisibleElements()) {
for (MapModelElement* el : elements) {
if (el->getMV3D()) {el->getMV3D()->paintGL();}
}