https://github.com/bevyengine/bevy/pull/8306 introduces consistent coordinates for every entity without .y flipping. The changes are not rolled out yet, but current main of bevy_mod_raycast is not working well with bevy's main. In attempt to fix this, I found a simple but questionable solution:
It seems that there's no reason not to utilize Camera::viewport_to_world() as it's available since https://github.com/bevyengine/bevy/commit/37860a09de897218e6698eaf16dcc7836525a9fb from v0.9.0. I propose to utilize Camera.viewport_to_world() under the hood of Ray3d::from_screenspace() as their purposes seems identical. Changes doesn't seem to break any examples functionality on my end
Summary
https://github.com/bevyengine/bevy/pull/8306 introduces consistent coordinates for every entity without
.y
flipping. The changes are not rolled out yet, but currentmain
ofbevy_mod_raycast
is not working well withbevy
'smain
. In attempt to fix this, I found a simple but questionable solution:https://github.com/aevyrie/bevy_mod_raycast/blob/bd84951952f58a36c8144725f6539e7b3f60ed0f/src/primitives.rs#L240-L262
is equal to
https://github.com/bevyengine/bevy/blob/585baf0a66b855cef1f0568a4af44b666cfee076/crates/bevy_render/src/camera/camera.rs#L250-L270
Solution
It seems that there's no reason not to utilize
Camera::viewport_to_world()
as it's available since https://github.com/bevyengine/bevy/commit/37860a09de897218e6698eaf16dcc7836525a9fb fromv0.9.0
. I propose to utilizeCamera.viewport_to_world()
under the hood ofRay3d::from_screenspace()
as their purposes seems identical. Changes doesn't seem to break anyexamples
functionality on my end