Move 2D benchmarks into their own directory/crate.

This commit is contained in:
Crozet Sébastien
2020-09-28 10:19:49 +02:00
parent 0829ed10ac
commit e7466e2f69
16 changed files with 256 additions and 30 deletions

View File

@@ -19,8 +19,8 @@ pub fn init_world(testbed: &mut Testbed) {
// in order to be able to compare rapier with Box2D,
// we set it to 0.4.
let rad = 0.4;
let numi = 100; // Num vertical nodes.
let numk = 100; // Num horizontal nodes.
let numi = 10; // Num vertical nodes.
let numk = 10; // Num horizontal nodes.
let shift = 1.0;
let mut body_handles = Vec::new();
@@ -30,7 +30,7 @@ pub fn init_world(testbed: &mut Testbed) {
let fk = k as f32;
let fi = i as f32;
let status = if i == 0 && (k % 4 == 0 || k == numk - 1) {
let status = if i == 0 && k == 0 {
BodyStatus::Static
} else {
BodyStatus::Dynamic
@@ -66,7 +66,7 @@ pub fn init_world(testbed: &mut Testbed) {
* Set up the testbed.
*/
testbed.set_world(bodies, colliders, joints);
testbed.look_at(Point2::new(numk as f32 * rad, numi as f32 * -rad), 5.0);
testbed.look_at(Point2::new(numk as f32 * rad, numi as f32 * -rad), 20.0);
}
fn main() {