From 9a2385155e1ecf2be010a6592822ff2924319fb8 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Thu, 20 Apr 2023 20:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AA=E7=90=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Difficult_Rocket_rs/src/src/simulator.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/Difficult_Rocket_rs/src/src/simulator.rs b/libs/Difficult_Rocket_rs/src/src/simulator.rs index 4ea605f..44d8281 100644 --- a/libs/Difficult_Rocket_rs/src/src/simulator.rs +++ b/libs/Difficult_Rocket_rs/src/src/simulator.rs @@ -17,7 +17,9 @@ pub fn simluation() -> PyResult<()> { /* Create the ground. */ let collider = ColliderBuilder::cuboid(100.0, 0.1).build(); + let ball = ColliderBuilder::ball(10).build(); collider_set.insert(collider); + collider_set.insert(ball); /* Create the bouncing ball. */ let rigid_body = RigidBodyBuilder::dynamic().translation(vector![0.0, 10.0]).build(); @@ -57,7 +59,7 @@ pub fn simluation() -> PyResult<()> { ); let ball_body = &rigid_body_set[ball_body_handle]; - println!("Ball altitude: {}", ball_body.translation().y); + println!("Ball altitude: {}", ball_body.translation()); } Ok(()) }