ProtoTwin API
    Preparing search index...

    Class PhysicsLayers

    Physics collision layer matrix.

    Used to specify which layers can interact with each other through collisions.

    Index

    Accessors

    • get layers(): readonly string[]

      The list of physics collision layers.

      Returns readonly string[]

    Methods

    • Creates a physics collision layer and adds it to the matrix.

      Parameters

      • layerName: string

        The unique name for the layer.

      Returns boolean

      Whether the layer was successfully created.

    • Finds a physics collision layer with the specified name.

      Parameters

      • layerName: string

        The layer name.

      Returns boolean

      Whether a layer with the specified name was found.

    • Whether collisions should be detected between the two physics collision layers.

      Parameters

      • first: string

        The first layer.

      • second: string

        The second layer.

      Returns boolean

      True if collisions should be detected, false otherwise.

    • Removes the physics collision layer with the specified name.

      Parameters

      • layerName: string

        The layer name.

      Returns boolean

      Whether the layer was removed.

    • Renames a physics collision layer.

      Parameters

      • oldLayerName: string

        The current name for the layer to rename.

      • newLayerName: string

        The new name for the layer.

      Returns boolean

      Whether the layer was renamed.

    • Whether collisions should be detected between the two physics collision layers.

      Parameters

      • first: string

        The first layer.

      • second: string

        The second layer.

      • value: boolean

        True if collisions should be detected, false otherwise.

      Returns void