I wanted to try the amethyst_physics
library to make a game. (Duh)
I followed to Example, but somhow I does not work:
use amethyst::GameDataBuilder;
use amethyst_physics::{PhysicsBundle};
use amethyst_nphysics::NPhysicsBackend;
fn main() -> amethyst::Result<()> {
amethyst::start_logger(Default::default());
let game_data = GameDataBuilder::default()
.with_bundle(
PhysicsBundle::<f32, NPhysicsBackend>::new()
)
;
Ok(())
}
Error:
the trait bound `amethyst_physics::PhysicsBundle<'_, '_, f32, amethyst_nphysics::NPhysicsBackend>: amethyst::amethyst_core::SystemBundle<'_, '_>` is not satisfied
the trait `amethyst::amethyst_core::SystemBundle<'_, '_>` is not implemented for `amethyst_physics::PhysicsBundle<'_, '_, f32, amethyst_nphysics::NPhysicsBackend>`
Here is the example.
What am I doing wrong?
This appears to be a bug. It compiles successfully using amethyst
version 0.15.1 but not 0.15.3. A regression like this is not expected during a patch change.
amethyst
uses amethyst_core
version 0.15.3 (where SystemBundle
is defined) but amethyst_physics
uses amethyst_core
version 0.10.1.
I've filed an issue on the amethyst repository.
Use this as a workaround:
amethyst = { version = ">=0.15.0, <0.15.3", features = ["empty"] }