内容表

上一话题

Qt3DRender.QAbstractLight

下一话题

Qt3DRender.QAbstractTexture

Qt3DRender.QAbstractRayCaster

用于在 3D 场景中,投射光线的抽象基类。 更多

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster

继承者: Qt3DRender.QRayCaster , Qt3DRender.QScreenRayCaster

New in version 5.11.

概要

函数

信号

详细描述

QAbstractRayCaster is an abstract base class for casting rays into a 3d scene. QAbstractRayCaster can not be directly instantiated, but rather through its subclasses. QAbstractRayCaster specifies 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 QAbstractRayCaster are disabled. When enabled, the specified ray will be tested for intersecting objects at every frame. The hits property will be updated with the results of the ray casting, even if no objects are found.

QPickingSettings can be used to control the ray casting, such as which primitives are tested and how the results are returned.

Furthermore, QLayer components can be used to control how entities, or entity sub-graphs, react to ray casting.

注意

Components derived from QAbstractRayCaster should not be shared amount multiple entities.

另请参阅

QRayCaster QScreenRayCaster QObjectPicker QPickingSettings QNoPicking

class PySide2.Qt3DRender.Qt3DRender. QAbstractRayCaster ( [ parent=None ] )
参数

parent QNode

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. RunMode

This enumeration specifies how often ray casting is performed

常量

描述

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

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. FilterMode

Specifies the rules for selecting entities to test for raycasting.

常量

描述

Qt3DRender.QAbstractRayCaster.AcceptAnyMatchingLayers

Accept entities that reference one or more QLayer objects added to this QAbstractRayCaster . This is the default

Qt3DRender.QAbstractRayCaster.AcceptAllMatchingLayers

Accept entities that reference all the QLayer objects added to this QAbstractRayCaster

Qt3DRender.QAbstractRayCaster.DiscardAnyMatchingLayers

Discard entities that reference one or more QLayer objects added to this QAbstractRayCaster

Qt3DRender.QAbstractRayCaster.DiscardAllMatchingLayers

Discard entities that reference all QLayer objects added to this QAbstractRayCaster

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. addLayer ( layer )
参数

layer QLayer

Add layer to the current list of layers

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. filterMode ( )
返回类型

FilterMode

另请参阅

setFilterMode()

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. filterModeChanged ( filterMode )
参数

filterMode FilterMode

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. hits ( )
返回类型

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. hitsChanged ( hits )
参数

hits

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. layers ( )
返回类型

Returns the current list of layers

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. removeLayer ( layer )
参数

layer QLayer

移除 layer from the current list of layers

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. runMode ( )
返回类型

RunMode

另请参阅

setRunMode()

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. runModeChanged ( runMode )
参数

runMode RunMode

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. setFilterMode ( filterMode )
参数

filterMode FilterMode

另请参阅

filterMode()

PySide2.Qt3DRender.Qt3DRender.QAbstractRayCaster. setRunMode ( runMode )
参数

runMode RunMode

另请参阅

runMode()