worked on 3D display

some ui changes
refactoring
new icons
This commit is contained in:
2018-02-03 23:30:55 +01:00
parent e5e19779d5
commit 3b62f23c0e
21 changed files with 1054 additions and 765 deletions

View File

@@ -6,11 +6,10 @@
#include "misc/Cube.h"
#include "misc/Window.h"
#include "misc/Handrail.h"
#include "MV3DElement.h"
class MV3DElementFloorObstacleWall : public MV3DElement {
Floorplan::Floor* f;
@@ -52,9 +51,10 @@ protected:
const Point3 pos(cen2.x, cen2.y, atHeight + height/2);
// div by 2.01 to prevent overlapps and z-fi
const float sx = from.getDistance(to) / 2.02f;
const float sy = thickness_m / 2.02f;
const float sz = height / 2.02f; // prevent overlaps
const float div = 2.015f; // prevent overlaps
const float sx = from.getDistance(to) / div;
const float sy = thickness_m / div;
const float sz = height / div;
const Point3 size(sx, sy, sz);
const Point3 rot(0,0,deg);
@@ -72,71 +72,6 @@ protected:
};
struct Handrail : public Renderable3D {
Point2 from;
Point2 to;
float atHeight;
float height;
Handrail(const Point2 from, const Point2 to, float atHeight, float height) :
from(from), to(to), atHeight(atHeight), height(height) {;}
void render(const RenderSettings& rs) override {
float y1 = atHeight;
float y2 = atHeight + height;
// polygon edges
Point3 p1 = Point3(from.x, y1, from.y);
Point3 p2 = Point3(to.x, y1, to.y);
Point3 p3 = Point3(from.x, y2, from.y);
Point3 p4 = Point3(to.x, y2, to.y);
/*
TODO_GL
glDisable(GL_LIGHTING);
glBegin(GL_LINES);
glColor3f(0.9, 0.9, 0.9);
// top
glVertex3f(p3.x, p3.y, p3.z);
glVertex3f(p4.x, p4.y, p4.z);
// start bar
glVertex3f(p1.x, p1.y, p1.z);
glVertex3f(p3.x, p3.y, p3.z);
// end bar
glVertex3f(p2.x, p2.y, p2.z);
glVertex3f(p4.x, p4.y, p4.z);
glColor3f(0.6, 0.6, 0.6);
// intermediate bars
const Point3 d1 = p2-p1;
const Point3 d2 = p4-p3;
const int numBars = d2.length() / 1;
for (int i = 1; i < numBars; ++i) {
const Point3 s = p1 + d1 * i / numBars;
const Point3 e = p3 + d2 * i / numBars;
glVertex3f(s.x, s.y, s.z);
glVertex3f(e.x, e.y, e.z);
}
glEnd();
glEnable(GL_LIGHTING);
*/
}
};
/** repaint me */
void render(const RenderSettings& rs) override {