pub struct CollisionGroup { /* private fields */ }Expand description
The collision group of a body (Jolt CollisionGroup): a group id and a sub group of a
GroupFilterTable.
Jolt’s rule for two bodies that both have a group: different group ids collide; the same group id with different tables never collides; within one table the same sub group never collides, and different sub groups collide when the table says so. A body without a group collides by its object layer alone. The group only filters what the solver collides: scene queries, character movement and vehicle wheel casts do not look at it.
Implementations§
Source§impl CollisionGroup
impl CollisionGroup
Sourcepub const MAX_GROUP_ID: u32
pub const MAX_GROUP_ID: u32
The largest group id a caller may use. The ids above it belong to ragdolls: the parts of
a ragdoll use group id 2^31 + RagdollId::to_raw.
Sourcepub fn new(
table: &GroupFilterTable,
group_id: u32,
sub_group_id: u32,
) -> Result<Self, CollisionGroupError>
pub fn new( table: &GroupFilterTable, group_id: u32, sub_group_id: u32, ) -> Result<Self, CollisionGroupError>
The group group_id with sub group sub_group_id of table. Refused for a group id
above MAX_GROUP_ID and a sub group not in the table.
Sourcepub fn table(&self) -> &GroupFilterTable
pub fn table(&self) -> &GroupFilterTable
The table of the group.
Sourcepub fn sub_group_id(&self) -> u32
pub fn sub_group_id(&self) -> u32
The sub group, below the table’s sub_groups.
Sourcepub fn can_collide(&self, other: &CollisionGroup) -> bool
pub fn can_collide(&self, other: &CollisionGroup) -> bool
Whether bodies of the two groups collide, by Jolt’s rule (CollisionGroup::CanCollide).