Add explicit wake_up parameter to method setting the position and velocity of a rigid-body.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user