Skip to main content

Selectables

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

Index

Methods

attach

  • Attaches custom BabylonJS meshes so they can be “picked”.


    Parameters

    Returns number

detach

  • detach(mesh: Mesh | Icon): boolean
  • Detaches a previously attached BabylonJS mesh from “pick” operations.


    Parameters

    Returns boolean

getVisiblesInSight

idOf

  • idOf(meshOrIcon: Mesh | Icon): number
  • 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.

pick

  • pick(o: PickOption): PickResult
  • pick(picker: TargetCamera, textureSizePow2?: number, doIntersectionTestOnGeometry?: boolean, saveRenderedGpuPickingSceneTexture?: boolean): PickResult
  • Performs an intersection test in the world (finds objects below a specific screen coordinate or that intersect a ray).


    Parameters

    Returns PickResult

    Intersection information.