src/vertex.h

changeset 5
593a658cba8e
parent 3
55a55a9ec2c2
child 6
73e448b2943d
--- a/src/vertex.h	Mon Sep 23 14:06:36 2019 +0300
+++ b/src/vertex.h	Thu Oct 03 11:45:44 2019 +0300
@@ -23,22 +23,23 @@
 
 struct Vertex
 {
-	qreal x;
-	qreal y;
-	qreal z;
+	using ValueType = float;
+	ValueType x;
+	ValueType y;
+	ValueType z;
 	// void transform(const class Matrix& matrix, const Vertex& pos);
 	Vertex transformed(const GLRotationMatrix& matrix) const;
-	void setCoordinate(Axis ax, qreal value);
+	void setCoordinate(Axis ax, ValueType value);
 	Vertex& operator+=(const QVector3D& other);
 	Vertex operator+(const QVector3D& other) const;
 	QVector3D operator-(const Vertex& other) const;
 	Vertex operator-(const QVector3D& vector) const;
 	Vertex& operator-=(const QVector3D& vector);
-	Vertex& operator*=(qreal scalar);
-	Vertex operator*(qreal scalar) const;
+	Vertex& operator*=(ValueType scalar);
+	Vertex operator*(ValueType scalar) const;
 	bool operator<(const Vertex& other) const;
-	double& operator[](Axis ax);
-	double operator[](Axis ax) const;
+	ValueType& operator[](Axis ax);
+	ValueType operator[](Axis ax) const;
 	bool operator==(const Vertex& other) const;
 	bool operator!=(const Vertex& other) const;
 	operator QVariant() const;

mercurial