Skip to content

API / geotoolkit3d / picking / RayCastPicking / RayCastPicking

Class: RayCastPicking

picking.RayCastPicking.RayCastPicking

Picking using raycasting algorithm.<br> <br> This selection strategy use a raycasting algorithm to determine what objects are at the requested location.<br> Note that this algorithm has some known limitations as it's a CPU approach:<br> <ul> <li>Vertex&Fragment shader are not supported, therefore objects making use of them might not be pickable or picked at the wrong coordinates</li> <li>Raycasting use a distance-based criteria</li> <li>Can be slow if the picked object or any object considered as a candidate internally has a lot of triangles </li> <li>Returns all objects at the given location that match the criteria </li> </ul>

Hierarchy

Table of contents

Constructors
  • [new RayCastPicking()](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit3d.picking.raycastpicking.raycastpicking.md#new raycastpicking())
Methods

Contents

Constructors

new RayCastPicking()

• new RayCastPicking()

Overrides

AbstractPicking.constructor

Methods

getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractPicking.getClassName


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractPicking.getClassName


getPickingRay

▸ Static getPickingRay(plot, x, y): Ray

Return the Ray on the given plot at the given screen coordinates.

Parameters

Name Type Description
plotPlotThe target plot
xnumberThe x coordinate in plot device space
ynumberThe y coordinate in plot device space

Returns

Ray


getPickingRayClient

▸ Static getPickingRayClient(plot, x, y): Ray

Return the Ray on the given plot at the given screen coordinates.

Parameters

Name Type Description
plotPlotThe target plot
xnumberThe x coordinate in client device space
ynumberThe y coordinate in client device space

Returns

Ray


pick

▸ Static pick(plot, x, y): PickingResult[]

Cast a ray at the given pixel location (relative to the plot).<br> <br> Objects close enough to the ray will be retrieved by the raycast operation.<br>

Parameters

Name Type Description
plotPlotThe target plot
xnumberThe x coordinate in device space (pixels)
ynumberThe x coordinate in device space (pixels)

Returns

PickingResult[]

An array of PickingResult containing the intersecting shapes

Overrides

AbstractPicking.pick