idanarye / bevy-tnua

A floating character controller for Bevy
https://crates.io/crates/bevy-tnua
Apache License 2.0
180 stars 12 forks source link

Drafting xpbd f64 support #47

Closed vpochapuis closed 4 months ago

vpochapuis commented 4 months ago

Hello!

What

This is a little draft of support for xpbd f64 precision. I would need some help to make sure its coherent as I am not very well versed in this kind of crates.

Resolves #46

How

To enable the feature one need to use

bevy-tnua = {version = "0.15.0", default-features = false, features = ["f64"]} bevy-tnua-xpbd2d = {version = "0.2.0", default-features = false, features = ["f64"]}

Known issues

Testing with

cargo test --no-default-features --features f64

doesn't work as I can't figure out why the dev-dependencies is not taking in account the default-features = false and importing parry in both f32 and f64.

However the crate works as intended when imported in another project.

Notes

The math module is basically the same as the one in xpbd, but i thought that since xpbd isn't a dependency when using rapier, might not be great to rely on it directly? I am not sure.

vpochapuis commented 4 months ago

Hello, For the Ci Docs not passing, it seems --all-features doesn't work. As the feature model is similar as the one used in bevy-xpbd the only way to be able to use it would be either using default feature or disabling default and using the f64 one: https://github.com/Jondolf/bevy_xpbd/blob/main/.github/workflows/ci.yml. I am not sure whether its a good practice or not, I am very eager to have your feedback thank you!

idanarye commented 4 months ago

We don't really need the --all-features because Tnua does not use features, so it should be fine.