Packs ยง24's separate 32-bit collisionGroups and collisionMask into the
single u32 Rapier calls InteractionGroups.
Rapier's rule, quoted from the 3D build's own
geometry/interaction_groups.d.ts: two filters a and b interact when
((a >> 16) & b) !== 0 && ((b >> 16) & a) !== 0 โ the high 16 bits are the
membership groups and the low 16 the filter mask. That is the same mutual
rule passesQueryFilter documents in @fourjs/physics, so contact filtering
and query filtering agree by construction.
Values above bit 15 cannot be represented and are rejected;
ALL_COLLISION_GROUPS (0xffffffff) is the one exception, because "every
group" is still every group at 16 bits.
This duplicates conversions2d.ts's packInteractionGroups โ about twenty
lines โ rather than sharing it, because the shared version would have to lose
the dimension from its error message, and correcting the 2D message is
outside WP-5.5's file list (decision, WP-5.5: reported, and a candidate for a
later hoist into one internal module).
Packs ยง24's separate 32-bit
collisionGroupsandcollisionMaskinto the singleu32Rapier callsInteractionGroups.Rapier's rule, quoted from the 3D build's own
geometry/interaction_groups.d.ts: two filtersaandbinteract when((a >> 16) & b) !== 0 && ((b >> 16) & a) !== 0โ the high 16 bits are the membership groups and the low 16 the filter mask. That is the same mutual rulepassesQueryFilterdocuments in@fourjs/physics, so contact filtering and query filtering agree by construction.Values above bit 15 cannot be represented and are rejected;
ALL_COLLISION_GROUPS(0xffffffff) is the one exception, because "every group" is still every group at 16 bits.This duplicates
conversions2d.ts'spackInteractionGroupsโ about twenty lines โ rather than sharing it, because the shared version would have to lose the dimension from its error message, and correcting the 2D message is outside WP-5.5's file list (decision, WP-5.5: reported, and a candidate for a later hoist into one internal module).