BitMask intervals

Hello fellows

There’s some way to set BitMask intervals in a CollisionNode?
Example … i want a CollisionNode have a fromCollideMask between BitMask32.bit(1) and BitMask32.bit(5) … there’s some way?


I’m not sure if I understand your question right. Are you asking for a BitMask32 with all bits from 1 to 5 set, while bits 0 and 6+ are not set? Like “…0000111110”? In this case you culd use:

BitMask32.setRange(int low_bit, int size)

Or if you don’t want all this explicit conveniance stuff and do it yourself, like a real programmer (not serious here, but see yourself:

mask = BitMask32((1<<6)-2)


>>> bin((1<<6)-2)

There is setRange function, didnt quite test it yet (dont have panda on this computer).

Also, you could do it in python style :slight_smile:

for i in range (1,6): #1,2,3,4,5

Thanx Buddies