-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrong Z check in OgreWideAngleCamera::Project3d #746
Fix wrong Z check in OgreWideAngleCamera::Project3d #746
Conversation
The matrix returned by Ogre::Camera::getProjectionMatrix has Z in range [-1; 1], not range [0; 1] This means we can't do pos.z > 0. We must do pos.z / pos.w > -1 Additionally, we must check against against z < 1; otherwise the point may get picked by the wrong face (and fail tests). Signed-off-by: Matias N. Goldberg <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #746 +/- ##
=======================================
Coverage 74.07% 74.07%
=======================================
Files 159 159
Lines 14408 14408
=======================================
Hits 10673 10673
Misses 3735 3735 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I turned this PR into a draft because I discovered a better solution, as the current one has an undesired behavior I discovered while dealing with lens flare. |
This plays better with the far plane, while still playing fair with the near plane. Signed-off-by: Matias N. Goldberg <[email protected]>
OK I fixed the issue. It's ready now for review and merge |
New failure in Windows is unrelated to this changeset. |
@sanjuksha @scpeters, you may be interested in this change for gazebo-classic |
🦟 Bug fix
There is no ticket assigned to this bug
Summary
The matrix returned by Ogre::Camera::getProjectionMatrix has Z in range [-1; 1], not range [0; 1]
This means we can't do pos.z > 0. We must do pos.z / pos.w > -1 Additionally, we must check against against z < 1; otherwise the point may get picked by the wrong face (and fail tests).
I found this bug while porting OgreWideAngleCamera to ogre2
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.