Qt3DRender::QScreenRayCaster Class

class Qt3DRender::QScreenRayCaster

Performe ray casting test based on screen coordinates. 更多...

頭: #include <QScreenRayCaster>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML: ScreenRayCaster
繼承: Qt3DRender::QAbstractRayCaster
狀態: 棄用

特性

公共函數

QPoint position () const

公共槽

void setPosition (const QPoint & position )
void trigger ()
void trigger (const QPoint & position )

信號

void positionChanged (const QPoint & position )

詳細描述

QScreenRayCaster can be used to perform ray casting tests by specifying coordinates in screen space, which will be used to construct an actual 3D ray between the near and far planes.

另請參閱 QRayCaster and QNoPicking .

特性文檔編製

位置 : QPoint

Holds the screen space position used to compute the actual 3D ray for intersection tests.

Note: the coordinates will be used for every available render surface as long as they are in the valid range.

訪問函數:

QPoint 位置 () const
void setPosition (const QPoint & position )

通知程序信號:

void positionChanged (const QPoint & position )

成員函數文檔編製

[slot] void QScreenRayCaster:: trigger ()

Convenience method to enable the component and trigger tests using the current coordinate value.

注意: 此槽被重載。要連接到此槽:

// Connect using qOverload:
connect(screenRayCaster, qOverload<>(&QScreenRayCaster::trigger),
        receiver, &ReceiverClass::slot);
// Or using a lambda:
connect(screenRayCaster, qOverload<>(&QScreenRayCaster::trigger),
        this, []() { /* handle trigger */ });
					

更多範例和方式,見 連接到重載槽 .

[slot] void QScreenRayCaster:: trigger (const QPoint & position )

Convenience method to set the coordinate value position and enable the component to trigger tests.

注意: 此槽被重載。要連接到此槽:

// Connect using qOverload:
connect(screenRayCaster, qOverload(&QScreenRayCaster::trigger),
        receiver, &ReceiverClass::slot);
// Or using a lambda:
connect(screenRayCaster, qOverload(&QScreenRayCaster::trigger),
        this, [](const QPoint &position) { /* handle trigger */ });
					

更多範例和方式,見 連接到重載槽 .