Replace Kiss3d by Bevy for the testbed renderer.

This commit is contained in:
Crozet Sébastien
2021-05-16 17:49:20 +02:00
parent f350ac35d9
commit 1a84bf2af3
88 changed files with 2327 additions and 3940 deletions

View File

@@ -10,7 +10,7 @@ pub fn init_world(testbed: &mut Testbed) {
let rad = 0.5;
// Callback that will be executed on the main loop to handle proximities.
testbed.add_callback(move |mut window, mut graphics, physics, _, _| {
testbed.add_callback(move |mut graphics, physics, _, _| {
let rigid_body = RigidBodyBuilder::new_dynamic()
.translation(0.0, 10.0)
.build();
@@ -20,8 +20,8 @@ pub fn init_world(testbed: &mut Testbed) {
.colliders
.insert(collider, handle, &mut physics.bodies);
if let (Some(graphics), Some(window)) = (&mut graphics, &mut window) {
graphics.add(*window, handle, &physics.bodies, &physics.colliders);
if let Some(graphics) = &mut graphics {
graphics.add_body(handle, &physics.bodies, &physics.colliders);
}
let to_remove: Vec<_> = physics
@@ -38,8 +38,8 @@ pub fn init_world(testbed: &mut Testbed) {
&mut physics.joints,
);
if let (Some(graphics), Some(window)) = (&mut graphics, &mut window) {
graphics.remove_body_nodes(*window, handle);
if let Some(graphics) = &mut graphics {
graphics.remove_body(handle);
}
}
});
@@ -50,8 +50,3 @@ pub fn init_world(testbed: &mut Testbed) {
testbed.set_world(bodies, colliders, joints);
testbed.look_at(Point2::new(0.0, 0.0), 20.0);
}
fn main() {
let testbed = Testbed::from_builders(0, vec![("Add-remove", init_world)]);
testbed.run()
}