Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Layers

Node's layer manager, it's stored as bit mask data in Node.layer. Layer information is widely used in raycast, physics and user logic. Every node can be assigned to multiple layers with different bit masks, you can setup layer with inclusive or exclusive operation.

Hierarchy

  • Layers

Index

Properties

Static BitMask

BitMask: EnumAlias<typeof BitMask> = BitMask({ ...layerList })

All layers in BitMask type

Static Enum

Enum: EnumAlias<typeof Enum> = Enum(layerList)

All layers in an Enum

Methods

Static addLayer

  • addLayer(name: string, bitNum: number): void
  • Add a new layer, user can use layers from bit position 0 to 19, other bits are reserved.

    Parameters

    • name: string

      Layer's name

    • bitNum: number

      Layer's bit position

    Returns void

Static deleteLayer

  • deleteLayer(bitNum: number): void
  • Remove a layer, user can remove layers from bit position 0 to 19, other bits are reserved.

    Parameters

    • bitNum: number

      Layer's bit position

    Returns void

Static makeMaskExclude

  • makeMaskExclude(excludes: number[]): number
  • Make a layer mask accepting everything but the listed layers

    Parameters

    • excludes: number[]

      All excluded layers

    Returns number

    A filter which can detect for excluded layers

Static makeMaskInclude

  • makeMaskInclude(includes: number[]): number
  • Make a layer mask accepting nothing but the listed layers

    Parameters

    • includes: number[]

      All accepted layers

    Returns number

    A filter which can detect all accepted layers

Generated using TypeDoc