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

Update to Bevy 0.10 #72

Closed soerenmeier closed 1 year ago

soerenmeier commented 1 year ago

I think everything should be working as in the previous version but I haven't used this crate myself.

faulesocke commented 1 year ago

You've added windows line endings. You should probably check your git configuration.

soerenmeier commented 1 year ago

Since the last force push they should be gone. Some bug with sublime merge.

faulesocke commented 1 year ago

Ah interesting, I got fooled by git. All files are with Windows line-endings but git show only shows them in the lines that were added, not in removed or untouched lines.

Also played around with the module a bit and it seems to work just fine with 0.10!

dimvoly commented 1 year ago

In lib.rs on lines 410 and 412, you'd want to cover the case where the entity is visible, but visibility is not inherited:

if let RaycastMethod::Screenspace(_) = pick_source.cast_method {
        (visibility == Visibility::Inherited && comp_visibility.is_visible())
        ||
        (visibility == Visibility::Visible && comp_visibility.is_visible())
    } else {
        visibility == Visibility::Inherited
        ||
        visibility == Visibility::Visible
};

As it is now, it's possible to end up with visible entities that you don't raycast to (and therefore can't pick via bevy_mod_picking in my use case).

soerenmeier commented 1 year ago

You're right, I wen't with the migration guide but it makes more sense, to take into account Visibility::Visible. I took the liberty to remove manually checking Visibility since that is already done in the visibility_propagate_system of bevy and now rely on ComputedVisibility.

luke-biel commented 1 year ago

@aevyrie any chance this gets merged?

aevyrie commented 1 year ago

Thanks @soerenmeier for your effort here, and everyone else for your patience. ❤️