Class: QgsRayCastHit¶
Contains details about the ray intersecting entities when ray casting in a 3D map canvas.
Added in version 4.0.
Methods
| Returns the hit's distance from the ray's origin | |
| Returns the hit position in 3d map coordinates | |
| Returns a map with the properties of the intersected entity. | |
| Sets the hit's distance from the ray's origin | |
| Sets the hit point position in 3d map coordinates | |
| Sets the point cloud point attributes, empty map if hit was not on a point cloud point | 
- class qgis._3d.QgsRayCastHit[source]¶
- Bases: - object- mapCoordinates(self) QgsVector3D[source]¶
- Returns the hit position in 3d map coordinates - Return type:
 
 - properties(self) Dict[str, Any][source]¶
- Returns a map with the properties of the intersected entity. For vector layer hits, the FID value is stored in key “fid”. For point cloud layer hits, it contains the point attributes keys/values. For tiled scene layer hits, it contains the intersecting node details. - Return type:
- Dict[str, Any] 
 
 - setDistance(self, distance: float)[source]¶
- Sets the hit’s - distancefrom the ray’s origin- Parameters:
- distance (float) 
 
 - setMapCoordinates(self, point: QgsVector3D)[source]¶
- Sets the hit - pointposition in 3d map coordinates- Parameters:
- point (QgsVector3D)