Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(rapier) reproduction for issue 666: friction not applied #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions examples3d/debug_boxes3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,31 @@ pub fn init_world(testbed: &mut Testbed) {
let ground_size = 100.1;
let ground_height = 0.1;

for _ in 0..6 {
let rigid_body = RigidBodyBuilder::fixed().translation(vector![0.0, -ground_height, 0.0]);
let handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::cuboid(ground_size, ground_height, ground_size);
colliders.insert_with_parent(collider, handle, &mut bodies);
}
let ground_height = 0.1;
colliders.insert_with_parent(
ColliderBuilder::cuboid(100.1, ground_height, 100.1).friction(0.5),
bodies.insert(RigidBodyBuilder::fixed().translation(vector![0.0, -ground_height, 0.0])),
&mut bodies,
);

let (collider_mass, rigidbody_additional_mass) = (0.0, 0.5);

// NOTE: #666: uncomment this to test "expected" behaviour.
//let (collider_mass, rigidbody_additional_mass) = (0.5, 0.0);

// Build the dynamic box rigid body.
for _ in 0..2 {
let rigid_body = RigidBodyBuilder::dynamic()
.translation(vector![1.1, 0.0, 0.0])
// .rotation(vector![0.8, 0.2, 0.1])
.can_sleep(false);
let handle = bodies.insert(rigid_body);
let collider = ColliderBuilder::cuboid(2.0, 0.1, 1.0);
colliders.insert_with_parent(collider, handle, &mut bodies);
}
colliders.insert_with_parent(
ColliderBuilder::cuboid(0.2, 5., 1.5)
.friction(0.5)
.mass(collider_mass),
bodies.insert(
RigidBodyBuilder::dynamic()
.additional_mass(rigidbody_additional_mass)
.translation(vector![-10., 6.0, 0.0])
.linvel(vector![20., 0., 0.])
.can_sleep(false),
),
&mut bodies,
);

/*
* Set up the testbed.
Expand Down
Loading