aboutsummaryrefslogtreecommitdiff
path: root/examples2d/heightfield2.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2020-09-28 10:58:35 +0200
committerGitHub <noreply@github.com>2020-09-28 10:58:35 +0200
commit90dffc59ed45e5b95c2a40699cb91d285a206e0e (patch)
treefa25c9c94bf4cd18a84f1a8c2bea327cd875af5f /examples2d/heightfield2.rs
parent3080c6e7d2e7bad0ac55095ccc24b1ac8bd5449a (diff)
parente7466e2f6923d24e987a34f8ebaf839346af8d4e (diff)
downloadrapier-90dffc59ed45e5b95c2a40699cb91d285a206e0e.tar.gz
rapier-90dffc59ed45e5b95c2a40699cb91d285a206e0e.tar.bz2
rapier-90dffc59ed45e5b95c2a40699cb91d285a206e0e.zip
Merge pull request #20 from dimforge/benchbot
Split benchmarks from examples
Diffstat (limited to 'examples2d/heightfield2.rs')
-rw-r--r--examples2d/heightfield2.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples2d/heightfield2.rs b/examples2d/heightfield2.rs
index b03afe3..f5ddff9 100644
--- a/examples2d/heightfield2.rs
+++ b/examples2d/heightfield2.rs
@@ -19,7 +19,7 @@ pub fn init_world(testbed: &mut Testbed) {
let heights = DVector::from_fn(nsubdivs + 1, |i, _| {
if i == 0 || i == nsubdivs {
- 80.0
+ 8.0
} else {
(i as f32 * ground_size.x / (nsubdivs as f32)).cos() * 2.0
}
@@ -33,7 +33,7 @@ pub fn init_world(testbed: &mut Testbed) {
/*
* Create the cubes
*/
- let num = 26;
+ let num = 20;
let rad = 0.5;
let shift = rad * 2.0;
@@ -41,7 +41,7 @@ pub fn init_world(testbed: &mut Testbed) {
let centery = shift / 2.0;
for i in 0..num {
- for j in 0usize..num * 5 {
+ for j in 0usize..num {
let x = i as f32 * shift - centerx;
let y = j as f32 * shift + centery + 3.0;
@@ -50,10 +50,10 @@ pub fn init_world(testbed: &mut Testbed) {
let handle = bodies.insert(rigid_body);
if j % 2 == 0 {
- let collider = ColliderBuilder::cuboid(rad, rad).density(1.0).build();
+ let collider = ColliderBuilder::cuboid(rad, rad).build();
colliders.insert(collider, handle, &mut bodies);
} else {
- let collider = ColliderBuilder::ball(rad).density(1.0).build();
+ let collider = ColliderBuilder::ball(rad).build();
colliders.insert(collider, handle, &mut bodies);
}
}
@@ -63,7 +63,7 @@ pub fn init_world(testbed: &mut Testbed) {
* Set up the testbed.
*/
testbed.set_world(bodies, colliders, joints);
- testbed.look_at(Point2::new(0.0, 50.0), 10.0);
+ testbed.look_at(Point2::new(0.0, 0.0), 10.0);
}
fn main() {