Make kinematic bodies properly wake up dynamic bodies.

This commit is contained in:
Crozet Sébastien
2020-09-21 10:43:20 +02:00
parent e16b7722be
commit 7b8e322446
9 changed files with 168 additions and 54 deletions

View File

@@ -64,7 +64,13 @@ pub fn init_world(testbed: &mut Testbed) {
/*
* Setup a callback to control the platform.
*/
let mut count = 0;
testbed.add_callback(move |_, physics, _, _, time| {
count += 1;
if count % 100 > 50 {
return;
}
if let Some(mut platform) = physics.bodies.get_mut(platform_handle) {
let mut next_pos = platform.position;