Class Layers

Contains a list of layers that can be used for where an effect is being applied. This system can be used to determine which Camera can see a particular Renderable or which Rigidbody is intersected by a PhysicsScene raycast.

A maximum of 8 layers is supported, but RSX could support more.

Constructors

Properties

allLayers: rsx.LayerMask

The default bit value for LayerMasks. All layers are enabled.

maximumLayerCount = 8

The maximum number of layers.

Accessors

  • get names(): string[]
  • Returns the names of all available layers.

    Returns string[]

Methods

  • Converts the array of activeBits into a single bigint.

    [1, 4, 8] would create a bigint with bits 1,4,8 enabled.

    Parameters

    • activeBits: number[]

      The array of active bits.

    Returns rsx.LayerMask

    Layermask as bigint.

  • Converts the array of activeBits into a single number.

    [1, 4, 8] would create a number with bits 1,4,8 enabled.

    Parameters

    • activeBits: number[]

      The array of active bits.

    Returns number

    Layermask as number.

  • Unpacks a layerBitMask into an array of active bit indices.

    A layerBitMask bits 1,4,8 enabled will result in the array [1,4,8].

    Parameters

    Returns number[]

    Array of active bit indices.