dimforge / bevy_rapier

Official Rapier plugin for the Bevy game engine.
https://rapier.rs
Apache License 2.0
1.25k stars 260 forks source link

Compatibility with bevy .14 #546

Closed masonk closed 3 months ago

masonk commented 3 months ago

Sorry if I've missed it, but I cannot find a branch or tag that tracks a version of bevy_rapier which is compatible with bevy 0.14.0 release candidates.

I poked around and noticed that branch dependabot/cargo/rapier3d-0.21 depends on 0.14.0-rc3. I tried to switch to that branch in my own Cargo.toml:

bevy_rapier3d = {git = "https://github.com/dimforge/bevy_rapier.git", branch = "dependabot/cargo/rapier3d-0.21", features = [ "simd-stable", "debug-render-3d" ] }

But I can't even cargo check when I uncomment the line. I see a whole bunch of errors that look like rapier-internal issues with trait bounds:


error[E0277]: the trait bound `rapier::nalgebra::Matrix<f32, rapier::nalgebra::Const<3>, rapier::nalgebra::Const<1>, rapier::nalgebra::ArrayStorage<f32, 3, 1>>: From<Vec3>` is not satisfied
   --> C:\Users\mason\.cargo\git\checkouts\bevy_rapier-26af51cff3486e5b\bdace65\bevy_rapier3d\../src\geometry\collider_impl.rs:666:55
    |
666 |         let ray = Ray::new(ray_origin.into(), ray_dir.into());
    |                                                       ^^^^ the trait `From<Vec3>` is not implemented for `rapier::nalgebra::Matrix<f32, rapier::nalgebra::Const<3>, rapier::nalgebra::Const<1>, rapier::nalgebra::ArrayStorage<f32, 3, 1>>`, which is required by `Vec3: Into<_>`
    |
    = help: the following other types implement trait `From<T>`:
              <rapier::nalgebra::Matrix<T, <D as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, rapier::nalgebra::Const<1>, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<<D as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output>>::Buffer<T>> as From<rapier::nalgebra::OPoint<T, D>>>
              <rapier::nalgebra::Matrix<T, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<<rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output>>::Buffer<T>> as From<rapier::nalgebra::Isometry<T, R, D>>>
              <rapier::nalgebra::Matrix<T, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<<rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output>>::Buffer<T>> as From<rapier::nalgebra::Scale<T, D>>>
              <rapier::nalgebra::Matrix<T, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<<rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output>>::Buffer<T>> as From<rapier::nalgebra::Similarity<T, R, D>>>
              <rapier::nalgebra::Matrix<T, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<<rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output>>::Buffer<T>> as From<rapier::nalgebra::Transform<T, C, D>>>
              <rapier::nalgebra::Matrix<T, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<<rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output, <rapier::nalgebra::Const<D> as rapier::nalgebra::DimNameAdd<rapier::nalgebra::Const<1>>>::Output>>::Buffer<T>> as From<rapier::nalgebra::Translation<T, D>>>
              <rapier::nalgebra::Matrix<T, R, C, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<R, C>>::Buffer<T>> as From<[rapier::nalgebra::Matrix<<T as rapier::nalgebra::SimdValue>::Element, R, C, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<R, C>>::Buffer<<T as rapier::nalgebra::SimdValue>::Element>>; 16]>>
              <rapier::nalgebra::Matrix<T, R, C, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<R, C>>::Buffer<T>> as From<[rapier::nalgebra::Matrix<<T as rapier::nalgebra::SimdValue>::Element, R, C, <rapier::nalgebra::DefaultAllocator as rapier::nalgebra::allocator::Allocator<R, C>>::Buffer<<T as rapier::nalgebra::SimdValue>::Element>>; 2]>>
            and 30 others
    = note: required for `Vec3` to implement `Into<rapier::nalgebra::Matrix<f32, rapier::nalgebra::Const<3>, rapier::nalgebra::Const<1>, rapier::nalgebra::ArrayStorage<f32, 3, 1>>>`

If this branch is working for someone, then I have a suspicion that the patches.crates-io directives in the bevy_rapier workspace manifest are not applied. There are weirdnesses where Cargo's path based sources are resolved differently from its git-based sources.

masonk commented 3 months ago

I noticed that main is also on bevy rc 14. I think there's something else going on. I'll close and if necessary open a new issue that is better focused on the problem.