Remove useless if.

This commit is contained in:
Maxime Gimeno 2021-02-16 08:57:47 +01:00
parent 4a6aa7e024
commit 0010df67e6
1 changed files with 0 additions and 3 deletions

View File

@ -885,11 +885,8 @@ CGAL_INLINE_FUNCTION
Vec Camera::pointUnderPixel(const QPoint &pixel, bool &found) const { Vec Camera::pointUnderPixel(const QPoint &pixel, bool &found) const {
float depth = 2.0; float depth = 2.0;
// Qt uses upper corner for its origin while GL uses the lower corner. // Qt uses upper corner for its origin while GL uses the lower corner.
if(parent())
{
dynamic_cast<QOpenGLFunctions*>(parent())->glReadPixels(pixel.x(), screenHeight() - 1 - pixel.y(), 1, 1, dynamic_cast<QOpenGLFunctions*>(parent())->glReadPixels(pixel.x(), screenHeight() - 1 - pixel.y(), 1, 1,
GL_DEPTH_COMPONENT, GL_FLOAT, &depth); GL_DEPTH_COMPONENT, GL_FLOAT, &depth);
}
found = depth < 1.0; found = depth < 1.0;
Vec point(pixel.x(), pixel.y(), depth); Vec point(pixel.x(), pixel.y(), depth);
point = unprojectedCoordinatesOf(point); point = unprojectedCoordinatesOf(point);