@twinfinity/core
    Preparing search index...

    Interface Selectables

    Methods and properties related to gpu picking. Basically "given a rendered pixel what object does that pixel represent".

    interface Selectables {
        attach(mesh: Mesh | Icon, o?: AttachOption): number;
        detach(mesh: Mesh | Icon): boolean;
        getVisiblesInSight(o?: GetVisibleInSightOptions): VisibleSelectable[];
        getVisiblesInSight(
            inSightCamera?: Camera,
            textureSizePow2?: number,
            isDistanceCullingEnabled?: boolean,
        ): VisibleSelectable[];
        getVisiblesInSight(
            inSightCamera?: Camera | GetVisibleInSightOptions,
            textureSizePow2?: number,
            isDistanceCullingEnabled?: boolean,
        ): VisibleSelectable[];
        idOf(meshOrIcon: Mesh | Icon): number;
        pick(o: PickOption): PickResult;
        pick(
            picker: TargetCamera,
            textureSizePow2?: number,
            doIntersectionTestOnGeometry?: boolean,
            saveRenderedGpuPickingSceneTexture?: boolean,
        ): PickResult;
    }

    Implemented by

    Index

    Methods

    • Detaches a previously attached BabylonJS mesh from "pick" operations.

      Parameters

      Returns boolean

    • Renders objects and checks which objects are in sight from given camera.

      Parameters

      Returns VisibleSelectable[]

    • Renders objects and checks which objects are in sight from given camera.

      Parameters

      • OptionalinSightCamera: Camera

        Camera to represent the view to check for visible objects. If not specified, then current active camera is used.

      • OptionaltextureSizePow2: number

        Resolution of the texture to be used for in sight detection. (The bigger the texture is, the higher precision when picking.)

      • OptionalisDistanceCullingEnabled: boolean

        Whether to enable distance culling.

      Returns VisibleSelectable[]

    • Parameters

      Returns VisibleSelectable[]

    • Get unique "pick" id of mesh or icon. It is only valid as long as the item has been registered with attach. It will be 0 if not attached.

      Parameters

      • meshOrIcon: Mesh | Icon

        mesh or icon to get id for.

      Returns number

      0 if not attached, otherwise unique "pick" id.

    • Performs an intersection test in the world (finds objects below a specific screen coordinate or that intersect a ray).

      Parameters

      Returns PickResult

      Intersection information.

    • Performs an intersection test in the world (find objects below a specific camera or screen coordinate, or that intersect a ray).

      Parameters

      • picker: TargetCamera
      • OptionaltextureSizePow2: number

        texture size (defaults to 16x16) used when rendering the world during pick operation.

      • OptionaldoIntersectionTestOnGeometry: boolean

        true to perform exact intersection on intersected object (exact coordinate etc). This is computationally expensive.

      • OptionalsaveRenderedGpuPickingSceneTexture: boolean

        true to save the rendering texture of the pick operation. Mostly useful for debugging.

      Returns PickResult