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:
-
x
Numberin canvas coordinates
-
y
Numberin canvas coordinates
-
camera
Camera -
layers
Numberdefault is 0xFFFF which is all
-
scene
Scene
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:
-
x
Numberin canvas coordinates
-
y
Numberin canvas coordinates
-
camera
Cameradefault is all cameras
-
layers
Numberdefault is 0xFFFF which is all
-
scene
Scenedefault is GlobalScene