aboutsummaryrefslogtreecommitdiff
path: root/examples3d/fountain3.rs
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2021-05-16 17:49:20 +0200
committerCrozet Sébastien <developer@crozet.re>2021-05-16 17:49:20 +0200
commit1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9 (patch)
treeb3f2ccf2ee0490eb59e4b84223446aa494d18c94 /examples3d/fountain3.rs
parentf350ac35d9889085af3f51a1894e2cc87173cb98 (diff)
downloadrapier-1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9.tar.gz
rapier-1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9.tar.bz2
rapier-1a84bf2af34176508bdda8d0f2ad2e46dc5c4df9.zip
Replace Kiss3d by Bevy for the testbed renderer.
Diffstat (limited to 'examples3d/fountain3.rs')
-rw-r--r--examples3d/fountain3.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/examples3d/fountain3.rs b/examples3d/fountain3.rs
index 08e1dfe..0d228c7 100644
--- a/examples3d/fountain3.rs
+++ b/examples3d/fountain3.rs
@@ -25,7 +25,7 @@ pub fn init_world(testbed: &mut Testbed) {
colliders.insert(collider, handle, &mut bodies);
// Callback that will be executed on the main loop to handle proximities.
- testbed.add_callback(move |mut window, mut graphics, physics, _, run_state| {
+ testbed.add_callback(move |mut graphics, physics, _, run_state| {
let rigid_body = RigidBodyBuilder::new_dynamic()
.translation(0.0, 10.0, 0.0)
.build();
@@ -40,8 +40,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);
}
if physics.bodies.len() > MAX_NUMBER_OF_BODIES {
@@ -68,8 +68,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);
}
}
}
@@ -85,8 +85,3 @@ pub fn init_world(testbed: &mut Testbed) {
// .velocity_based_erp = 0.2;
testbed.look_at(Point3::new(-30.0, 4.0, -30.0), Point3::new(0.0, 1.0, 0.0));
}
-
-fn main() {
- let testbed = Testbed::from_builders(0, vec![("Add-remove", init_world)]);
- testbed.run()
-}