Spine animation player + 2D draw collector (region attachments). 更多...
#include <SpineAnim.h>
Public 成员函数 | |
| SpineAnim (SpineSkeleton *skeleton) | |
| Spine anim. | |
| ~SpineAnim () | |
| Spine anim. | |
| SpineAnim (const SpineAnim &)=delete | |
| SpineAnim & | operator= (const SpineAnim &)=delete |
| SpineSkeleton * | getSkeleton () const |
| Returns the skeleton. | |
| void | setAtlas (SpineAtlas *atlas) |
| Sets the atlas. | |
| SpineAtlas * | getAtlas () const |
| Returns the atlas. | |
| void | setPageTexture (int pageIndex, graphics::Texture *texture) |
| Bind a GPU texture to an atlas page (by index or page image name). | |
| void | setPageTextureByName (const std::string &pageName, graphics::Texture *texture) |
| Sets the page texture by name. | |
| graphics::Texture * | getPageTexture (int pageIndex) const |
| Returns the page texture. | |
| bool | play (const std::string &animationName) |
| Play. | |
| void | stop () |
| Stops . | |
| void | pause () |
| Pause. | |
| void | resume () |
| Resume. | |
| void | setSpeed (float speed) |
| Sets the speed. | |
| float | getSpeed () const |
| Returns the speed. | |
| void | setTime (float seconds) |
| Sets the time. | |
| float | getTime () const |
| Returns the time. | |
| void | setLoop (bool loop) |
| Sets the loop. | |
| bool | getLoop () const |
| Returns the loop. | |
| void | setFlipY (bool flip) |
| When true (default), Spine Y-up is flipped for screen Y-down draw items. | |
| bool | getFlipY () const |
| Returns the flip y. | |
| void | setPosition (float x, float y) |
| Sets the position. | |
| float | getX () const |
| Returns the x. | |
| float | getY () const |
| Returns the y. | |
| void | setScale (float sx, float sy) |
| Sets the scale. | |
| float | getScaleX () const |
| Returns the scale x. | |
| float | getScaleY () const |
| Returns the scale y. | |
| void | setLayer (int layer) |
| Sets the layer. | |
| int | getLayer () const |
| Returns the layer. | |
| void | setColor (float r, float g, float b, float a=1.f) |
| Sets the color. | |
| bool | isPlaying () const |
| True when playing. | |
| bool | isPaused () const |
| True when paused. | |
| bool | isFinished () const |
| True when finished. | |
| std::string | getAnimation () const |
| Returns the animation. | |
| float | getAnimationDuration () const |
| Returns the animation duration. | |
| void | apply () |
| Apply current animation time to skeleton and update world transforms. | |
| eve::Result< void > | advance (const eve::SimulationStep &step) |
| Advance playback by one scheduler-owned deterministic step. | |
| bool | hasCurrentTick () const noexcept |
| Whether this Spine animation has consumed a scheduler step. | |
| eve::SimulationTick | currentTick () const noexcept |
| Last scheduler tick consumed by this Spine animation. | |
| bool | update (float dt) |
| Legacy seconds facade; explicitly forwards to advance(). | |
| void | collectDrawItems (std::vector< graphics::DrawItem2D > &out) |
| Append region attachment quads into the shared 2D draw queue. | |
| void | draw (graphics::Graphics *gfx) |
| Draw the current pose into an existing frame without clearing or presenting it. | |
| int | getDrawSlotCount () const |
| Query posed draw slots without textures (for unit tests). Returns number of visible region attachments after apply(). | |
| float | getDrawSlotX (int index) const |
| Returns the draw slot x. | |
| float | getDrawSlotY (int index) const |
| Returns the draw slot y. | |
| float | getDrawSlotWidth (int index) const |
| Returns the draw slot width. | |
| float | getDrawSlotHeight (int index) const |
| Returns the draw slot height. | |
| float | getDrawSlotRotation (int index) const |
| Returns the draw slot rotation. | |
| int | getDrawSlotPage (int index) const |
| Returns the draw slot page. | |
| std::string | getDrawSlotRegion (int index) const |
| Returns the draw slot region. | |
友元 | |
| class | Animation |
详细描述
Spine animation player + 2D draw collector (region attachments).
Applies bone/slot timelines onto a SpineSkeleton, then emits DrawItem2D quads for the shared 2D queue. Bind atlas page textures before collecting. Script type: SpineAnim.
在文件 SpineAnim.h 第 35 行定义.
构造及析构函数说明
◆ SpineAnim() [1/2]
|
explicit |
Spine anim.
在文件 SpineAnim.cpp 第 22 行定义.
◆ ~SpineAnim()
| eve::animation::SpineAnim::~SpineAnim | ( | ) |
Spine anim.
在文件 SpineAnim.cpp 第 26 行定义.
◆ SpineAnim() [2/2]
|
delete |
成员函数说明
◆ advance()
| eve::Result< void > eve::animation::SpineAnim::advance | ( | const eve::SimulationStep & | step | ) |
Advance playback by one scheduler-owned deterministic step.
在文件 SpineAnim.cpp 第 294 行定义.
引用了 eve::Applied, eve::Result< T >::failure(), eve::animation::detail::secondsForStep(), step, eve::Status::success() , 以及 eve::Result< T >::success().
被这些函数引用 update().
◆ apply()
| void eve::animation::SpineAnim::apply | ( | ) |
Apply current animation time to skeleton and update world transforms.
在文件 SpineAnim.cpp 第 214 行定义.
引用了 angle, eve::animation::SpineSkeletonData::animation(), eve::animation::SpineSkeletonData::SlotData::attachment, eve::animation::SpineSkeletonData::bone(), eve::animation::SpineSkeleton::getBoneLocalRotation(), eve::animation::SpineSkeleton::getBoneLocalScaleX(), eve::animation::SpineSkeleton::getBoneLocalScaleY(), eve::animation::SpineSkeleton::getBoneLocalX(), eve::animation::SpineSkeleton::getBoneLocalY(), eve::animation::SpineSkeleton::getData(), name, r, eve::animation::SpineSkeleton::setBoneLocalRotation(), eve::animation::SpineSkeleton::setBoneLocalScaleX(), eve::animation::SpineSkeleton::setBoneLocalScaleY(), eve::animation::SpineSkeleton::setBoneLocalX(), eve::animation::SpineSkeleton::setBoneLocalY(), eve::animation::SpineSkeleton::setSlotAttachmentName(), eve::animation::SpineSkeleton::setToSetupPose(), eve::animation::SpineSkeletonData::slot(), sx, sy, t, eve::animation::SpineSkeleton::updateWorldTransform(), x , 以及 y.
被这些函数引用 collectDrawItems(), play() , 以及 setTime().
◆ collectDrawItems()
| void eve::animation::SpineAnim::collectDrawItems | ( | std::vector< graphics::DrawItem2D > & | out | ) |
Append region attachment quads into the shared 2D draw queue.
在文件 SpineAnim.cpp 第 417 行定义.
引用了 apply(), eve::graphics::DrawItem2D::color, eve::graphics::DrawItem2D::depthY, getPageTexture(), eve::graphics::DrawItem2D::h, eve::graphics::DrawItem2D::hasOrder, eve::graphics::DrawItem2D::hasUV, eve::graphics::DrawItem2D::layer, eve::graphics::DrawItem2D::order, eve::graphics::DrawItem2D::receiveLight, eve::graphics::DrawItem2D::rotatedUV, eve::graphics::DrawItem2D::rotation, eve::graphics::DrawItem2D::texture, eve::graphics::DrawItem2D::u0, eve::graphics::DrawItem2D::u1, eve::graphics::DrawItem2D::v0, eve::graphics::DrawItem2D::v1, eve::graphics::DrawItem2D::w, eve::graphics::DrawItem2D::x , 以及 eve::graphics::DrawItem2D::y.
被这些函数引用 draw().
◆ currentTick()
|
inlinenoexcept |
Last scheduler tick consumed by this Spine animation.
在文件 SpineAnim.h 第 125 行定义.
◆ draw()
| void eve::animation::SpineAnim::draw | ( | graphics::Graphics * | gfx | ) |
Draw the current pose into an existing frame without clearing or presenting it.
在文件 SpineAnim.cpp 第 314 行定义.
引用了 collectDrawItems() , 以及 eve::graphics::RenderSystem::drawItems().
◆ getAnimation()
|
inline |
Returns the animation.
在文件 SpineAnim.h 第 113 行定义.
◆ getAnimationDuration()
| float eve::animation::SpineAnim::getAnimationDuration | ( | ) | const |
Returns the animation duration.
在文件 SpineAnim.cpp 第 103 行定义.
引用了 eve::animation::SpineSkeletonData::getAnimationDuration() , 以及 eve::animation::SpineSkeleton::getData().
◆ getAtlas()
|
inline |
Returns the atlas.
在文件 SpineAnim.h 第 51 行定义.
◆ getDrawSlotCount()
| int eve::animation::SpineAnim::getDrawSlotCount | ( | ) | const |
Query posed draw slots without textures (for unit tests). Returns number of visible region attachments after apply().
在文件 SpineAnim.cpp 第 460 行定义.
◆ getDrawSlotHeight()
| float eve::animation::SpineAnim::getDrawSlotHeight | ( | int | index | ) | const |
◆ getDrawSlotPage()
| int eve::animation::SpineAnim::getDrawSlotPage | ( | int | index | ) | const |
◆ getDrawSlotRegion()
| std::string eve::animation::SpineAnim::getDrawSlotRegion | ( | int | index | ) | const |
◆ getDrawSlotRotation()
| float eve::animation::SpineAnim::getDrawSlotRotation | ( | int | index | ) | const |
◆ getDrawSlotWidth()
| float eve::animation::SpineAnim::getDrawSlotWidth | ( | int | index | ) | const |
◆ getDrawSlotX()
| float eve::animation::SpineAnim::getDrawSlotX | ( | int | index | ) | const |
◆ getDrawSlotY()
| float eve::animation::SpineAnim::getDrawSlotY | ( | int | index | ) | const |
◆ getFlipY()
|
inline |
Returns the flip y.
在文件 SpineAnim.h 第 85 行定义.
◆ getLayer()
|
inline |
Returns the layer.
在文件 SpineAnim.h 第 102 行定义.
◆ getLoop()
|
inline |
Returns the loop.
在文件 SpineAnim.h 第 80 行定义.
◆ getPageTexture()
| graphics::Texture * eve::animation::SpineAnim::getPageTexture | ( | int | pageIndex | ) | const |
◆ getScaleX()
|
inline |
Returns the scale x.
在文件 SpineAnim.h 第 96 行定义.
◆ getScaleY()
|
inline |
Returns the scale y.
在文件 SpineAnim.h 第 98 行定义.
◆ getSkeleton()
|
inline |
Returns the skeleton.
在文件 SpineAnim.h 第 46 行定义.
◆ getSpeed()
|
inline |
Returns the speed.
在文件 SpineAnim.h 第 72 行定义.
◆ getTime()
|
inline |
Returns the time.
在文件 SpineAnim.h 第 76 行定义.
◆ getX()
|
inline |
Returns the x.
在文件 SpineAnim.h 第 90 行定义.
◆ getY()
|
inline |
Returns the y.
在文件 SpineAnim.h 第 92 行定义.
◆ hasCurrentTick()
|
inlinenoexcept |
Whether this Spine animation has consumed a scheduler step.
在文件 SpineAnim.h 第 123 行定义.
◆ isFinished()
|
inline |
True when finished.
在文件 SpineAnim.h 第 111 行定义.
◆ isPaused()
|
inline |
True when paused.
在文件 SpineAnim.h 第 109 行定义.
◆ isPlaying()
|
inline |
True when playing.
在文件 SpineAnim.h 第 107 行定义.
◆ operator=()
◆ pause()
| void eve::animation::SpineAnim::pause | ( | ) |
Pause.
在文件 SpineAnim.cpp 第 84 行定义.
◆ play()
| bool eve::animation::SpineAnim::play | ( | const std::string & | animationName | ) |
Play.
在文件 SpineAnim.cpp 第 61 行定义.
引用了 apply(), eve::animation::SpineSkeletonData::findAnimation(), eve::animation::SpineSkeleton::getData() , 以及 idx.
◆ resume()
| void eve::animation::SpineAnim::resume | ( | ) |
Resume.
在文件 SpineAnim.cpp 第 88 行定义.
◆ setAtlas()
| void eve::animation::SpineAnim::setAtlas | ( | SpineAtlas * | atlas | ) |
◆ setColor()
| void eve::animation::SpineAnim::setColor | ( | float | r, |
| float | g, | ||
| float | b, | ||
| float | a = 1.f |
||
| ) |
◆ setFlipY()
|
inline |
When true (default), Spine Y-up is flipped for screen Y-down draw items.
在文件 SpineAnim.h 第 83 行定义.
◆ setLayer()
|
inline |
◆ setLoop()
|
inline |
◆ setPageTexture()
| void eve::animation::SpineAnim::setPageTexture | ( | int | pageIndex, |
| graphics::Texture * | texture | ||
| ) |
Bind a GPU texture to an atlas page (by index or page image name).
在文件 SpineAnim.cpp 第 36 行定义.
引用了 eve::animation::SpineAtlas::getPageCount().
被这些函数引用 setPageTextureByName().
◆ setPageTextureByName()
| void eve::animation::SpineAnim::setPageTextureByName | ( | const std::string & | pageName, |
| graphics::Texture * | texture | ||
| ) |
Sets the page texture by name.
在文件 SpineAnim.cpp 第 45 行定义.
引用了 eve::animation::SpineAtlas::getPageCount(), eve::animation::SpineAtlas::getPageName() , 以及 setPageTexture().
◆ setPosition()
| void eve::animation::SpineAnim::setPosition | ( | float | x, |
| float | y | ||
| ) |
◆ setScale()
| void eve::animation::SpineAnim::setScale | ( | float | sx, |
| float | sy | ||
| ) |
◆ setSpeed()
| void eve::animation::SpineAnim::setSpeed | ( | float | speed | ) |
Sets the speed.
在文件 SpineAnim.cpp 第 92 行定义.
◆ setTime()
| void eve::animation::SpineAnim::setTime | ( | float | seconds | ) |
◆ stop()
| void eve::animation::SpineAnim::stop | ( | ) |
Stops .
在文件 SpineAnim.cpp 第 75 行定义.
◆ update()
| bool eve::animation::SpineAnim::update | ( | float | dt | ) |
Legacy seconds facade; explicitly forwards to advance().
在文件 SpineAnim.cpp 第 303 行定义.
引用了 advance(), eve::animation::detail::legacyStep() , 以及 step.
友元及相关函数文档
◆ Animation
|
friend |
在文件 SpineAnim.h 第 155 行定义.
该类的文档由以下文件生成:
- src/modules/animation/SpineAnim.h
- src/modules/animation/SpineAnim.cpp