Skip to content

Commit

Permalink
fix capitalization of InteractionTestMode
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Jan 13, 2025
1 parent a29d80c commit 43c28fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples2d/collision_groups2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pub fn init_world(testbed: &mut Testbed) {
* Setup groups
*/
const GREEN_GROUP: InteractionGroups =
InteractionGroups::new(Group::GROUP_1, Group::GROUP_1, InteractionTestMode::AND);
InteractionGroups::new(Group::GROUP_1, Group::GROUP_1, InteractionTestMode::And);
const BLUE_GROUP: InteractionGroups =
InteractionGroups::new(Group::GROUP_2, Group::GROUP_2, InteractionTestMode::AND);
InteractionGroups::new(Group::GROUP_2, Group::GROUP_2, InteractionTestMode::And);

/*
* A green floor that will collide with the GREEN group only.
Expand Down
4 changes: 2 additions & 2 deletions examples3d/collision_groups3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ pub fn init_world(testbed: &mut Testbed) {
* Setup groups
*/
const GREEN_GROUP: InteractionGroups =
InteractionGroups::new(Group::GROUP_1, Group::GROUP_1, InteractionTestMode::AND);
InteractionGroups::new(Group::GROUP_1, Group::GROUP_1, InteractionTestMode::And);
const BLUE_GROUP: InteractionGroups =
InteractionGroups::new(Group::GROUP_2, Group::GROUP_2, InteractionTestMode::AND);
InteractionGroups::new(Group::GROUP_2, Group::GROUP_2, InteractionTestMode::And);

/*
* A green floor that will collide with the GREEN group only.
Expand Down
4 changes: 2 additions & 2 deletions examples3d/vehicle_joints3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn init_world(testbed: &mut Testbed) {
.collision_groups(InteractionGroups::new(
CAR_GROUP,
!CAR_GROUP,
InteractionTestMode::AND,
InteractionTestMode::And,
));
let body_rb = RigidBodyBuilder::dynamic()
.position(body_position.into())
Expand Down Expand Up @@ -92,7 +92,7 @@ pub fn init_world(testbed: &mut Testbed) {
.collision_groups(InteractionGroups::new(
CAR_GROUP,
!CAR_GROUP,
InteractionTestMode::AND,
InteractionTestMode::And,
))
.friction(1.0);
let wheel_rb = RigidBodyBuilder::dynamic().position(wheel_center.into());
Expand Down
10 changes: 5 additions & 5 deletions src/geometry/interaction_groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
/// - The interaction groups filter.
///
/// An interaction is allowed between two filters `a` and `b` when two conditions
/// are met simultaneously for [`InteractionTestMode::AND`] or individually for [`InteractionTestMode::OR`]::
/// are met simultaneously for [`InteractionTestMode::And`] or individually for [`InteractionTestMode::Or`]::
/// - The groups membership of `a` has at least one bit set to `1` in common with the groups filter of `b`.
/// - The groups membership of `b` has at least one bit set to `1` in common with the groups filter of `a`.
///
/// In other words, interactions are allowed between two filter iff. the following condition is met
/// for [`InteractionTestMode::AND`]:
/// for [`InteractionTestMode::And`]:
/// ```ignore
/// (self.memberships.bits() & rhs.filter.bits()) != 0 && (rhs.memberships.bits() & self.filter.bits()) != 0
/// ```
/// or for [`InteractionTestMode::OR`]:
/// or for [`InteractionTestMode::Or`]:
/// ```ignore
/// (self.memberships.bits() & rhs.filter.bits()) != 0 || (rhs.memberships.bits() & self.filter.bits()) != 0
/// ```
Expand Down Expand Up @@ -61,12 +61,12 @@ impl InteractionGroups {

/// Allow interaction with everything.
pub const fn all() -> Self {
Self::new(Group::ALL, Group::ALL, InteractionTestMode::AND)
Self::new(Group::ALL, Group::ALL, InteractionTestMode::And)
}

/// Prevent all interactions.
pub const fn none() -> Self {
Self::new(Group::NONE, Group::NONE, InteractionTestMode::AND)
Self::new(Group::NONE, Group::NONE, InteractionTestMode::And)
}

/// Sets the group this filter is part of.
Expand Down

0 comments on commit 43c28fc

Please sign in to comment.