Implement interaction groups test mode and add the ClampedSum cofficient combine rule (#741)

This commit is contained in:
Dragos Daian
2025-10-30 11:51:22 +01:00
committed by GitHub
parent 36f91a6a07
commit 57c4e912a6
7 changed files with 108 additions and 22 deletions

View File

@@ -53,7 +53,11 @@ pub fn init_world(testbed: &mut Testbed) {
let body_co = ColliderBuilder::cuboid(0.65, 0.3, 0.9)
.density(100.0)
.collision_groups(InteractionGroups::new(CAR_GROUP, !CAR_GROUP));
.collision_groups(InteractionGroups::new(
CAR_GROUP,
!CAR_GROUP,
InteractionTestMode::And,
));
let body_rb = RigidBodyBuilder::dynamic()
.pose(body_position.into())
.build();
@@ -85,7 +89,11 @@ pub fn init_world(testbed: &mut Testbed) {
// is mathematically simpler than a cylinder and cheaper to compute for collision-detection.
let wheel_co = ColliderBuilder::ball(wheel_radius)
.density(100.0)
.collision_groups(InteractionGroups::new(CAR_GROUP, !CAR_GROUP))
.collision_groups(InteractionGroups::new(
CAR_GROUP,
!CAR_GROUP,
InteractionTestMode::And,
))
.friction(1.0);
let wheel_rb = RigidBodyBuilder::dynamic().pose(wheel_center.into());
let wheel_handle = bodies.insert(wheel_rb);