Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Filter

The 'Filter' is class for creating collision filters.

Hierarchy

  • Filter

Index

Constructors

constructor

  • new Filter(mask?: number, category?: number, group?: number): Filter
  • Creates a new filter.

    Parameters

    • mask: number = 4294967295
    • category: number = 1
    • group: number = 0

    Returns Filter

Properties

category

category: number = 1

group

group: number = 0

mask

mask: number = 4294967295

Static Private group

group: number = 1

Static Private nonCollidingGroup

nonCollidingGroup: number = -1

Methods

Static canCollide

  • Returns true if the two given filters can collide.

    Parameters

    Returns boolean

    True if the two given filters can collide

Static nextCategory

  • nextCategory(engine: Engine): number
  • Parameters

    Returns number

    The next unique category(there are 32 available)

Static nextGroup

  • nextGroup(nonColliding?: boolean): number
  • If 'nonColliding' is false returns the next unique group for which bodies will collide, otherwise returns the next unique group for which bodies will NOT collide.

    Parameters

    • nonColliding: boolean = false

    Returns number

    The next unique group

Generated using TypeDoc