QEntity是QNodesubclass that can aggregate severalQComponentinstances that will specify its behavior. 更多 …
继承者: Qt3DExtras.QAbstractCameraController , Qt3DExtras.QFirstPersonCameraController , Qt3DExtras.QOrbitCameraController , Qt3DExtras.QSkyboxEntity , Qt3DExtras.QText2DEntity , Qt3DRender.QCamera
def
addComponent
(comp)
def
components
()
def
parentEntity
()
def
removeComponent
(comp)
By itself a
QEntityis an empty shell. The behavior of aQEntityobject is defined by theQComponentobjects it references. Each Qt3D backend aspect will be able to interpret and process an Entity by recognizing which components it is made up of. One aspect may decide to only process entities composed of a singleQTransformcomponent whilst another may focus onQMouseHandler.另请参阅
QComponentQTransform
PySide2.Qt3DCore.Qt3DCore.
QEntity
(
[
parent=None
]
)
¶
- param parent
QNode
构造新
QEntity
实例与
parent
作为父级。
PySide2.Qt3DCore.Qt3DCore.QEntity.
addComponent
(
comp
)
¶
comp
–
QComponent
Adds a new reference to the component
comp
.
注意
若
QComponent
has no parent, the
QEntity
will set itself as its parent thereby taking ownership of the component.
PySide2.Qt3DCore.Qt3DCore.QEntity.
components
(
)
¶
Returns the list of
QComponent
instances the entity is referencing.
PySide2.Qt3DCore.Qt3DCore.QEntity.
parentEntity
(
)
¶
QEntity
Returns the parent
QEntity
instance of this entity. If the immediate parent isn’t a
QEntity
, this function traverses up the scene hierarchy until a parent
QEntity
is found. If no
QEntity
parent can be found, returns null.
PySide2.Qt3DCore.Qt3DCore.QEntity.
removeComponent
(
comp
)
¶
comp
–
QComponent
Removes the reference to
comp
.