How do short int based masks work in c++ (for example ones in Bullet)?
CollisionFilterGroups {
DefaultFilter = 1,
StaticFilter = 2,
KinematicFilter = 4,
DebrisFilter = 8,
SensorTrigger = 16,
CharacterFilter = 32,
AllFilter = -1
}
And see that all values are degrees of 2 and I know that:
short is signed integer that takes 2 bytes to store and is from −32,768 to +32,767.
But how to create my own groups: how to calculate mask intersections?
For example how to create in addition to CollisionFilterGroups something like:
MyCollisionFilterGroups {
Cubes= ?,
Boxes= ?,
Spheres= ?
}
Where
- We want "planes" not to collide ("see") with "planes", "boxes" and "spheres"
- We want "boxes" to collide with other "boxes" and "spheres"
- We want "spheres" not to collide with "spheres" yet collide with "boxes"