Filter

data class Filter(val categoryBits: ULong = B2_DEFAULT_CATEGORY_BITS, val maskBits: ULong = B2_DEFAULT_MASK_BITS, val groupIndex: Int = 0)

Collision filtering data.

Collision filtering allows you to prevent collision between shapes. Box2D supports collision filtering using category and mask bits.

Constructors

Link copied to clipboard
constructor(categoryBits: ULong = B2_DEFAULT_CATEGORY_BITS, maskBits: ULong = B2_DEFAULT_MASK_BITS, groupIndex: Int = 0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The collision category bits. Normally you would just set one bit. Default is 1 (a single category). Use maskBits to control what this shape collides with.

Link copied to clipboard

Collision groups allow a certain group of objects to never collide (negative) or always collide (positive). A group index of zero has no effect. Non-zero group filtering always wins against the mask bits.

Link copied to clipboard

The collision mask bits. This states the categories that this shape would accept for collision. Default is all bits set (collides with everything).