lua.box3d.world.bits
bits=world:bits(name)
bits=world:bits(name,{mask=0xfffffffffffff,bits=0x0000000000001,group=0})
bits=world:bits(name,false)
get/set named bits, to help with keeping all your bitmasks in one place so you don't get yourself confuzzled.
bits is must be a table containing mask, bits and group then instead of setting these numbers explicitly we can use this name in shape creation or casting, anywhere a filter is expected.
This helper code adds the following logic to shape creation etc
if filter is set then get bits using world:bits(filter) then
filter_categoryBits will be set from bits.bits if nil
filter_maskBits will be set from bits.mask if nil
filter_groupIndex will be set from bits.group if nil
You probably do not want to create default values for these values using world:defaults as these will not be replace by this helper.
Pass in false to unset the named bits.
If bits does not exist then we will return the default values of {mask=0xfffffffffffff,bits=0x0000000000001,group=0} which can be modified by setting the bits named "default" to whatever you want.
Since this default is always available you can use filter="default" in shape creation to use these default values.
Note that 0xfffffffffffff (13 hex digits) is an integer that fits safely in a double and you should not use any more bits.