Animation module — tween factory + 2D sprite-sheet / Spine + 3D skeletal playback (player / state machine / motion matching) + control-theory procedural drivers + motion trails + per-frame pump. Script: anim <- eve.Animation();
更多...
#include <Animation.h>
Public 成员函数 | |
| Module_REG (Animation) | |
| Animation ()=default | |
| ~Animation () override | |
| Tween * | newTween (float duration=1.f) |
| Create a tween (duration in seconds). Returned pointer is owned by script GC. | |
| SpriteSheet * | newSpriteSheet () |
| 2D sprite-sheet animation factories (script GC owns returned objects). | |
| SpriteClip * | newSpriteClip (const std::string &name="") |
| SpriteAnim * | newSpriteAnim () |
| SpineAtlas * | newSpineAtlas () |
| Spine (region attachment subset) factories. | |
| SpineSkeletonData * | newSpineSkeletonData () |
| SpineSkeleton * | newSpineSkeleton (SpineSkeletonData *data) |
| SpineAnim * | newSpineAnim (SpineSkeleton *skeleton) |
| SpineAtlas * | newSpineAtlasFromFile (const std::string &path) |
| Load helpers (allocate + parse; false → empty object still returned? prefer nullable). | |
| SpineAtlas * | newSpineAtlasFromText (const std::string &text) |
| SpineSkeletonData * | newSpineSkeletonDataFromFile (const std::string &path) |
| SpineSkeletonData * | newSpineSkeletonDataFromJson (const std::string &json) |
| AnimSkeleton * | newSkeleton () |
| 3D skeletal animation factories (script GC owns returned objects). | |
| AnimClip * | newClip (const std::string &name="") |
| AnimPose * | newPose (int boneCount=0) |
| AnimPlayer * | newPlayer (AnimSkeleton *skeleton) |
| AnimStateMachine * | newStateMachine (AnimSkeleton *skeleton) |
| MotionDatabase * | newMotionDatabase (AnimSkeleton *skeleton) |
| MotionMatcher * | newMotionMatcher (AnimSkeleton *skeleton, MotionDatabase *database) |
| ControlAnim * | newControlAnim (float frequencyHz=3.f, float dampingZeta=1.f, float response=1.f) |
| Control-theory procedural animation (second-order / spring / PD). frequencyHz: natural frequency f (Hz); dampingZeta: ζ; response: r. | |
| ControlPose * | newControlPose (AnimSkeleton *skeleton) |
| AnimSkeleton * | newSkeletonFromModel (eve::model3d::ModelData *model) |
Import skeleton/clip from Assimp-backed ModelData, or from compact .eva fixtures (see AnimImporter). | |
| AnimClip * | newClipFromModel (eve::model3d::ModelData *model, AnimSkeleton *skeleton, int animIndex=0) |
| AnimSkeleton * | newSkeletonFromEvaFile (const std::string &path) |
| AnimClip * | newClipFromEvaFile (const std::string &path) |
| AnimSkin * | newSkinFromModel (eve::model3d::ModelData *model, int meshIndex, AnimSkeleton *skeleton) |
| CPU linear-blend skin binding for a skinned mesh on ModelData. meshIndex selects the Assimp mesh; bone names must match the skeleton. | |
| AnimLattice * | newLattice (int divX=2, int divY=2, int divZ=2) |
| 3D lattice scale-deformer (晶格缩放变形). divX/divY/divZ are the control-point divisions (each >= 2). Control points are driven with setPointScale / setPointOffset; bound vertices deform via trilinear interpolation (see AnimLattice). | |
| AnimLattice * | newLatticeFromModel (eve::model3d::ModelData *model, int meshIndex, int divX=2, int divY=2, int divZ=2) |
| newLattice bound to meshIndex of model (Assimp vertices). | |
| AnimTrail * | newTrail (int capacity=64) |
| Motion trail / afterimage (script GC owns returned object). capacity: max retained samples (>= 2). | |
| void | update (float dt) |
| Advance all registered tweens, sprite anims, and spine anims. | |
| int | getTweenCount () const |
| int | getSpriteAnimCount () const |
| int | getSpineAnimCount () const |
| int | getActiveCount () const |
| void | clearFinished () |
| Drop finished/stopped entries from the registry (does not delete Tween objects). | |
| void | clearAll () |
| Detach all tweens from the registry (does not delete Tween objects). | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
友元 | |
| class | Tween |
| class | SpriteAnim |
| class | SpineAnim |
详细描述
Animation module — tween factory + 2D sprite-sheet / Spine + 3D skeletal playback (player / state machine / motion matching) + control-theory procedural drivers + motion trails + per-frame pump. Script: anim <- eve.Animation();
Tweens / SpriteAnim / SpineAnim can be advanced via anim.update(dt). Relative property changes use Tween::setDelta / setDeltaAngle.
2D: SpriteSheet + SpriteClip + SpriteAnim; Spine region subset via SpineAtlas / SpineSkeletonData / SpineSkeleton / SpineAnim.
3D: build AnimSkeleton + AnimClip, then drive with AnimPlayer, AnimStateMachine, or MotionMatcher (+ MotionDatabase). Procedural: ControlAnim (scalar second-order/PD/spring) and ControlPose (pose tracking with the same control laws). Trails: AnimTrail records samples and draws fading trajectories.
在文件 Animation.h 第 53 行定义.
构造及析构函数说明
◆ Animation()
|
default |
◆ ~Animation()
|
override |
在文件 Animation.cpp 第 66 行定义.
引用了 a.
成员函数说明
◆ clearAll()
| void eve::animation::Animation::clearAll | ( | ) |
Detach all tweens from the registry (does not delete Tween objects).
在文件 Animation.cpp 第 305 行定义.
◆ clearFinished()
| void eve::animation::Animation::clearFinished | ( | ) |
Drop finished/stopped entries from the registry (does not delete Tween objects).
在文件 Animation.cpp 第 292 行定义.
引用了 eve::animation::Tween::isFinished() , 以及 eve::animation::Tween::isStopped().
◆ getActiveCount()
| int eve::animation::Animation::getActiveCount | ( | ) | const |
在文件 Animation.cpp 第 278 行定义.
◆ getSpineAnimCount()
|
inline |
在文件 Animation.h 第 136 行定义.
◆ getSpriteAnimCount()
|
inline |
在文件 Animation.h 第 135 行定义.
◆ getTweenCount()
|
inline |
在文件 Animation.h 第 134 行定义.
◆ Module_REG()
| eve::animation::Animation::Module_REG | ( | Animation | ) |
◆ newClip()
| AnimClip * eve::animation::Animation::newClip | ( | const std::string & | name = "" | ) |
在文件 Animation.cpp 第 154 行定义.
引用了 name.
◆ newClipFromEvaFile()
| AnimClip * eve::animation::Animation::newClipFromEvaFile | ( | const std::string & | path | ) |
◆ newClipFromModel()
| AnimClip * eve::animation::Animation::newClipFromModel | ( | eve::model3d::ModelData * | model, |
| AnimSkeleton * | skeleton, | ||
| int | animIndex = 0 |
||
| ) |
在文件 Animation.cpp 第 182 行定义.
引用了 eve::animation::AnimImporter::loadClipFromModel() , 以及 model.
◆ newControlAnim()
| ControlAnim * eve::animation::Animation::newControlAnim | ( | float | frequencyHz = 3.f, |
| float | dampingZeta = 1.f, |
||
| float | response = 1.f |
||
| ) |
Control-theory procedural animation (second-order / spring / PD). frequencyHz: natural frequency f (Hz); dampingZeta: ζ; response: r.
在文件 Animation.cpp 第 172 行定义.
◆ newControlPose()
| ControlPose * eve::animation::Animation::newControlPose | ( | AnimSkeleton * | skeleton | ) |
在文件 Animation.cpp 第 176 行定义.
◆ newLattice()
| AnimLattice * eve::animation::Animation::newLattice | ( | int | divX = 2, |
| int | divY = 2, |
||
| int | divZ = 2 |
||
| ) |
3D lattice scale-deformer (晶格缩放变形). divX/divY/divZ are the control-point divisions (each >= 2). Control points are driven with setPointScale / setPointOffset; bound vertices deform via trilinear interpolation (see AnimLattice).
在文件 Animation.cpp 第 209 行定义.
◆ newLatticeFromModel()
| AnimLattice * eve::animation::Animation::newLatticeFromModel | ( | eve::model3d::ModelData * | model, |
| int | meshIndex, | ||
| int | divX = 2, |
||
| int | divY = 2, |
||
| int | divZ = 2 |
||
| ) |
newLattice bound to meshIndex of model (Assimp vertices).
在文件 Animation.cpp 第 213 行定义.
◆ newMotionDatabase()
| MotionDatabase * eve::animation::Animation::newMotionDatabase | ( | AnimSkeleton * | skeleton | ) |
在文件 Animation.cpp 第 164 行定义.
◆ newMotionMatcher()
| MotionMatcher * eve::animation::Animation::newMotionMatcher | ( | AnimSkeleton * | skeleton, |
| MotionDatabase * | database | ||
| ) |
在文件 Animation.cpp 第 168 行定义.
◆ newPlayer()
| AnimPlayer * eve::animation::Animation::newPlayer | ( | AnimSkeleton * | skeleton | ) |
在文件 Animation.cpp 第 158 行定义.
◆ newPose()
| AnimPose * eve::animation::Animation::newPose | ( | int | boneCount = 0 | ) |
在文件 Animation.cpp 第 156 行定义.
◆ newSkeleton()
| AnimSkeleton * eve::animation::Animation::newSkeleton | ( | ) |
3D skeletal animation factories (script GC owns returned objects).
在文件 Animation.cpp 第 152 行定义.
◆ newSkeletonFromEvaFile()
| AnimSkeleton * eve::animation::Animation::newSkeletonFromEvaFile | ( | const std::string & | path | ) |
在文件 Animation.cpp 第 187 行定义.
◆ newSkeletonFromModel()
| AnimSkeleton * eve::animation::Animation::newSkeletonFromModel | ( | eve::model3d::ModelData * | model | ) |
Import skeleton/clip from Assimp-backed ModelData, or from compact .eva fixtures (see AnimImporter).
在文件 Animation.cpp 第 178 行定义.
引用了 eve::animation::AnimImporter::loadSkeletonFromModel() , 以及 model.
◆ newSkinFromModel()
| AnimSkin * eve::animation::Animation::newSkinFromModel | ( | eve::model3d::ModelData * | model, |
| int | meshIndex, | ||
| AnimSkeleton * | skeleton | ||
| ) |
CPU linear-blend skin binding for a skinned mesh on ModelData. meshIndex selects the Assimp mesh; bone names must match the skeleton.
在文件 Animation.cpp 第 204 行定义.
引用了 eve::animation::AnimSkin::fromModel() , 以及 model.
◆ newSpineAnim()
| SpineAnim * eve::animation::Animation::newSpineAnim | ( | SpineSkeleton * | skeleton | ) |
在文件 Animation.cpp 第 106 行定义.
◆ newSpineAtlas()
| SpineAtlas * eve::animation::Animation::newSpineAtlas | ( | ) |
Spine (region attachment subset) factories.
在文件 Animation.cpp 第 98 行定义.
◆ newSpineAtlasFromFile()
| SpineAtlas * eve::animation::Animation::newSpineAtlasFromFile | ( | const std::string & | path | ) |
Load helpers (allocate + parse; false → empty object still returned? prefer nullable).
在文件 Animation.cpp 第 112 行定义.
◆ newSpineAtlasFromText()
| SpineAtlas * eve::animation::Animation::newSpineAtlasFromText | ( | const std::string & | text | ) |
在文件 Animation.cpp 第 122 行定义.
◆ newSpineSkeleton()
| SpineSkeleton * eve::animation::Animation::newSpineSkeleton | ( | SpineSkeletonData * | data | ) |
在文件 Animation.cpp 第 102 行定义.
引用了 data.
◆ newSpineSkeletonData()
| SpineSkeletonData * eve::animation::Animation::newSpineSkeletonData | ( | ) |
在文件 Animation.cpp 第 100 行定义.
◆ newSpineSkeletonDataFromFile()
| SpineSkeletonData * eve::animation::Animation::newSpineSkeletonDataFromFile | ( | const std::string & | path | ) |
在文件 Animation.cpp 第 132 行定义.
引用了 data.
◆ newSpineSkeletonDataFromJson()
| SpineSkeletonData * eve::animation::Animation::newSpineSkeletonDataFromJson | ( | const std::string & | json | ) |
在文件 Animation.cpp 第 142 行定义.
引用了 data.
◆ newSpriteAnim()
| SpriteAnim * eve::animation::Animation::newSpriteAnim | ( | ) |
在文件 Animation.cpp 第 92 行定义.
引用了 a , 以及 SpriteAnim.
◆ newSpriteClip()
| SpriteClip * eve::animation::Animation::newSpriteClip | ( | const std::string & | name = "" | ) |
在文件 Animation.cpp 第 90 行定义.
引用了 name.
◆ newSpriteSheet()
| SpriteSheet * eve::animation::Animation::newSpriteSheet | ( | ) |
2D sprite-sheet animation factories (script GC owns returned objects).
在文件 Animation.cpp 第 88 行定义.
◆ newStateMachine()
| AnimStateMachine * eve::animation::Animation::newStateMachine | ( | AnimSkeleton * | skeleton | ) |
在文件 Animation.cpp 第 160 行定义.
◆ newTrail()
| AnimTrail * eve::animation::Animation::newTrail | ( | int | capacity = 64 | ) |
Motion trail / afterimage (script GC owns returned object). capacity: max retained samples (>= 2).
在文件 Animation.cpp 第 218 行定义.
◆ newTween()
Create a tween (duration in seconds). Returned pointer is owned by script GC.
在文件 Animation.cpp 第 82 行定义.
引用了 Tween.
◆ update()
| void eve::animation::Animation::update | ( | float | dt | ) |
友元及相关函数文档
◆ SpineAnim
|
friend |
在文件 Animation.h 第 147 行定义.
被这些函数引用 newSpineAnim().
◆ SpriteAnim
|
friend |
在文件 Animation.h 第 146 行定义.
被这些函数引用 newSpriteAnim().
◆ Tween
|
friend |
在文件 Animation.h 第 145 行定义.
被这些函数引用 newTween().
该类的文档由以下文件生成:
- src/modules/animation/Animation.h
- src/modules/animation/Animation.cpp
Public 成员函数 继承自