LS.Picking Class
Picking is used to detect which element is below one pixel (used the GPU) or using raycast
Constructor
LS.Picking
()
Item Index
Methods
getInstanceAtCanvasPosition
(
Object
-
x -
y -
camera -
layers -
scene
Returns the instance under a screen position
Parameters:
-
xNumberin canvas coordinates
-
yNumberin canvas coordinates
-
cameraCamera -
layersNumberdefault is 0xFFFF which is all
-
sceneSceneTree
Returns:
Object:
the info supplied by the picker (usually a SceneNode)
getNextPickingColor
(
Vec3
-
info
Returns a color you should use to paint this node during picking rendering you tell what info you want to retrieve associated with this object if it is clicked
Parameters:
-
info
Returns:
Vec3:
array containing all the RenderInstances that collided with the ray
getNodeAtCanvasPosition
(
-
x -
y -
camera -
layers -
scene
Renders the pixel and retrieves the color to detect which object it was, slow but accurate
Parameters:
-
xNumberin canvas coordinates
-
yNumberin canvas coordinates
-
cameraCameradefault is all cameras
-
layersNumberdefault is 0xFFFF which is all
-
sceneSceneTreedefault is GlobalScene
