Move benchmark demos into their own directory.

This commit is contained in:
Sébastien Crozet
2020-09-06 12:16:09 +02:00
parent 3080c6e7d2
commit ff2da7fb27
44 changed files with 897 additions and 148 deletions

View File

@@ -27,9 +27,8 @@ fn create_tower_circle(
// Build the rigid body.
let rigid_body = RigidBodyBuilder::new_dynamic().position(pos).build();
let handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z)
.density(1.0)
.build();
let collider =
ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z).build();
colliders.insert(collider, handle, bodies);
}
}
@@ -55,9 +54,8 @@ fn create_wall(
// Build the rigid body.
let rigid_body = RigidBodyBuilder::new_dynamic().translation(x, y, z).build();
let handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z)
.density(1.0)
.build();
let collider =
ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z).build();
colliders.insert(collider, handle, bodies);
}
}
@@ -88,9 +86,7 @@ fn create_pyramid(
let rigid_body = RigidBodyBuilder::new_dynamic().translation(x, y, z).build();
let handle = bodies.insert(rigid_body);
let collider =
ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z)
.density(1.0)
.build();
ColliderBuilder::cuboid(half_extents.x, half_extents.y, half_extents.z).build();
colliders.insert(collider, handle, bodies);
}
}
@@ -124,27 +120,7 @@ pub fn init_world(testbed: &mut Testbed) {
let cube_size = 1.0;
let hext = Vector3::repeat(cube_size);
let bottomy = cube_size * 50.0;
create_pyramid(
&mut bodies,
&mut colliders,
Vector3::new(-110.0, bottomy, 0.0),
12,
hext,
);
create_pyramid(
&mut bodies,
&mut colliders,
Vector3::new(-80.0, bottomy, 0.0),
12,
hext,
);
create_pyramid(
&mut bodies,
&mut colliders,
Vector3::new(-50.0, bottomy, 0.0),
12,
hext,
);
create_pyramid(
&mut bodies,
&mut colliders,