Qt3DAnimation::QAnimationController Class
class Qt3DAnimation::QAnimationControllerEine Controller-Klasse für Animationen. Mehr...
| Header: | #include <qanimationcontroller.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3danimation) target_link_libraries(mytarget PRIVATE Qt6::3danimation) |
| qmake: | QT += 3danimation |
| In QML: | AnimationController |
| Erbt von: | QObject |
| Status: | Technologievorschau |
Diese Klasse befindet sich in der Technologievorschau und kann sich noch ändern.
Eigenschaften
|
|
Öffentliche Funktionen
| QAnimationController(QObject *parent = nullptr) | |
| int | activeAnimationGroup() const |
| void | addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup) |
| QList<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 QList<Qt3DAnimation::QAnimationGroup *> &animationGroups) |
Öffentliche Slots
| 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) |
Signale
| 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) |
Ausführliche Beschreibung
Qt3DAnimation::QAnimationController Die Klasse steuert die Auswahl und Wiedergabe von Animationen. Die Klasse kann verwendet werden, um alle Animationen aus dem Qt3DCore::QEntity-Baum zu finden und aus den gleichnamigen Animationen „ QAnimationGroups “ zu erstellen. Der Benutzer kann festlegen, welche Animationsgruppe derzeit vom Animationscontroller gesteuert wird, indem er die aktive Animation festlegt. Die Animationsposition wird dann an diese Gruppe weitergegeben, nachdem der angegebene Positionswert anhand der Werte „ positionScale “ und „ positionOffset “ skaliert und verschoben wurde.
Hinweis: Der Animationscontroller verfügt über keinen internen Timer; stattdessen ist der Benutzer dafür verantwortlich, die Positionseigenschaft rechtzeitig zu aktualisieren.
Dokumentation der Eigenschaften
activeAnimationGroup : int
Enthält die derzeit aktive Animationsgruppe.
Zugriffsfunktionen:
| int | activeAnimationGroup() const |
| void | setActiveAnimationGroup(int index) |
Notifier-Signal:
| void | activeAnimationGroupChanged(int index) |
entity : Qt3DCore::QEntity*
Enthält die Entität, aus der die Animationen gesammelt und gruppiert werden. Wenn der Controller bereits Animationen enthält, werden diese gelöscht.
Zugriffsfunktionen:
| Qt3DCore::QEntity * | entity() const |
| void | setEntity(Qt3DCore::QEntity *entity) |
Notifier-Signal:
| void | entityChanged(Qt3DCore::QEntity *entity) |
position : float
Speichert die aktuelle Position der Animation. Wenn die Position festgelegt ist, wird sie mit „ positionScale “ bzw. „positionOffset “ skaliert und verschoben und an die aktive Animationsgruppe weitergegeben.
Zugriffsfunktionen:
| float | position() const |
| void | setPosition(float position) |
Notifier-Signal:
| void | positionChanged(float position) |
positionOffset : float
Enthält den Positionsversatz der Animation.
Zugriffsfunktionen:
| float | positionOffset() const |
| void | setPositionOffset(float offset) |
Notifier-Signal:
| void | positionOffsetChanged(float offset) |
positionScale : float
Legt den Positionsmaßstab der Animation fest.
Zugriffsfunktionen:
| float | positionScale() const |
| void | setPositionScale(float scale) |
Notifier-Signal:
| void | positionScaleChanged(float scale) |
recursive : bool
Gibt an, ob beim Erfassen von Animationen aus der Entität der Entitätsbaum rekursiv durchsucht werden soll. Ist der Wert „true“, werden die Animationen auch in den untergeordneten Entitäten der Entität gesucht. Ist der Wert „false“, wird nur die an den Controller übergebene Entität durchsucht.
Zugriffsfunktionen:
| bool | recursive() const |
| void | setRecursive(bool recursive) |
Notifier-Signal:
| void | recursiveChanged(bool recursive) |
Dokumentation der Mitgliedsfunktionen
QAnimationController::QAnimationController(QObject *parent = nullptr)
Erstellt einen neuen `QAnimationController` mit ` parent`.
void QAnimationController::addAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
Fügt den angegebenen „ animationGroup “ zum Controller hinzu.
QList<Qt3DAnimation::QAnimationGroup *> QAnimationController::animationGroupList()
Gibt die Liste der Animationsgruppen zurück, die der Controller derzeit verwaltet.
[invokable] int QAnimationController::getAnimationIndex(const QString &name) const
Gibt den Index der Animation mit ` name` zurück. Gibt -1 zurück, wenn kein ` AnimationGroup ` mit dem angegebenen Namen gefunden wird.
Hinweis: Diese Funktion kann über das Metaobjekt-System und aus QML aufgerufen werden. Siehe Q_INVOKABLE.
[invokable] Qt3DAnimation::QAnimationGroup *QAnimationController::getGroup(int index) const
Gibt das „ AnimationGroup “ mit dem angegebenen „ index “ zurück.
Hinweis: Diese Funktion kann über das Metaobjektsystem und aus QML aufgerufen werden. Siehe Q_INVOKABLE.
void QAnimationController::removeAnimationGroup(Qt3DAnimation::QAnimationGroup *animationGroup)
Entfernt das angegebene „ animationGroup “ aus dem Controller.
void QAnimationController::setAnimationGroups(const QList<Qt3DAnimation::QAnimationGroup *> &animationGroups)
Legt die „ animationGroups “ für den Controller fest. Alte Gruppen werden gelöscht.
© 2026 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.