aboutsummaryrefslogtreecommitdiff
path: root/examples3d/ccd3.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/ccd3.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/ccd3.rs')
-rw-r--r--examples3d/ccd3.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/examples3d/ccd3.rs b/examples3d/ccd3.rs
index f6b558d..e5dee33 100644
--- a/examples3d/ccd3.rs
+++ b/examples3d/ccd3.rs
@@ -30,9 +30,15 @@ fn create_wall(
colliders.insert(collider, handle, bodies);
k += 1;
if k % 2 == 0 {
- testbed.set_body_color(handle, Point3::new(255. / 255., 131. / 255., 244.0 / 255.));
+ testbed.set_initial_body_color(
+ handle,
+ Point3::new(255. / 255., 131. / 255., 244.0 / 255.),
+ );
} else {
- testbed.set_body_color(handle, Point3::new(131. / 255., 255. / 255., 244.0 / 255.));
+ testbed.set_initial_body_color(
+ handle,
+ Point3::new(131. / 255., 255. / 255., 244.0 / 255.),
+ );
}
}
}
@@ -114,10 +120,10 @@ pub fn init_world(testbed: &mut Testbed) {
.build();
let handle = bodies.insert(rigid_body);
colliders.insert(collider.clone(), handle, &mut bodies);
- testbed.set_body_color(handle, Point3::new(0.2, 0.2, 1.0));
+ testbed.set_initial_body_color(handle, Point3::new(0.2, 0.2, 1.0));
// Callback that will be executed on the main loop to handle proximities.
- testbed.add_callback(move |_, mut graphics, physics, events, _| {
+ testbed.add_callback(move |mut graphics, physics, events, _| {
while let Ok(prox) = events.intersection_events.try_recv() {
let color = if prox.intersecting {
Point3::new(1.0, 1.0, 0.0)
@@ -145,8 +151,3 @@ pub fn init_world(testbed: &mut Testbed) {
testbed.set_world(bodies, colliders, joints);
testbed.look_at(Point3::new(100.0, 100.0, 100.0), Point3::origin());
}
-
-fn main() {
- let testbed = Testbed::from_builders(0, vec![("Boxes", init_world)]);
- testbed.run()
-}