Skip to content
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

Incorrect handling of cameras with custom viewports in the rapier backend. #212

Closed
TheRawMeatball opened this issue Jun 2, 2023 · 1 comment · Fixed by #216
Closed

Comments

@TheRawMeatball
Copy link
Contributor

In the rapier backend, the ray_from_screenspace function does not correctly translate coordinates in the target camera s screen space to its viewport space before mapping to a world-space ray, leading to incorrect results. This can be fixed by adapting the ray_from_screenspace function to be closer to Ray3d::from_screenspace from bevy_mod_raycast: https://docs.rs/bevy_mod_raycast/latest/src/bevy_mod_raycast/primitives.rs.html#240-262

@aevyrie
Copy link
Owner

aevyrie commented Jun 17, 2023

Can be fixed by using bevy's Camera::viewport_to_world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants