aevyrie / bevy_mod_raycast

A little mesh raycasting plugin for Bevy
https://crates.io/crates/bevy_mod_raycast
MIT License
320 stars 93 forks source link

Make Ray3d::from_screenspace start from the near plane #85

Closed bonsairobo closed 1 year ago

bonsairobo commented 1 year ago

I just made it closer to what bevy does. I think technically what bevy is doing is more correct, as it has the NDC coordinates of the ray origin starting exactly at the near plane (Z=1).

I ran the simplified_mesh example and it's still working as expected. If you print the calculated near and far coordinates for the ray, you'll see that this change makes the ray start at the world-space near plane (Z=-0.1).