QObjectPicker¶
The
QObjectPicker
class instantiates a component that can be used to interact with a QEntity by a process known as picking. More…
Synopsis¶
Functions¶
def
containsMouse
()def
isDragEnabled
()def
isHoverEnabled
()def
isPressed
()def
priority
()
Slots¶
def
setDragEnabled
(dragEnabled)def
setHoverEnabled
(hoverEnabled)def
setPriority
(priority)
Signals¶
def
clicked
(pick)def
containsMouseChanged
(containsMouse)def
dragEnabledChanged
(dragEnabled)def
entered
()def
exited
()def
hoverEnabledChanged
(hoverEnabled)def
moved
(pick)def
pressed
(pick)def
pressedChanged
(pressed)def
priorityChanged
(priority)def
released
(pick)
Detailed Description¶
For every combination of viewport and camera, picking casts a ray through the scene to find entities who’s bounding volume intersects the ray. The bounding volume is computed using the values in the attribute buffer specified by the boundingVolumePositionAttribute of the geometry.
The signals
pressed()
,released()
,clicked()
,moved()
,entered()
, andexited()
are emitted when the bounding volume defined by the pickAttribute property intersects with a ray.Most signals carry a
QPickEvent
instance. If QPickingSettings::pickMode() is set toTrianglePicking
, the actual type of the pick parameter will beQPickTriangleEvent
.Pick queries are performed on mouse press and mouse release. If drag is enabled, queries also happen on each mouse move while any button is pressed. If hover is enabled, queries happen on every mouse move even if no button is pressed.
For generalised ray casting queries, see
QRayCaster
andQScreenRayCaster
.Note
Instances of this component shouldn’t be shared, not respecting that condition will most likely result in undefined behavior.
Note
The camera far plane value affects picking and produces incorrect results due to floating-point precision if it is greater than ~100 000.
See also
QPickingSettings
QGeometry
QAttribute
QPickEvent
QPickTriangleEvent
QNoPicking
- class PySide2.Qt3DRender.Qt3DRender.QObjectPicker([parent=None])¶
- Parameters:
parent –
PySide2.Qt3DCore.Qt3DCore.QNode
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.clicked(pick)¶
- Parameters:
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.containsMouse()¶
- Return type:
bool
Specifies if the object picker currently contains the mouse
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.containsMouseChanged(containsMouse)¶
- Parameters:
containsMouse – bool
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.dragEnabledChanged(dragEnabled)¶
- Parameters:
dragEnabled – bool
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.entered()¶
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.exited()¶
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.hoverEnabledChanged(hoverEnabled)¶
- Parameters:
hoverEnabled – bool
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.isDragEnabled()¶
- Return type:
bool
Specifies if drag is enabled
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.isHoverEnabled()¶
- Return type:
bool
Specifies if hover is enabled
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.isPressed()¶
- Return type:
bool
Specifies if the object picker is currently pressed
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.moved(pick)¶
- Parameters:
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.pressed(pick)¶
- Parameters:
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.pressedChanged(pressed)¶
- Parameters:
pressed – bool
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.priority()¶
- Return type:
int
The priority to be used when filtering pick results by priority when
pickResultMode
is set toNearestPriorityPick
.
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.priorityChanged(priority)¶
- Parameters:
priority – int
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.released(pick)¶
- Parameters:
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.setDragEnabled(dragEnabled)¶
- Parameters:
dragEnabled – bool
Specifies if drag is enabled
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.setHoverEnabled(hoverEnabled)¶
- Parameters:
hoverEnabled – bool
Specifies if hover is enabled
- PySide2.Qt3DRender.Qt3DRender.QObjectPicker.setPriority(priority)¶
- Parameters:
priority – int
The priority to be used when filtering pick results by priority when
pickResultMode
is set toNearestPriorityPick
.
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.