Joint API and joint motors improvements

This commit is contained in:
Sébastien Crozet
2022-02-20 12:55:00 +01:00
committed by Sébastien Crozet
parent e740493b98
commit fb20d72ee2
108 changed files with 2650 additions and 1854 deletions

View File

@@ -16,11 +16,9 @@ pub fn init_world(testbed: &mut Testbed) {
let ground_size = 100.1;
let ground_height = 0.1;
let rigid_body = RigidBodyBuilder::new_static()
.translation(vector![0.0, -ground_height, 0.0])
.build();
let rigid_body = RigidBodyBuilder::new_static().translation(vector![0.0, -ground_height, 0.0]);
let handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size).build();
let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size);
colliders.insert_with_parent(collider, handle, &mut bodies);
/*
@@ -50,8 +48,7 @@ pub fn init_world(testbed: &mut Testbed) {
let rigid_body = RigidBodyBuilder::new_dynamic()
.translation(vector![x, y, z])
.linvel(vector![0.0, -1000.0, 0.0])
.ccd_enabled(true)
.build();
.ccd_enabled(true);
let handle = bodies.insert(rigid_body);
let collider = match j % 5 {
@@ -64,7 +61,7 @@ pub fn init_world(testbed: &mut Testbed) {
_ => ColliderBuilder::capsule_y(rad, rad),
};
colliders.insert_with_parent(collider.build(), handle, &mut bodies);
colliders.insert_with_parent(collider, handle, &mut bodies);
}
}