QAbstractAnimationClip Class
(Qt3DAnimation::QAbstractAnimationClip)QAbstractAnimationClip is the base class for types providing key frame animation data. 更多...
头文件: | #include <QAbstractAnimationClip> |
qmake: | QT += 3danimation |
开始支持版本: | Qt 5.9 |
基类: | Qt3DCore::QNode |
属性
- duration : const float
- 3 个属性继承自 Qt3DCore::QNode
- 1 个属性继承自 QObject
公有函数
~QAbstractAnimationClip() | |
float | duration() const |
- 11 个公有函数继承自 Qt3DCore::QNode
- 32 个公有函数继承自 QObject
信号
void | durationChanged(float duration) |
- 4 个信号继承自 Qt3DCore::QNode
- 2 个信号继承自 QObject
其他继承的成员
- 3 个公有槽函数继承自 Qt3DCore::QNode
- 1 个公有槽函数继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 2 个受保护的函数继承自 Qt3DCore::QNode
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
QAbstractAnimationClip is the base class for types providing key frame animation data.
To utilise the key frame animation framework in the Qt 3D Animation module the animator component in use needs to be provided with the key frame animation data. The animation data is provided by one of the concrete subclasses of QAbstractAnimationClip:
QAnimationClip should be used when you want to create the animation data programmatically within your application. The actual data is set with a QAnimationClipData value type.
If you are loading baked animation data from a file, e.g. as created by an artist, then use the QAnimationClipLoader class and set its source
property.
Once the animation clip has been populated with data using the above methods, the read-only duration property will be updated by the Qt 3D Animation backend.
The typical usage of animation clips is:
auto animator = new QClipAnimator(); auto clip = new QAnimationClipLoader(); clip->setSource(QUrl::fromLocalFile("bounce.json")); animator->setClip(clip); animator->setChannelMapper(...); animator->setRunning(true);
Animation clips are also used as the leaf node values in animation blend trees:
// Create leaf nodes of blend tree auto slideClipValue = new QClipBlendValue( new QAnimationClipLoader(QUrl::fromLocalFile("slide.json"))); auto bounceClipValue = new QClipBlendValue( new QAnimationClipLoader(QUrl::fromLocalFile("bounce.json"))); // Create blend tree inner node auto additiveNode = new QAdditiveClipBlend(); additiveNode->setBaseClip(slideClipValue); additiveNode->setAdditiveClip(bounceClipValue); additiveNode->setAdditiveFactor(0.5f); // Run the animator auto animator = new QBlendedClipAnimator(); animator->setBlendTree(additiveNode); animator->setChannelMapper(...); animator->setRunning(true);
参见 QAnimationClip and QAnimationClipLoader.