remove redundant time :f32 from harness callbacks. it can be access via run_state.time
This commit is contained in:
@@ -34,7 +34,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let collider = ColliderBuilder::ball(ball_rad).density(100.0).build();
|
||||
colliders.insert(collider, ball_handle, &mut bodies);
|
||||
|
||||
testbed.harness_mut().add_callback(move |physics, _, _, _| {
|
||||
testbed.harness_mut().add_callback(move |physics, _, _| {
|
||||
// Remove then re-add the ground collider.
|
||||
let coll = physics
|
||||
.colliders
|
||||
|
||||
@@ -45,7 +45,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let mut extra_colliders = Vec::new();
|
||||
let snapped_frame = 51;
|
||||
|
||||
testbed.harness_mut().add_callback(move |physics, _, _, _| {
|
||||
testbed.harness_mut().add_callback(move |physics, _, _| {
|
||||
step += 1;
|
||||
|
||||
// Add a bigger ball collider
|
||||
|
||||
@@ -44,7 +44,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let mut step = 0;
|
||||
let snapped_frame = 51;
|
||||
|
||||
testbed.harness_mut().add_callback(move |physics, _, _, _| {
|
||||
testbed.harness_mut().add_callback(move |physics, _, _| {
|
||||
step += 1;
|
||||
|
||||
// Snap the ball velocity or restore it.
|
||||
|
||||
@@ -26,7 +26,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let mut k = 0;
|
||||
|
||||
// Callback that will be executed on the main loop to handle proximities.
|
||||
testbed.harness_mut().add_callback(move |physics, _, _, _| {
|
||||
testbed.harness_mut().add_callback(move |physics, _, _| {
|
||||
k += 1;
|
||||
let rigid_body = RigidBodyBuilder::new_dynamic()
|
||||
.translation(0.0, 10.0, 0.0)
|
||||
|
||||
@@ -67,7 +67,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let mut count = 0;
|
||||
testbed
|
||||
.harness_mut()
|
||||
.add_callback(move |physics, _, run_state, _| {
|
||||
.add_callback(move |physics, _, run_state| {
|
||||
count += 1;
|
||||
if count % 100 > 50 {
|
||||
return;
|
||||
|
||||
@@ -75,7 +75,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
// Callback that will be executed on the main loop to handle proximities.
|
||||
testbed
|
||||
.harness_mut()
|
||||
.add_callback(move |physics, events, _, _| {
|
||||
.add_callback(move |physics, events, _| {
|
||||
while let Ok(prox) = events.proximity_events.try_recv() {
|
||||
let color = match prox.new_status {
|
||||
Proximity::WithinMargin | Proximity::Intersecting => Point3::new(1.0, 1.0, 0.0),
|
||||
|
||||
Reference in New Issue
Block a user