Add explicit wake_up parameter to method setting the position and velocity of a rigid-body.

This commit is contained in:
Crozet Sébastien
2020-11-19 18:09:55 +01:00
parent 49fd861083
commit 5ce3606582
14 changed files with 154 additions and 48 deletions

View File

@@ -24,7 +24,7 @@ pub fn init_world(testbed: &mut Testbed) {
let to_remove: Vec<_> = physics
.bodies
.iter()
.filter(|(_, b)| b.position.translation.vector.y < -10.0)
.filter(|(_, b)| b.position().translation.vector.y < -10.0)
.map(|e| e.0)
.collect();
for handle in to_remove {

View File

@@ -62,7 +62,7 @@ pub fn init_world(testbed: &mut Testbed) {
*/
testbed.add_callback(move |_, physics, _, _, time| {
let mut platform = physics.bodies.get_mut(platform_handle).unwrap();
let mut next_pos = platform.position;
let mut next_pos = *platform.position();
let dt = 0.016;
next_pos.translation.vector.y += (time * 5.0).sin() * dt;