载入中...
搜索中...
未找到
eve::animation::SpineSkeletonData类 参考

Spine skeleton JSON data (bones / slots / skins / animations). 更多...

#include <SpineSkeletonData.h>

类

struct  AnimationData
 
struct  AttachmentKey
 
struct  BoneData
 BoneData public API. 更多...
 
struct  BoneTimeline
 
struct  FloatKey
 
struct  RegionAttachment
 
struct  ScaleKey
 
struct  SkinData
 
struct  SlotData
 
struct  SlotTimeline
 
struct  TranslateKey
 

Public 类型

using SkinAttachments = std::unordered_map< int, std::unordered_map< std::string, RegionAttachment > >
 slotIndex → attachmentName → region
 

Public 成员函数

 SpineSkeletonData ()=default
 Spine skeleton data.
 
 ~SpineSkeletonData ()=default
 Spine skeleton data.
 
 SpineSkeletonData (const SpineSkeletonData &)=delete
 
SpineSkeletonData & operator= (const SpineSkeletonData &)=delete
 
bool loadFromJson (const std::string &json, std::string *error=nullptr)
 Loads from json.
 
bool loadFromFile (const std::string &path, std::string *error=nullptr)
 Loads from file.
 
void clear ()
 Clears .
 
std::string getSpineVersion () const
 Returns the spine version.
 
int getBoneCount () const
 Returns the bone count.
 
int findBone (const std::string &name) const
 Finds bone.
 
std::string getBoneName (int index) const
 Returns the bone name.
 
int getBoneParent (int index) const
 Returns the bone parent.
 
float getBoneX (int index) const
 Returns the bone x.
 
float getBoneY (int index) const
 Returns the bone y.
 
float getBoneRotation (int index) const
 Returns the bone rotation.
 
float getBoneScaleX (int index) const
 Returns the bone scale x.
 
float getBoneScaleY (int index) const
 Returns the bone scale y.
 
int getSlotCount () const
 Returns the slot count.
 
int findSlot (const std::string &name) const
 Finds slot.
 
std::string getSlotName (int index) const
 Returns the slot name.
 
int getSlotBone (int index) const
 Returns the slot bone.
 
std::string getSlotAttachment (int index) const
 Returns the slot attachment.
 
int getSkinCount () const
 Returns the skin count.
 
int findSkin (const std::string &name) const
 Finds skin.
 
std::string getSkinName (int index) const
 Returns the skin name.
 
int getDefaultSkin () const
 Returns the default skin.
 
int getAnimationCount () const
 Returns the animation count.
 
int findAnimation (const std::string &name) const
 Finds animation.
 
std::string getAnimationName (int index) const
 Returns the animation name.
 
float getAnimationDuration (int index) const
 Returns the animation duration.
 
const BoneData & bone (int i) const
 
const SlotData & slot (int i) const
 
const SkinData & skin (int i) const
 
const AnimationData & animation (int i) const
 
const RegionAttachment * findAttachment (int skinIndex, int slotIndex, const std::string &name) const
 

详细描述

Spine skeleton JSON data (bones / slots / skins / animations).

Supports a practical subset for 2D region attachments:

  • bones: name, parent, x, y, rotation, scaleX, scaleY
  • slots: name, bone, attachment
  • skins: region attachments (x/y/rotation/width/height/path)
  • animations: bone translate/rotate/scale + slot attachment timelines

Mesh / IK / path / clipping / deform are ignored (use official spine-cpp plugin for full runtime). Script type: SpineSkeletonData.

在文件 SpineSkeletonData.h 第 23 行定义.

成员类型定义说明

◆ SkinAttachments

using eve::animation::SpineSkeletonData::SkinAttachments = std::unordered_map<int, std::unordered_map<std::string, RegionAttachment> >

slotIndex → attachmentName → region

在文件 SpineSkeletonData.h 第 118 行定义.

构造及析构函数说明

◆ SpineSkeletonData() [1/2]

eve::animation::SpineSkeletonData::SpineSkeletonData ( )
default

Spine skeleton data.

◆ ~SpineSkeletonData()

eve::animation::SpineSkeletonData::~SpineSkeletonData ( )
default

Spine skeleton data.

◆ SpineSkeletonData() [2/2]

eve::animation::SpineSkeletonData::SpineSkeletonData ( const SpineSkeletonData &  )
delete

成员函数说明

◆ animation()

const AnimationData & eve::animation::SpineSkeletonData::animation ( int  i) const
inline

在文件 SpineSkeletonData.h 第 170 行定义.

被这些函数引用 eve::animation::SpineAnim::apply().

◆ bone()

const BoneData & eve::animation::SpineSkeletonData::bone ( int  i) const
inline

◆ clear()

void eve::animation::SpineSkeletonData::clear ( )

Clears .

在文件 SpineSkeletonData.cpp 第 68 行定义.

被这些函数引用 loadFromJson().

◆ findAnimation()

int eve::animation::SpineSkeletonData::findAnimation ( const std::string &  name) const

Finds animation.

在文件 SpineSkeletonData.cpp 第 93 行定义.

引用了 name.

被这些函数引用 eve::animation::SpineAnim::play().

◆ findAttachment()

const SpineSkeletonData::RegionAttachment * eve::animation::SpineSkeletonData::findAttachment ( int  skinIndex,
int  slotIndex,
const std::string &  name 
) const

◆ findBone()

int eve::animation::SpineSkeletonData::findBone ( const std::string &  name) const

Finds bone.

在文件 SpineSkeletonData.cpp 第 81 行定义.

引用了 name.

被这些函数引用 eve::particles::ParticleEmitter::attachToSpineBoneByName() , 以及 loadFromJson().

◆ findSkin()

int eve::animation::SpineSkeletonData::findSkin ( const std::string &  name) const

Finds skin.

在文件 SpineSkeletonData.cpp 第 89 行定义.

引用了 name.

被这些函数引用 loadFromJson() , 以及 eve::animation::SpineSkeleton::setSkin().

◆ findSlot()

int eve::animation::SpineSkeletonData::findSlot ( const std::string &  name) const

Finds slot.

在文件 SpineSkeletonData.cpp 第 85 行定义.

引用了 name.

被这些函数引用 loadFromJson().

◆ getAnimationCount()

int eve::animation::SpineSkeletonData::getAnimationCount ( ) const
inline

Returns the animation count.

在文件 SpineSkeletonData.h 第 83 行定义.

◆ getAnimationDuration()

float eve::animation::SpineSkeletonData::getAnimationDuration ( int  index) const

Returns the animation duration.

在文件 SpineSkeletonData.cpp 第 148 行定义.

引用了 duration , 以及 index.

被这些函数引用 eve::animation::SpineAnim::getAnimationDuration().

◆ getAnimationName()

std::string eve::animation::SpineSkeletonData::getAnimationName ( int  index) const

Returns the animation name.

在文件 SpineSkeletonData.cpp 第 144 行定义.

引用了 index , 以及 name.

◆ getBoneCount()

int eve::animation::SpineSkeletonData::getBoneCount ( ) const
inline

Returns the bone count.

在文件 SpineSkeletonData.h 第 44 行定义.

被这些函数引用 eve::animation::SpineSkeleton::setToSetupPose() , 以及 eve::animation::SpineSkeleton::SpineSkeleton().

◆ getBoneName()

std::string eve::animation::SpineSkeletonData::getBoneName ( int  index) const

Returns the bone name.

在文件 SpineSkeletonData.cpp 第 98 行定义.

引用了 index , 以及 name.

◆ getBoneParent()

int eve::animation::SpineSkeletonData::getBoneParent ( int  index) const

Returns the bone parent.

在文件 SpineSkeletonData.cpp 第 102 行定义.

引用了 index , 以及 parent.

◆ getBoneRotation()

float eve::animation::SpineSkeletonData::getBoneRotation ( int  index) const

Returns the bone rotation.

在文件 SpineSkeletonData.cpp 第 114 行定义.

引用了 index , 以及 rotation.

◆ getBoneScaleX()

float eve::animation::SpineSkeletonData::getBoneScaleX ( int  index) const

Returns the bone scale x.

在文件 SpineSkeletonData.cpp 第 118 行定义.

引用了 index.

◆ getBoneScaleY()

float eve::animation::SpineSkeletonData::getBoneScaleY ( int  index) const

Returns the bone scale y.

在文件 SpineSkeletonData.cpp 第 122 行定义.

引用了 index.

◆ getBoneX()

float eve::animation::SpineSkeletonData::getBoneX ( int  index) const

Returns the bone x.

在文件 SpineSkeletonData.cpp 第 106 行定义.

引用了 index , 以及 x.

◆ getBoneY()

float eve::animation::SpineSkeletonData::getBoneY ( int  index) const

Returns the bone y.

在文件 SpineSkeletonData.cpp 第 110 行定义.

引用了 index , 以及 y.

◆ getDefaultSkin()

int eve::animation::SpineSkeletonData::getDefaultSkin ( ) const
inline

Returns the default skin.

在文件 SpineSkeletonData.h 第 80 行定义.

被这些函数引用 eve::animation::SpineSkeleton::getSlotRegion() , 以及 eve::animation::SpineSkeleton::SpineSkeleton().

◆ getSkinCount()

int eve::animation::SpineSkeletonData::getSkinCount ( ) const
inline

Returns the skin count.

在文件 SpineSkeletonData.h 第 74 行定义.

被这些函数引用 findAttachment().

◆ getSkinName()

std::string eve::animation::SpineSkeletonData::getSkinName ( int  index) const

Returns the skin name.

在文件 SpineSkeletonData.cpp 第 140 行定义.

引用了 index , 以及 name.

◆ getSlotAttachment()

std::string eve::animation::SpineSkeletonData::getSlotAttachment ( int  index) const

Returns the slot attachment.

在文件 SpineSkeletonData.cpp 第 135 行定义.

引用了 index.

◆ getSlotBone()

int eve::animation::SpineSkeletonData::getSlotBone ( int  index) const

Returns the slot bone.

在文件 SpineSkeletonData.cpp 第 131 行定义.

引用了 bone , 以及 index.

◆ getSlotCount()

int eve::animation::SpineSkeletonData::getSlotCount ( ) const
inline

Returns the slot count.

在文件 SpineSkeletonData.h 第 63 行定义.

被这些函数引用 eve::animation::SpineSkeleton::setToSetupPose() , 以及 eve::animation::SpineSkeleton::SpineSkeleton().

◆ getSlotName()

std::string eve::animation::SpineSkeletonData::getSlotName ( int  index) const

Returns the slot name.

在文件 SpineSkeletonData.cpp 第 127 行定义.

引用了 index , 以及 name.

◆ getSpineVersion()

std::string eve::animation::SpineSkeletonData::getSpineVersion ( ) const
inline

Returns the spine version.

在文件 SpineSkeletonData.h 第 41 行定义.

◆ loadFromFile()

bool eve::animation::SpineSkeletonData::loadFromFile ( const std::string &  path,
std::string *  error = nullptr 
)

Loads from file.

在文件 SpineSkeletonData.cpp 第 165 行定义.

引用了 error, loadFromJson(), path , 以及 text.

◆ loadFromJson()

bool eve::animation::SpineSkeletonData::loadFromJson ( const std::string &  json,
std::string *  error = nullptr 
)

Loads from json.

在文件 SpineSkeletonData.cpp 第 188 行定义.

引用了 eve::animation::SpineSkeletonData::SlotTimeline::attachment, eve::animation::SpineSkeletonData::SkinData::attachments, b, eve::animation::SpineSkeletonData::BoneTimeline::boneIndex, eve::animation::SpineSkeletonData::AnimationData::bones, clear(), eve::animation::SpineSkeletonData::AnimationData::duration, error, findBone(), findSkin(), findSlot(), eve::animation::SpineSkeletonData::BoneData::name, eve::animation::SpineSkeletonData::SlotData::name, eve::animation::SpineSkeletonData::RegionAttachment::name, eve::animation::SpineSkeletonData::SkinData::name, eve::animation::SpineSkeletonData::AttachmentKey::name, eve::animation::SpineSkeletonData::AnimationData::name, parent, r, root, eve::animation::SpineSkeletonData::BoneTimeline::rotate, s, eve::animation::SpineSkeletonData::BoneTimeline::scale, skin(), eve::animation::SpineSkeletonData::SlotTimeline::slotIndex, eve::animation::SpineSkeletonData::AnimationData::slots, eve::animation::SpineSkeletonData::FloatKey::stepped, eve::animation::SpineSkeletonData::TranslateKey::stepped, eve::animation::SpineSkeletonData::ScaleKey::stepped, eve::animation::SpineSkeletonData::FloatKey::time, eve::animation::SpineSkeletonData::TranslateKey::time, eve::animation::SpineSkeletonData::ScaleKey::time, eve::animation::SpineSkeletonData::AttachmentKey::time, eve::animation::SpineSkeletonData::BoneTimeline::translate, type, eve::animation::SpineSkeletonData::FloatKey::value, eve::animation::SpineSkeletonData::TranslateKey::x, eve::animation::SpineSkeletonData::ScaleKey::x, eve::animation::SpineSkeletonData::TranslateKey::y , 以及 eve::animation::SpineSkeletonData::ScaleKey::y.

被这些函数引用 loadFromFile().

◆ operator=()

SpineSkeletonData & eve::animation::SpineSkeletonData::operator= ( const SpineSkeletonData &  )
delete

◆ skin()

const SkinData & eve::animation::SpineSkeletonData::skin ( int  i) const
inline

在文件 SpineSkeletonData.h 第 169 行定义.

被这些函数引用 loadFromJson().

◆ slot()

const SlotData & eve::animation::SpineSkeletonData::slot ( int  i) const
inline

该类的文档由以下文件生成: