src/gl/partrenderer.cpp

changeset 206
654661eab7f3
parent 205
1a4342d80de7
child 215
34c6e7bc4ee1
--- a/src/gl/partrenderer.cpp	Wed Jun 08 20:41:21 2022 +0300
+++ b/src/gl/partrenderer.cpp	Wed Jun 08 22:29:44 2022 +0300
@@ -55,9 +55,9 @@
 static QVector3D calcQVector3DFromQColor(const QColor& color)
 {
 	return {
-		toFloat(color.redF()),
-		toFloat(color.greenF()),
-		toFloat(color.blueF()),
+		float_cast(color.redF()),
+		float_cast(color.greenF()),
+		float_cast(color.blueF()),
 	};
 }
 
@@ -304,7 +304,7 @@
  * @param plane Plane to raycast against
  * @return world co-ordinates, or no value if the point is behind the camera.
  */
-std::optional<glm::vec3> PartRenderer::screenToModelCoordinates(const QPoint& point, const Plane& plane) const
+std::optional<glm::vec3> PartRenderer::screenToModelCoordinates(const QPointF& point, const Plane& plane) const
 {
 	const Line line = this->cameraLine(point);
 	std::optional<glm::vec3> result;
@@ -332,7 +332,7 @@
 	return toQPointF(glm::vec2{projected.x, this->height() - projected.y});
 }
 
-Line<3> PartRenderer::cameraLine(const QPoint& point) const
+Line<3> PartRenderer::cameraLine(const QPointF& point) const
 {
 	const glm::vec3 p1 = this->unproject({point.x(), point.y(), 0});
 	const glm::vec3 p2 = this->unproject({point.x(), point.y(), 1});

mercurial