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

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

#include <SpineSkeletonData.h>

struct  AnimationData
 
struct  AttachmentKey
 
struct  BoneData
 
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
 
 ~SpineSkeletonData ()=default
 
 SpineSkeletonData (const SpineSkeletonData &)=delete
 
SpineSkeletonDataoperator= (const SpineSkeletonData &)=delete
 
bool loadFromJson (const std::string &json, std::string *error=nullptr)
 
bool loadFromFile (const std::string &path, std::string *error=nullptr)
 
void clear ()
 
std::string getSpineVersion () const
 
int getBoneCount () const
 
int findBone (const std::string &name) const
 
std::string getBoneName (int index) const
 
int getBoneParent (int index) const
 
float getBoneX (int index) const
 
float getBoneY (int index) const
 
float getBoneRotation (int index) const
 
float getBoneScaleX (int index) const
 
float getBoneScaleY (int index) const
 
int getSlotCount () const
 
int findSlot (const std::string &name) const
 
std::string getSlotName (int index) const
 
int getSlotBone (int index) const
 
std::string getSlotAttachment (int index) const
 
int getSkinCount () const
 
int findSkin (const std::string &name) const
 
std::string getSkinName (int index) const
 
int getDefaultSkin () const
 
int getAnimationCount () const
 
int findAnimation (const std::string &name) const
 
std::string getAnimationName (int index) const
 
float getAnimationDuration (int index) const
 
const BoneDatabone (int i) const
 
const SlotDataslot (int i) const
 
const SkinDataskin (int i) const
 
const AnimationDataanimation (int i) const
 
const RegionAttachmentfindAttachment (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.h21 行定义.

成员类型定义说明

◆ SkinAttachments

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

slotIndex → attachmentName → region

在文件 SpineSkeletonData.h87 行定义.

构造及析构函数说明

◆ SpineSkeletonData() [1/2]

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

◆ ~SpineSkeletonData()

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

◆ SpineSkeletonData() [2/2]

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

成员函数说明

◆ animation()

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

在文件 SpineSkeletonData.h139 行定义.

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

◆ bone()

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

◆ clear()

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

在文件 SpineSkeletonData.cpp68 行定义.

被这些函数引用 loadFromJson().

◆ findAnimation()

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

在文件 SpineSkeletonData.cpp93 行定义.

引用了 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

在文件 SpineSkeletonData.cpp81 行定义.

引用了 name.

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

◆ findSkin()

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

在文件 SpineSkeletonData.cpp89 行定义.

引用了 name.

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

◆ findSlot()

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

在文件 SpineSkeletonData.cpp85 行定义.

引用了 name.

被这些函数引用 loadFromJson().

◆ getAnimationCount()

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

在文件 SpineSkeletonData.h56 行定义.

◆ getAnimationDuration()

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

在文件 SpineSkeletonData.cpp148 行定义.

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

◆ getAnimationName()

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

在文件 SpineSkeletonData.cpp144 行定义.

引用了 name.

◆ getBoneCount()

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

◆ getBoneName()

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

在文件 SpineSkeletonData.cpp98 行定义.

引用了 name.

◆ getBoneParent()

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

在文件 SpineSkeletonData.cpp102 行定义.

引用了 parent.

◆ getBoneRotation()

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

在文件 SpineSkeletonData.cpp114 行定义.

◆ getBoneScaleX()

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

在文件 SpineSkeletonData.cpp118 行定义.

◆ getBoneScaleY()

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

在文件 SpineSkeletonData.cpp122 行定义.

◆ getBoneX()

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

在文件 SpineSkeletonData.cpp106 行定义.

引用了 x.

◆ getBoneY()

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

在文件 SpineSkeletonData.cpp110 行定义.

引用了 y.

◆ getDefaultSkin()

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

◆ getSkinCount()

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

在文件 SpineSkeletonData.h51 行定义.

被这些函数引用 findAttachment().

◆ getSkinName()

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

在文件 SpineSkeletonData.cpp140 行定义.

引用了 name.

◆ getSlotAttachment()

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

在文件 SpineSkeletonData.cpp135 行定义.

◆ getSlotBone()

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

在文件 SpineSkeletonData.cpp131 行定义.

引用了 bone().

◆ getSlotCount()

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

◆ getSlotName()

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

在文件 SpineSkeletonData.cpp127 行定义.

引用了 name.

◆ getSpineVersion()

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

在文件 SpineSkeletonData.h33 行定义.

◆ loadFromFile()

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

在文件 SpineSkeletonData.cpp165 行定义.

引用了 data, error , 以及 loadFromJson().

◆ loadFromJson()

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

在文件 SpineSkeletonData.cpp188 行定义.

引用了 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::RegionAttachment::height, 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, eve::animation::SpineSkeletonData::RegionAttachment::path, eve::animation::SpineSkeletonData::BoneTimeline::rotate, eve::animation::SpineSkeletonData::RegionAttachment::rotation, s, eve::animation::SpineSkeletonData::BoneTimeline::scale, eve::animation::SpineSkeletonData::RegionAttachment::scaleX, eve::animation::SpineSkeletonData::RegionAttachment::scaleY, 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::RegionAttachment::width, eve::animation::SpineSkeletonData::RegionAttachment::x, eve::animation::SpineSkeletonData::TranslateKey::x, eve::animation::SpineSkeletonData::ScaleKey::x, eve::animation::SpineSkeletonData::RegionAttachment::y, 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.h138 行定义.

被这些函数引用 loadFromJson().

◆ slot()

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

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