319 const glm::vec3 projected = glm::project( |
319 const glm::vec3 projected = glm::project( |
320 point, |
320 point, |
321 this->viewMatrix * glm::mat4_cast(this->modelQuaternion), |
321 this->viewMatrix * glm::mat4_cast(this->modelQuaternion), |
322 this->projectionMatrix, |
322 this->projectionMatrix, |
323 this->viewportVector); |
323 this->viewportVector); |
324 return {projected.x, this->height() - projected.y}; |
324 return toQPointF(glm::vec2{projected.x, this->height() - projected.y}); |
325 } |
325 } |
326 |
326 |
327 /** |
327 /** |
328 * @brief Unprojects the specified window coordinates to model coordinates |
328 * @brief Unprojects the specified window coordinates to model coordinates |
329 * @param win Window coordinates to project. Z-coordinate indicates depth |
329 * @param win Window coordinates to project. Z-coordinate indicates depth |