src/gl/partrenderer.cpp

changeset 201
5d201ee4a9c3
parent 200
ca23936b455b
child 205
1a4342d80de7
--- a/src/gl/partrenderer.cpp	Mon Jun 06 22:01:22 2022 +0300
+++ b/src/gl/partrenderer.cpp	Tue Jun 07 01:37:26 2022 +0300
@@ -304,11 +304,11 @@
  * @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 geom::Plane& plane) const
+std::optional<glm::vec3> PartRenderer::screenToModelCoordinates(const QPoint& point, const Plane& plane) const
 {
-	const geom::Line line = this->cameraLine(point);
+	const Line line = this->cameraLine(point);
 	std::optional<glm::vec3> result;
-	result = geom::linePlaneIntersection(line, plane, 0.01f);
+	result = linePlaneIntersection(line, plane, 0.01f);
 	// If the point lies behind the camera, do not return a result.
 	if (result.has_value() and glm::dot(line.direction, *result - line.anchor) < 0)
 	{
@@ -332,11 +332,11 @@
 	return toQPointF(glm::vec2{projected.x, this->height() - projected.y});
 }
 
-geom::Line<3> PartRenderer::cameraLine(const QPoint& point) const
+Line<3> PartRenderer::cameraLine(const QPoint& point) const
 {
 	const glm::vec3 p1 = this->unproject({point.x(), point.y(), 0});
 	const glm::vec3 p2 = this->unproject({point.x(), point.y(), 1});
-	return geom::lineFromPoints(p1, p2);
+	return lineFromPoints(p1, p2);
 }
 
 /**

mercurial