A controller class for animations 更多...
| 頭: | #include <QAnimationController> |
| qmake: | QT += 3danimation |
| Since: | Qt 5.9 |
| 實例化: | AnimationController |
| 繼承: | QObject |
|
|
| QAnimationController (QObject * parent = nullptr) | |
| int | activeAnimationGroup () const |
| void | addAnimationGroup (Qt3DAnimation::QAnimationGroup * animationGroup ) |
| QVector<Qt3DAnimation::QAnimationGroup *> | animationGroupList () |
| Qt3DCore::QEntity * | entity () const |
| int | getAnimationIndex (const QString & name ) const |
| Qt3DAnimation::QAnimationGroup * | getGroup (int index ) const |
| float | position () const |
| float | positionOffset () const |
| float | positionScale () const |
| bool | recursive () const |
| void | removeAnimationGroup (Qt3DAnimation::QAnimationGroup * animationGroup ) |
| void | setAnimationGroups (const QVector<Qt3DAnimation::QAnimationGroup *> & animationGroups ) |
| void | setActiveAnimationGroup (int index ) |
| void | setEntity (Qt3DCore::QEntity * entity ) |
| void | setPosition (float position ) |
| void | setPositionOffset (float offset ) |
| void | setPositionScale (float scale ) |
| void | setRecursive (bool recursive ) |
| void | activeAnimationGroupChanged (int index ) |
| void | entityChanged (Qt3DCore::QEntity * entity ) |
| void | positionChanged (float position ) |
| void | positionOffsetChanged (float offset ) |
| void | positionScaleChanged (float scale ) |
| void | recursiveChanged (bool recursive ) |
A controller class for animations
Qt3DAnimation::QAnimationController class controls the selection and playback of animations. The class can be used to find all animations from Qt3DCore::QEntity tree and create QAnimationGroups from the animations with the same name. The user can select which animation group is currently controlled with the animation controller by setting the active animation. The animation position is then propagated to that group after scaling and offsetting the provided position value with the positionScale and positionOffset 值。
注意: that the animation controller doesn't have internal timer, but instead the user is responsible for updating the position property in timely manner.
Holds the currectly active animation group.
訪問函數:
| int | activeAnimationGroup () const |
| void | setActiveAnimationGroup (int index ) |
通知程序信號:
| void | activeAnimationGroupChanged (int index ) |
Holds the entity animations are gathered and grouped from. If the controller already holds animations, they are cleared.
訪問函數:
| Qt3DCore::QEntity * | entity () const |
| void | setEntity (Qt3DCore::QEntity * entity ) |
通知程序信號:
| void | entityChanged (Qt3DCore::QEntity * entity ) |
Holds the current position of the animation. When the position is set, it is scaled and offset with positionScale / positionOffset and propagated to the active animation group.
訪問函數:
| float | position () const |
| void | setPosition (float position ) |
通知程序信號:
| void | positionChanged (float position ) |
Holds the position offset of the animation.
訪問函數:
| float | positionOffset () const |
| void | setPositionOffset (float offset ) |
通知程序信號:
| void | positionOffsetChanged (float offset ) |
Holds the position scale of the animation.
訪問函數:
| float | positionScale () const |
| void | setPositionScale (float scale ) |
通知程序信號:
| void | positionScaleChanged (float scale ) |
Holds whether the recursively search the entity tree when gathering animations from the entity. If set to true, the animations are searched also from the child entities of the entity. If set to false, only the entity passed to the controller is searched.
訪問函數:
| bool | recursive () const |
| void | setRecursive (bool recursive ) |
通知程序信號:
| void | recursiveChanged (bool recursive ) |
構造新的 QAnimationController with parent .
添加給定 animationGroup to the controller.
Returns the list of animation groups the conroller is currently holding.
Returns the index of the animation with name . Returns -1 if no AnimationGroup with the given name is found.
返迴 AnimationGroup 采用給定 index .
移除給定 animationGroup from the controller.
設置 animationGroups for the controller. Old groups are cleared.