Class: QgsRayCastContext

Responsible for defining parameters of the ray casting operations in 3D map canvases.

Added in version 4.0.

Methods

angleThreshold

Sets an angle threshold in degrees for ray intersections, effectively turning a ray into a cone.

maximumDistance

The maximum distance from ray origin to look for hits when casting a ray.

setAngleThreshold

Sets an angle threshold in degrees for ray intersections, effectively turning a ray into a cone.

setMaximumDistance

Sets the maximum distance from ray origin to look for hits when casting a ray.

setSingleResult

Sets whether to fetch only the closest hit for each layer or entity type.

singleResult

Returns whether to fetch only the closest hit for each layer or entity type.

class qgis._3d.QgsRayCastContext[source]

Bases: object

angleThreshold(self) float[source]

Sets an angle threshold in degrees for ray intersections, effectively turning a ray into a cone.

Return type:

float

maximumDistance(self) float[source]

The maximum distance from ray origin to look for hits when casting a ray. Default value is -1, meaning that the far plane will be used as a maximum distance.

Return type:

float

setAngleThreshold(self, angle: float)[source]

Sets an angle threshold in degrees for ray intersections, effectively turning a ray into a cone.

Note

Currently only supported for point cloud layers.

Parameters:

angle (float)

setMaximumDistance(self, distance: float)[source]

Sets the maximum distance from ray origin to look for hits when casting a ray. Setting to -1 will set the maximum distance to the camera’s far plane.

Parameters:

distance (float)

setSingleResult(self, enable: bool)[source]

Sets whether to fetch only the closest hit for each layer or entity type. Setting this to False will return all ray hits.

Note

Currently only point cloud layers support False.

Parameters:

enable (bool)

singleResult(self) bool[source]

Returns whether to fetch only the closest hit for each layer or entity type. If not set it defaults to True.

Return type:

bool