Class PickingInfo
Constructors
constructor
-
Returns PickingInfo
Properties
aim Transform
The aim-space transform of the input used for picking, if it is an XR input source.
bu
(See getTextureCoordinates) The barycentric U coordinate that is used when calculating the texture coordinates of the collision.
bv
(See getTextureCoordinates) The barycentric V coordinate that is used when calculating the texture coordinates of the collision.
distance
Distance away where the pick collided
face Id
The index of the face on the mesh that was picked, or the index of the Line if the picked Mesh is a LinesMesh
grip Transform
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
If the pick collided with an object
origin Mesh
If a mesh was used to do the picking (eg. 6dof controller) as a "near interaction", this will be populated.
picked Mesh
The mesh corresponding the pick collision
picked Point
The location of pick collision
picked Sprite
If a sprite was picked, this will be the sprite the pick collided with
ray
The ray that was used to perform the picking.
sub Mesh Face Id
The index of the face on the subMesh that was picked, or the index of the Line if the picked Mesh is a LinesMesh
sub Mesh Id
Id of the submesh that was picked
thin Instance Index
If we are picking a mesh with thin instance, this will give you the picked thin instance
Methods
get Normal
-
Gets the normal corresponding to the face the pick collided with
Parameters
- useWorldCoordinates: boolean = false
If the resulting normal should be relative to the world (default: false)
- useVerticesNormals: boolean = true
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
- useWorldCoordinates: boolean = false
Information about the result of picking within a scene
See
https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions