pick

fun pick(windowPosition: Cartesian2, width: Double? = definedExternally, height: Double? = definedExternally): Any(source)

Returns an object with a primitive property that contains the first (top) primitive in the scene at a particular window coordinate or undefined if nothing is at the location. Other properties may potentially be set depending on the type of primitive and may be used to further identify the picked object.

When a feature of a 3D Tiles tileset is picked, pick returns a Cesium3DTileFeature object.

// On mouse over, color the feature yellow.
handler.setInputAction(function(movement) {
const feature = scene.pick(movement.endPosition);
if (feature instanceof Cesium3DTileFeature) {
feature.color = Color.YELLOW;
}
}, ScreenSpaceEventType.MOUSE_MOVE);

Return

Object containing the picked primitive.

Parameters

windowPosition

Window coordinates to perform picking on.

width

Width of the pick rectangle. Default value - 3

height

Height of the pick rectangle. Default value - 3

See also