820 |
820 |
821 `mask` is a number between `0x0000` and `0xFFFF` and used as a bitfield, which means you can combine these flags with `bor`. These are the available flags: |
821 `mask` is a number between `0x0000` and `0xFFFF` and used as a bitfield, which means you can combine these flags with `bor`. These are the available flags: |
822 |
822 |
823 || *Identifier* || *Collision with …* || |
823 || *Identifier* || *Collision with …* || |
824 || `lfLandMask` || Terrain || |
824 || `lfLandMask` || Terrain || |
825 || `lfCurrentHog` || *Deprecated! Do not use.* || |
825 || `lfCurHogCrate` || Current hedgehog, and crates || |
826 || `lfHHMask` || Any hedgehogs || |
826 || `lfHHMask` || Any hedgehogs || |
827 || `lfNotHHObjMask` || Objects, not hogs (e.g. mines, explosives) || |
827 || `lfNotHHObjMask` || Objects, not hogs (e.g. mines, explosives) || |
828 || `lfAllObjMask` || Hedgehogs and objects || |
828 || `lfAllObjMask` || Hedgehogs and objects || |
829 |
829 |
830 Beware, the collision mask is often set by the engine as well. |
830 Beware, the collision mask is often set by the engine as well. |
831 |
831 |
832 Examples: |
832 Examples: |
833 <code language="lua">SetGearCollisionMask(gear, bnot(lfCurrentHegehog)) |
833 <code language="lua">SetGearCollisionMask(gear, bnot(lfCurHogCrate)) |
834 -- Ignore collision with current hedgehog</code> |
834 -- Ignore collision with current hedgehog</code> |
835 |
835 |
836 <code language="lua">SetGearCollisionMask(gear, 0xFFFF) |
836 <code language="lua">SetGearCollisionMask(gear, 0xFFFF) |
837 -- Collide with everything</code> |
837 -- Collide with everything</code> |
838 |
838 |