cargo fmt
This commit is contained in:
@@ -60,7 +60,9 @@ pub fn init_world(testbed: &mut Testbed) {
|
|||||||
/*
|
/*
|
||||||
* Setup a callback to control the platform.
|
* Setup a callback to control the platform.
|
||||||
*/
|
*/
|
||||||
testbed.harness_mut().add_callback(move |physics, _, run_state, _| {
|
testbed
|
||||||
|
.harness_mut()
|
||||||
|
.add_callback(move |physics, _, run_state, _| {
|
||||||
let platform = physics.bodies.get_mut(platform_handle).unwrap();
|
let platform = physics.bodies.get_mut(platform_handle).unwrap();
|
||||||
let mut next_pos = *platform.position();
|
let mut next_pos = *platform.position();
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,9 @@ pub fn init_world(testbed: &mut Testbed) {
|
|||||||
testbed.set_body_color(sensor_handle, Point3::new(0.5, 1.0, 1.0));
|
testbed.set_body_color(sensor_handle, Point3::new(0.5, 1.0, 1.0));
|
||||||
|
|
||||||
// Callback that will be executed on the main loop to handle proximities.
|
// Callback that will be executed on the main loop to handle proximities.
|
||||||
testbed.harness_mut().add_callback(move |physics, events, _, _| {
|
testbed
|
||||||
|
.harness_mut()
|
||||||
|
.add_callback(move |physics, events, _, _| {
|
||||||
while let Ok(prox) = events.proximity_events.try_recv() {
|
while let Ok(prox) = events.proximity_events.try_recv() {
|
||||||
let color = match prox.new_status {
|
let color = match prox.new_status {
|
||||||
Proximity::WithinMargin | Proximity::Intersecting => Point3::new(1.0, 1.0, 0.0),
|
Proximity::WithinMargin | Proximity::Intersecting => Point3::new(1.0, 1.0, 0.0),
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ pub fn init_world(testbed: &mut Testbed) {
|
|||||||
* Setup a callback to control the platform.
|
* Setup a callback to control the platform.
|
||||||
*/
|
*/
|
||||||
let mut count = 0;
|
let mut count = 0;
|
||||||
testbed.harness_mut().add_callback(move |physics, _, run_state, _| {
|
testbed
|
||||||
|
.harness_mut()
|
||||||
|
.add_callback(move |physics, _, run_state, _| {
|
||||||
count += 1;
|
count += 1;
|
||||||
if count % 100 > 50 {
|
if count % 100 > 50 {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -73,7 +73,9 @@ pub fn init_world(testbed: &mut Testbed) {
|
|||||||
testbed.set_body_color(sensor_handle, Point3::new(0.5, 1.0, 1.0));
|
testbed.set_body_color(sensor_handle, Point3::new(0.5, 1.0, 1.0));
|
||||||
|
|
||||||
// Callback that will be executed on the main loop to handle proximities.
|
// Callback that will be executed on the main loop to handle proximities.
|
||||||
testbed.harness_mut().add_callback(move |physics, events, _, _| {
|
testbed
|
||||||
|
.harness_mut()
|
||||||
|
.add_callback(move |physics, events, _, _| {
|
||||||
while let Ok(prox) = events.proximity_events.try_recv() {
|
while let Ok(prox) = events.proximity_events.try_recv() {
|
||||||
let color = match prox.new_status {
|
let color = match prox.new_status {
|
||||||
Proximity::WithinMargin | Proximity::Intersecting => Point3::new(1.0, 1.0, 0.0),
|
Proximity::WithinMargin | Proximity::Intersecting => Point3::new(1.0, 1.0, 0.0),
|
||||||
|
|||||||
Reference in New Issue
Block a user