PySide6.Qt3DRender.Qt3DRender.QAbstractRayCaster¶
- class QAbstractRayCaster¶
- An abstract base class for ray casting in 3d scenes. - Details- QAbstractRayCasteris an abstract base class for casting rays into a 3d scene.- QAbstractRayCastercan not be directly instantiated, but rather through its subclasses.- QAbstractRayCasterspecifies common properties for all ray casters, such as run mode and layer handling, while leaving the actual ray casting details to the subclasses.- Ray castings differs from picking (using - QObjectPicker) in that it does not require mouse events to trigger.- By default, the instances of - QAbstractRayCasterare disabled. When enabled, the specified ray will be tested for intersecting objects at every frame. The- hitsproperty will be updated with the results of the ray casting, even if no objects are found.- The - QPickingSettingscan be used to control the ray casting, such as which primitives are tested and how the results are returned.- Furthermore, - QLayercomponents can be used to control how entities, or entity sub-graphs, react to ray casting.- Note - Components derived from - QAbstractRayCastershould not be shared amount multiple entities.- See also - QRayCaster- QScreenRayCaster- QObjectPicker- QPickingSettings- QNoPicking- Inherited by: - QScreenRayCaster,- QRayCaster- Synopsis¶- Properties¶- Methods¶- def - __init__()
- def - addLayer()
- def - filterMode()
- def - hits()
- def - layers()
- def - removeLayer()
- def - runMode()
 - Slots¶- def - setFilterMode()
- def - setRunMode()
 - Signals¶
- def - hitsChanged()
- def - runModeChanged()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - class RunMode¶
- This enumeration specifies how often ray casting is performed - Constant - Description - Qt3DRender.QAbstractRayCaster.Continuous - Ray casting is performed at every frame as long as the component is enabled. - Qt3DRender.QAbstractRayCaster.SingleShot - Ray casting is done once then the component disables itself. This is the default 
 - class FilterMode¶
- Specifies the rules for selecting entities to test for raycasting. - Constant - Description - Qt3DRender.QAbstractRayCaster.AcceptAnyMatchingLayers - Accept entities that reference one or more - QLayerobjects added to this- QAbstractRayCaster. This is the default- Qt3DRender.QAbstractRayCaster.AcceptAllMatchingLayers - Accept entities that reference all the - QLayerobjects added to this- QAbstractRayCaster- Qt3DRender.QAbstractRayCaster.DiscardAnyMatchingLayers - Discard entities that reference one or more - QLayerobjects added to this- QAbstractRayCaster- Qt3DRender.QAbstractRayCaster.DiscardAllMatchingLayers - Discard entities that reference all - QLayerobjects added to this- QAbstractRayCaster
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property filterModeᅟ: Qt3DRender.QAbstractRayCaster.FilterMode¶
 - Holds the filter mode specifying the entities to select for ray casting tests. - The default value is AcceptMatchingLayers. - Access functions:
 - property hitsᅟ: list of Qt3DRender.QRayCasterHit¶
 - Holds the results of last ray casting test as a vector of - QRayCasterHitinstances.- Note that even if successive tests return the exact same results (or empty results), a change notification will be emitted at every test. - Access functions:
- Signal - hitsChanged()
 
 - property runModeᅟ: Qt3DRender.QAbstractRayCaster.RunMode¶
 - Holds the run mode controlling how often ray casting tests are performed. - If set to - SingleShot(the default), when the component is enabled, a single ray casting test will be performed and the component will automatically disable itself.- If set to Continuous, ray casting tests will be performed at every frame as long as the component is enabled. - Access functions:
 - __init__([parent=None])¶
- Parameters:
- parent – - QNode
 
 - addLayer(layer)¶
- Parameters:
- layer – - QLayer
 
 - Add - layerto the current list of layers- filterMode()¶
- Return type:
- FilterMode
 - See also - setFilterMode()
 - Getter of property - filterModeᅟ.- filterModeChanged(filterMode)¶
- Parameters:
- filterMode – - FilterMode
 
 - Notification signal of property - filterModeᅟ.- hits()¶
- Return type:
- .list of Qt3DRender.QRayCasterHit 
 
 - Getter of property - hitsᅟ.- hitsChanged(hits)¶
- Parameters:
- hits – .list of Qt3DRender.QRayCasterHit 
 
 - Notification signal of property - hitsᅟ.- layers()¶
- Return type:
- .list of Qt3DRender.QLayer 
 
 - Returns the current list of layers - removeLayer(layer)¶
- Parameters:
- layer – - QLayer
 
 - Remove - layerfrom the current list of layers- runMode()¶
- Return type:
- RunMode
 - See also - setRunMode()
 - Getter of property - runModeᅟ.- runModeChanged(runMode)¶
- Parameters:
- runMode – - RunMode
 
 - Notification signal of property - runModeᅟ.- setFilterMode(filterMode)¶
- Parameters:
- filterMode – - FilterMode
 - See also - filterMode()
 - Setter of property - filterModeᅟ.- setRunMode(runMode)¶
- Parameters:
- runMode – - RunMode
 - See also - runMode()
 - Setter of property - runModeᅟ.