Skip to content

Commit

Permalink
Fix mouse picking on Mac OS
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanmunawar committed Jan 19, 2022
1 parent 5040eb8 commit e698f9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ambf_simulator/src/ambf_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,8 +1616,11 @@ cVector3d getRayTo(int x, int y, afCameraPtr a_cameraPtr)
cVector3d dVert = vertical * 1.f / height;

cVector3d rayTo = rayToCenter - 0.5f * hor + 0.5f * vertical;
rayTo += double(x) * dHor;
rayTo -= double(y) * dVert;

int windowW, windowH;
glfwGetWindowSize(a_cameraPtr->m_window, &windowW, &windowH);
rayTo += double(x) * dHor * width / windowW;
rayTo -= double(y) * dVert * height / windowH;

return rayTo;
}
Expand Down

0 comments on commit e698f9f

Please sign in to comment.