aboutsummaryrefslogtreecommitdiff
path: root/examples2d/heightfield2.rs
diff options
context:
space:
mode:
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() {