Class: RayPicker

RayPicker()

new RayPicker()

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

Source:

Methods

initMyPickings(ecs, scene, camera)

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

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

pickTest(canvPos, camera)

Picking test, check is the randered object?

Parameters:
Name Type Description
canvPos object

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:

RayPicker()

new RayPicker()

Helper for picking scene object, using ray casting.
Can only work with Obj3.mesh.

Tutorial

Source:

Methods

initMyPickings(ecs, scene, camera)

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

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

pickTest(canvPos, camera)

Picking test, check is the randered object?

Parameters:
Name Type Description
canvPos object

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: