Options
All
  • Public
  • Public/Protected
  • All
Menu

Information about the result of picking within a scene

see

https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions

Hierarchy

  • PickingInfo

Index

Constructors

Properties

aimTransform: Nullable<TransformNode>

The aim-space transform of the input used for picking, if it is an XR input source.

bu: number

(See getTextureCoordinates) The barycentric U coordinate that is used when calculating the texture coordinates of the collision.

bv: number

(See getTextureCoordinates) The barycentric V coordinate that is used when calculating the texture coordinates of the collision.

distance: number

Distance away where the pick collided

faceId: number

The index of the face on the mesh that was picked, or the index of the Line if the picked Mesh is a LinesMesh

gripTransform: Nullable<TransformNode>

The grip-space transform of the input used for picking, if it is an XR input source. Some XR sources, such as input coming from head mounted displays, do not have this.

hit: boolean

If the pick collided with an object

originMesh: Nullable<AbstractMesh>

If a mesh was used to do the picking (eg. 6dof controller) as a "near interaction", this will be populated.

pickedMesh: Nullable<AbstractMesh>

The mesh corresponding the pick collision

pickedPoint: Nullable<Vector3>

The location of pick collision

pickedSprite: Nullable<Sprite>

If a sprite was picked, this will be the sprite the pick collided with

The ray that was used to perform the picking.

subMeshFaceId: number

The index of the face on the subMesh that was picked, or the index of the Line if the picked Mesh is a LinesMesh

subMeshId: number

Id of the submesh that was picked

thinInstanceIndex: number

If we are picking a mesh with thin instance, this will give you the picked thin instance

Methods

  • getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Nullable<Vector3>
  • Gets the normal corresponding to the face the pick collided with

    remarks

    Note that the returned normal will always point towards the picking ray.

    Parameters

    • Optional useWorldCoordinates: boolean

      If the resulting normal should be relative to the world (default: false)

    • Optional useVerticesNormals: boolean

      If the vertices normals should be used to calculate the normal instead of the normal map (default: true)

    Returns Nullable<Vector3>

    The normal corresponding to the face the pick collided with

  • Gets the texture coordinates of where the pick occurred

    Parameters

    • Optional uvSet: string

      The UV set to use to calculate the texture coordinates (default: VertexBuffer.UVKind)

    Returns Nullable<Vector2>

    The vector containing the coordinates of the texture

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme