Implement interaction groups test mode and add the ClampedSum cofficient combine rule (#741)
This commit is contained in:
@@ -24,8 +24,10 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
/*
|
||||
* Setup groups
|
||||
*/
|
||||
const GREEN_GROUP: InteractionGroups = InteractionGroups::new(Group::GROUP_1, Group::GROUP_1);
|
||||
const BLUE_GROUP: InteractionGroups = InteractionGroups::new(Group::GROUP_2, Group::GROUP_2);
|
||||
const GREEN_GROUP: InteractionGroups =
|
||||
InteractionGroups::new(Group::GROUP_1, Group::GROUP_1, InteractionTestMode::And);
|
||||
const BLUE_GROUP: InteractionGroups =
|
||||
InteractionGroups::new(Group::GROUP_2, Group::GROUP_2, InteractionTestMode::And);
|
||||
|
||||
/*
|
||||
* A green floor that will collide with the GREEN group only.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user