--- a/src/gl/common.h Sun Jan 26 01:06:27 2020 +0200 +++ b/src/gl/common.h Sun Jan 26 14:29:30 2020 +0200 @@ -22,7 +22,6 @@ #include <QGenericMatrix> #include "basics.h" #include "colors.h" -#include "vertex.h" namespace gl { @@ -33,13 +32,7 @@ static const QMatrix4x4 bottomCameraMatrix = {1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1}; static const QMatrix4x4 backCameraMatrix = {-1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1}; static const QMatrix4x4 rightCameraMatrix = {0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1}; - - // Conversion matrix from LDraw to OpenGL coordinates. - static const QMatrix4x4 ldrawToGL = {1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1}; - static constexpr QRgb BlackRgb = 0xff000000; - static constexpr GLfloat near = 1.0f; - static constexpr GLfloat far = 10000.0f; struct Polygon; } @@ -53,7 +46,7 @@ ConditionalEdge }; Type type; - Point3D vertices[4]; + glm::vec3 vertices[4]; Color color; linetypes::Id id; @@ -91,15 +84,15 @@ namespace gl { - inline Polygon edgeLine(const Point3D& v_1, const Point3D& v_2, Color color, linetypes::Id id) + inline Polygon edgeLine(const glm::vec3& v_1, const glm::vec3& v_2, Color color, linetypes::Id id) { return {Polygon::EdgeLine, {v_1, v_2}, color, id}; } inline Polygon triangle( - const Point3D& v_1, - const Point3D& v_2, - const Point3D& v_3, + const glm::vec3& v_1, + const glm::vec3& v_2, + const glm::vec3& v_3, Color color, linetypes::Id id) { @@ -107,10 +100,10 @@ } inline Polygon quadrilateral( - const Point3D& v_1, - const Point3D& v_2, - const Point3D& v_3, - const Point3D& v_4, + const glm::vec3& v_1, + const glm::vec3& v_2, + const glm::vec3& v_3, + const glm::vec3& v_4, Color color, linetypes::Id id) { @@ -118,10 +111,10 @@ } inline Polygon conditionalEdge( - const Point3D& v_1, - const Point3D& v_2, - const Point3D& control_1, - const Point3D& control_2, + const glm::vec3& v_1, + const glm::vec3& v_2, + const glm::vec3& control_1, + const glm::vec3& control_2, Color color, linetypes::Id id) {