Class: GpuPicker

GpuPicker()

new GpuPicker()

If any entity has a GpuPickable component, add it to my picking scene.

Source:

Methods

initMyPickings(ecs, scene)

If any entity has a GpuPickable component, add it to my picking scene.

Parameters:
Name Type Description
ecs ECS
scene THREE.Scene
Source:

pickTest(canvPos, camera)

Picking test, check is the randered object?

Parameters:
Name Type Description
canvPos array

[x, y] canvas position, in pixel

camera THREE.Camera
Source:

update(tick, entities)

If mouse moved, try pick the object

Parameters:
Name Type Description
tick number
entities array.<Entity>
Source:

GpuPicker()

new GpuPicker()

Helper for picking scene object. For example, see Three.js Tutorial Can only work with Obj3.mesh.

Source:

Methods

initMyPickings(ecs, scene)

If any entity has a GpuPickable component, add it to my picking scene.

Parameters:
Name Type Description
ecs ECS
scene THREE.Scene
Source:

pickTest(canvPos, camera)

Picking test, check is the randered object?

Parameters:
Name Type Description
canvPos array

[x, y] canvas position, in pixel

camera THREE.Camera
Source:

update(tick, entities)

If mouse moved, try pick the object

Parameters:
Name Type Description
tick number
entities array.<Entity>
Source: