Qt3DRender.QObjectPicker

The QObjectPicker class instantiates a component that can be used to interact with a QEntity by a process known as picking. More

Inheritance diagram of PySide2.Qt3DRender.Qt3DRender.QObjectPicker

Synopsis

Functions

Slots

Signals

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() , and exited() 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 to TrianglePicking , the actual type of the pick parameter will be QPickTriangleEvent .

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 and QScreenRayCaster .

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

parentQNode

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.clicked(pick)
Parameters

pickQPickEvent

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.containsMouse()
Return type

bool

Returns true if the object picker currently contains the mouse

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.containsMouseChanged(containsMouse)
Parameters

containsMousebool

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.dragEnabledChanged(dragEnabled)
Parameters

dragEnabledbool

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.entered()
PySide2.Qt3DRender.Qt3DRender.QObjectPicker.exited()
PySide2.Qt3DRender.Qt3DRender.QObjectPicker.hoverEnabledChanged(hoverEnabled)
Parameters

hoverEnabledbool

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.isDragEnabled()
Return type

bool

Returns true if dragging is enabled

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.isHoverEnabled()
Return type

bool

Returns true if hover enabled

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.isPressed()
Return type

bool

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.moved(pick)
Parameters

pickQPickEvent

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.pressed(pick)
Parameters

pickQPickEvent

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.pressedChanged(pressed)
Parameters

pressedbool

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.priority()
Return type

int

See also

setPriority()

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.priorityChanged(priority)
Parameters

priorityint

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.released(pick)
Parameters

pickQPickEvent

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.setDragEnabled(dragEnabled)
Parameters

dragEnabledbool

Sets the dragEnabled Property to dragEnabled

See also

isDragEnabled()

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.setHoverEnabled(hoverEnabled)
Parameters

hoverEnabledbool

Sets the hoverEnabled Property to hoverEnabled

See also

isHoverEnabled()

PySide2.Qt3DRender.Qt3DRender.QObjectPicker.setPriority(priority)
Parameters

priorityint

Sets the picker’s priority to priority . This is used when the pick result mode on QPickingSettings is set to NearestPriorityPick . Picking results are sorted by highest priority and shortest picking distance.

See also

priority()