307 this->projectionMatrix, |
307 this->projectionMatrix, |
308 this->viewportVector); |
308 this->viewportVector); |
309 return toQPointF(glm::vec2{projected.x, this->height() - projected.y}); |
309 return toQPointF(glm::vec2{projected.x, this->height() - projected.y}); |
310 } |
310 } |
311 |
311 |
312 geom::Line PartRenderer::cameraLine(const QPoint& point) const |
312 geom::Line<3> PartRenderer::cameraLine(const QPoint& point) const |
313 { |
313 { |
314 const glm::vec3 p1 = this->unproject({point.x(), point.y(), 0}); |
314 const glm::vec3 p1 = this->unproject({point.x(), point.y(), 0}); |
315 const glm::vec3 p2 = this->unproject({point.x(), point.y(), 1}); |
315 const glm::vec3 p2 = this->unproject({point.x(), point.y(), 1}); |
316 return geom::lineFromPoints(p1, p2); |
316 return geom::lineFromPoints(p1, p2); |
317 } |
317 } |