API

Function PickWithBoundingInfo

  • Launch a ray to try to pick a mesh in the scene using only bounding information of the main mesh (not using submeshes)

    Parameters

    • scene: Scene

      defines the scene to use for the picking

    • x: number

      position on screen

    • y: number

      position on screen

    • Optionalpredicate: MeshPredicate

      Predicate function used to determine eligible meshes. Can be set to null. In this case, a mesh must be enabled, visible and with isPickable set to true. thinInstanceIndex is -1 when the mesh is non-instanced

    • OptionalfastCheck: boolean

      defines if the first intersection will be used (and not the closest)

    • Optionalcamera: any

      to use for computing the picking ray. Can be set to null. In this case, the scene.activeCamera will be used

    Returns Nullable<PickingInfo>

    a PickingInfo (Please note that some info will not be set like distance, bv, bu and everything that cannot be capture by only using bounding infos)