Add `avian3d` support
This PR adds support for avian3d via the avian feature. Here's a list of changes:
- Add a
controller_avianmodule andminimal_avianexample, feature gated behind theavianfeature. - Move the
controllertocontroller_rapierandminimalexample tominimal_rapierfeature gating them behind therapierfeature. - Add a
controllermodule that reexports both controller modules, so you can still import withuse bevy_fps_controller::controller::*
I think there is a bug with overhang_component in controller_avian, since edge fall prevention doesn't seem to be working 100% of the time -- I couldn't crack this unfortunately. My (minimal) testing has shown identical behavior otherwise.
I understand that this is a large diff, so if you'd like a different approach I'd be happy to comply.
Woah nice! I will take a look, thanks
Hey - mind rebasing?
Hey - mind rebasing?
Hey! I'll try to get around to this in the next few days :)
Thanks. I rebased and fixed up the compilation in the avian branch for my own testing.
It seems like it is a little bit choppy? Can you see this on your end?
Also - I think we should seek to minimize copy and paste by sharing common functions among both features that are the same.
i.e. fps_controller_look fps_controller_input FpsController, etc.
That way when we update, the pain is minimized.
I think there is a bug with overhang_component in controller_avian, since edge fall prevention doesn't seem to be working 100% of the time -- I couldn't crack this unfortunately. My (minimal) testing has shown identical behavior otherwise.
I am also seeing this too. Seems like this line is to blame:
// Make sure that this is actually a ledge, e.g. there is no ground in front of us
let cast = spatial_query.cast_ray(
future_position + Vec3::Y * 0.125,
Dir3::new_unchecked(-Vec3::Y),
0.375,
false,
&filter,
);
Sometimes I can get stuck on the ledge when crouching and can't move at all. I would expect the above to return Some, but it returns None instead. The ray origin and direction looked good, so I am confused.
Closing in favor of #53
Will come back to these other issues