/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
def addCollideMask(np,mask): """Add mask to the NodePath's existing collide mask (do a binary OR of the two bitmasks).""" np.setCollideMask(np.getCollideMask() | mask) def removeCollideMask(np,mask): """Remove mask from the NodePath's existing collide mask (all bits set to 1 in mask will be set to 0 in the NodePath's mask).""" # Need to copy mask first to avoid modifying it in place. copy = mask & BitMask32.allOn() copy.invertInPlace() np.setCollideMask(np.getCollideMask() & copy)