15 #include "physxMask.h"
26 mask._mask = 0xffffffff;
39 mask._mask = 0x0000000;
52 nassertv_always(idx >= 0 && idx <= 31);
53 _mask = _mask | (1 << idx);
65 nassertv_always(idx >= 0 && idx <= 31);
66 _mask = _mask & ~(1 << idx);
79 nassertr_always(idx >= 0 && idx <= 31,
false);
80 return (_mask & (1 << idx)) ?
true :
false;
94 for (
int i=0; i<32; i++) {
95 name += (_mask & (1 << i)) ?
'1' :
'0';
98 out <<
"/" << name <<
"/";
void output(ostream &out) const
Writes the PhysxMask out as a list of ones and zeros.
void set_bit(unsigned int idx)
Sets the nth bit on.
static PhysxMask all_on()
Returns a PhysxMask whose bits are all on.
static PhysxMask all_off()
Returns a PhysxMask whose bits are all off.
bool get_bit(unsigned int idx) const
Returns true if the nth bit is set, false if it is cleared.
void clear_bit(unsigned int idx)
Sets the nth bit off.