AnimationController QML Type
一种用于动画的控制器类型。更多内容...
| Import Statement: | import Qt3D.Animation 2.12 |
| In C++: | QAnimationController |
| Status: | Technology preview |
此类型处于技术预览阶段,可能会有变动。
属性
- activeAnimationGroup : int
- animationGroups : list<AnimationGroup>
- entity : Entity
- position : real
- positionOffset : real
- positionScale : real
- recursive : bool
方法
- int getAnimationIndex(name)
- AnimationGroup getGroup(index)
详细说明
AnimationController 类型用于控制动画的选择和播放。 该类型可用于从实体树中查找所有动画,并根据同名动画创建AnimationGroups 。用户可通过设置“活动动画”来选择当前由该动画控制器控制的动画组。随后,动画位置会根据positionScale 和positionOffset 的值对提供的位置值进行缩放和偏移处理,最终传播到该动画组。
注意: 动画控制器没有内部计时器,用户需要负责及时更新位置属性。
属性文档
activeAnimationGroup : int
保存当前活动的动画组。
animationGroups : list<AnimationGroup>
存储控制器中的动画组列表。
entity : Entity
用于存储用于收集和分组实体动画的实体。如果控制器中已存在动画,则将其清空。
position : real
保存动画的当前位置。设置位置后,系统会使用positionScale/positionOffset 对其进行缩放和偏移,并将结果传播到活动动画组。
positionOffset : real
存储动画的位置偏移量。
positionScale : real
保存动画的缩放比例。
recursive : bool
用于控制从实体中收集动画时是否递归搜索实体树。如果设置为 true,则也会从该实体的子实体中搜索动画;如果设置为 false,则仅搜索传递给控制器的实体。
方法文档
int getAnimationIndex(name)
返回使用name 的动画索引。如果未找到名称与给定名称匹配的AnimationGroup ,则返回-1。
AnimationGroup getGroup(index)
返回具有给定index 的AnimationGroup 。
© 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.