载入中...
搜索中...
未找到
eve::avatar::AvatarInstance类 参考

Unified avatar instance. Kind is a string: "image" | "live2d" | "vroid". Script-facing API avoids overloads; kind-specific methods no-op / return false when unsupported. 更多...

#include <AvatarInstance.h>

Public 成员函数

 AvatarInstance (std::string kind)
 
 ~AvatarInstance ()
 
 AvatarInstance (const AvatarInstance &)=delete
 
AvatarInstanceoperator= (const AvatarInstance &)=delete
 
std::string getKind () const
 
void setPosition (float x, float y)
 
float getX () const
 
float getY () const
 
void setScale (float sx, float sy)
 
float getScaleX () const
 
float getScaleY () const
 
void setVisible (bool visible)
 
bool isVisible () const
 
void setLayer (int layer)
 
int getLayer () const
 
void setExpression (const std::string &name)
 
std::string getExpression () const
 
void setMotion (const std::string &name)
 
std::string getMotion () const
 
void setParameter (const std::string &name, float value)
 
float getParameter (const std::string &name) const
 
bool hasParameter (const std::string &name) const
 
int getParameterCount () const
 
std::string getParameterName (int index) const
 
void update (float dt)
 
void sync ()
 Push image / live2d layers into ECS or draw queues.
 
void release ()
 
bool addLayer (const std::string &name, graphics::Texture *texture, int zIndex)
 
bool setLayerTexture (const std::string &name, graphics::Texture *texture)
 
bool setLayerVisible (const std::string &name, bool visible)
 
bool setLayerOffset (const std::string &name, float ox, float oy)
 
bool setLayerColor (const std::string &name, float r, float g, float b, float a)
 
bool setLayerZ (const std::string &name, int zIndex)
 
bool setLayerSize (const std::string &name, float w, float h)
 
int getLayerCount () const
 
std::string getLayerName (int index) const
 
bool hasLayer (const std::string &name) const
 
bool defineExpression (const std::string &name, const std::string &spec)
 Spec: "eyes=1;mouth=smile;blush=0" (semicolon-separated name=value).
 
bool applyExpression (const std::string &name)
 
bool loadLive2DModel (const std::string &path)
 
std::string getLive2DBackendName () const
 
bool hasLive2DBackend () const
 
bool loadVroidModelPath (const std::string &path)
 
bool bindVroidModelData (model3d::ModelData *data)
 
int loadMorphNamesFromModel (int meshIndex=0)
 Register morph target names from ModelData as parameters (weights default 0).
 
void setMesh (graphics::Mesh *mesh)
 
void setTexture (graphics::Texture *texture)
 
void setPosition3D (float x, float y, float z)
 
void setRotation3D (float yaw, float pitch, float roll)
 
void setScale3D (float sx, float sy, float sz)
 
graphics::Renderable3DgetRenderable3D () const
 
graphics::MeshgetBoundMesh () const
 
std::string getVroidModelPath () const
 
bool bakeMorphs ()
 Push parameter weights onto Mesh morphs and bake GPU verts when possible.
 
void bindTween (animation::Tween *tween)
 Drive x/y/sx/sy and matching parameters from a Tween each update().
 
void unbindTween ()
 
animation::TweengetBoundTween () const
 

详细描述

Unified avatar instance. Kind is a string: "image" | "live2d" | "vroid". Script-facing API avoids overloads; kind-specific methods no-op / return false when unsupported.

在文件 AvatarInstance.h51 行定义.

构造及析构函数说明

◆ AvatarInstance() [1/2]

eve::avatar::AvatarInstance::AvatarInstance ( std::string  kind)
explicit

在文件 AvatarInstance.cpp49 行定义.

◆ ~AvatarInstance()

eve::avatar::AvatarInstance::~AvatarInstance ( )

在文件 AvatarInstance.cpp54 行定义.

引用了 release().

◆ AvatarInstance() [2/2]

eve::avatar::AvatarInstance::AvatarInstance ( const AvatarInstance )
delete

成员函数说明

◆ addLayer()

bool eve::avatar::AvatarInstance::addLayer ( const std::string &  name,
graphics::Texture texture,
int  zIndex 
)

◆ applyExpression()

bool eve::avatar::AvatarInstance::applyExpression ( const std::string &  name)

在文件 AvatarInstance.cpp344 行定义.

引用了 name , 以及 ok.

被这些函数引用 setExpression().

◆ bakeMorphs()

bool eve::avatar::AvatarInstance::bakeMorphs ( )

Push parameter weights onto Mesh morphs and bake GPU verts when possible.

在文件 AvatarInstance.cpp490 行定义.

引用了 eve::graphics::Mesh::isMorphDirty().

◆ bindTween()

void eve::avatar::AvatarInstance::bindTween ( animation::Tween tween)

Drive x/y/sx/sy and matching parameters from a Tween each update().

在文件 AvatarInstance.cpp177 行定义.

◆ bindVroidModelData()

bool eve::avatar::AvatarInstance::bindVroidModelData ( model3d::ModelData data)

在文件 AvatarInstance.cpp421 行定义.

引用了 data , 以及 loadMorphNamesFromModel().

◆ defineExpression()

bool eve::avatar::AvatarInstance::defineExpression ( const std::string &  name,
const std::string &  spec 
)

Spec: "eyes=1;mouth=smile;blush=0" (semicolon-separated name=value).

在文件 AvatarInstance.cpp291 行定义.

引用了 name.

◆ getBoundMesh()

graphics::Mesh * eve::avatar::AvatarInstance::getBoundMesh ( ) const

在文件 AvatarInstance.cpp480 行定义.

◆ getBoundTween()

animation::Tween * eve::avatar::AvatarInstance::getBoundTween ( ) const
inline

在文件 AvatarInstance.h133 行定义.

◆ getExpression()

std::string eve::avatar::AvatarInstance::getExpression ( ) const
inline

在文件 AvatarInstance.h76 行定义.

◆ getKind()

std::string eve::avatar::AvatarInstance::getKind ( ) const
inline

在文件 AvatarInstance.h59 行定义.

◆ getLayer()

int eve::avatar::AvatarInstance::getLayer ( ) const
inline

在文件 AvatarInstance.h73 行定义.

◆ getLayerCount()

int eve::avatar::AvatarInstance::getLayerCount ( ) const

在文件 AvatarInstance.cpp282 行定义.

◆ getLayerName()

std::string eve::avatar::AvatarInstance::getLayerName ( int  index) const

在文件 AvatarInstance.cpp284 行定义.

◆ getLive2DBackendName()

std::string eve::avatar::AvatarInstance::getLive2DBackendName ( ) const

◆ getMotion()

std::string eve::avatar::AvatarInstance::getMotion ( ) const
inline

在文件 AvatarInstance.h79 行定义.

◆ getParameter()

float eve::avatar::AvatarInstance::getParameter ( const std::string &  name) const

在文件 AvatarInstance.cpp141 行定义.

引用了 eve::avatar::ILive2DBackend::getParameter() , 以及 name.

◆ getParameterCount()

int eve::avatar::AvatarInstance::getParameterCount ( ) const

在文件 AvatarInstance.cpp154 行定义.

◆ getParameterName()

std::string eve::avatar::AvatarInstance::getParameterName ( int  index) const

在文件 AvatarInstance.cpp156 行定义.

◆ getRenderable3D()

graphics::Renderable3D * eve::avatar::AvatarInstance::getRenderable3D ( ) const
inline

在文件 AvatarInstance.h123 行定义.

◆ getScaleX()

float eve::avatar::AvatarInstance::getScaleX ( ) const
inline

在文件 AvatarInstance.h66 行定义.

◆ getScaleY()

float eve::avatar::AvatarInstance::getScaleY ( ) const
inline

在文件 AvatarInstance.h67 行定义.

◆ getVroidModelPath()

std::string eve::avatar::AvatarInstance::getVroidModelPath ( ) const
inline

在文件 AvatarInstance.h125 行定义.

◆ getX()

float eve::avatar::AvatarInstance::getX ( ) const
inline

在文件 AvatarInstance.h62 行定义.

◆ getY()

float eve::avatar::AvatarInstance::getY ( ) const
inline

在文件 AvatarInstance.h63 行定义.

◆ hasLayer()

bool eve::avatar::AvatarInstance::hasLayer ( const std::string &  name) const

在文件 AvatarInstance.cpp289 行定义.

引用了 name.

◆ hasLive2DBackend()

bool eve::avatar::AvatarInstance::hasLive2DBackend ( ) const

◆ hasParameter()

bool eve::avatar::AvatarInstance::hasParameter ( const std::string &  name) const

在文件 AvatarInstance.cpp147 行定义.

引用了 name.

被这些函数引用 loadMorphNamesFromModel().

◆ isVisible()

bool eve::avatar::AvatarInstance::isVisible ( ) const
inline

在文件 AvatarInstance.h70 行定义.

◆ loadLive2DModel()

bool eve::avatar::AvatarInstance::loadLive2DModel ( const std::string &  path)

◆ loadMorphNamesFromModel()

int eve::avatar::AvatarInstance::loadMorphNamesFromModel ( int  meshIndex = 0)

Register morph target names from ModelData as parameters (weights default 0).

在文件 AvatarInstance.cpp428 行定义.

引用了 eve::model3d::ModelData::getMorphTargetCount(), eve::model3d::ModelData::getMorphTargetName(), hasParameter(), n , 以及 name.

被这些函数引用 bindVroidModelData().

◆ loadVroidModelPath()

bool eve::avatar::AvatarInstance::loadVroidModelPath ( const std::string &  path)

在文件 AvatarInstance.cpp415 行定义.

◆ operator=()

AvatarInstance & eve::avatar::AvatarInstance::operator= ( const AvatarInstance )
delete

◆ release()

void eve::avatar::AvatarInstance::release ( )

在文件 AvatarInstance.cpp56 行定义.

被这些函数引用 ~AvatarInstance().

◆ setExpression()

◆ setLayer()

void eve::avatar::AvatarInstance::setLayer ( int  layer)

在文件 AvatarInstance.cpp80 行定义.

引用了 layer.

◆ setLayerColor()

bool eve::avatar::AvatarInstance::setLayerColor ( const std::string &  name,
float  r,
float  g,
float  b,
float  a 
)

在文件 AvatarInstance.cpp257 行定义.

引用了 a, b , 以及 name.

◆ setLayerOffset()

bool eve::avatar::AvatarInstance::setLayerOffset ( const std::string &  name,
float  ox,
float  oy 
)

在文件 AvatarInstance.cpp249 行定义.

引用了 name.

◆ setLayerSize()

bool eve::avatar::AvatarInstance::setLayerSize ( const std::string &  name,
float  w,
float  h 
)

在文件 AvatarInstance.cpp274 行定义.

引用了 h, name , 以及 w.

◆ setLayerTexture()

bool eve::avatar::AvatarInstance::setLayerTexture ( const std::string &  name,
graphics::Texture texture 
)

◆ setLayerVisible()

bool eve::avatar::AvatarInstance::setLayerVisible ( const std::string &  name,
bool  visible 
)

在文件 AvatarInstance.cpp242 行定义.

引用了 name.

◆ setLayerZ()

bool eve::avatar::AvatarInstance::setLayerZ ( const std::string &  name,
int  zIndex 
)

在文件 AvatarInstance.cpp267 行定义.

引用了 name.

◆ setMesh()

void eve::avatar::AvatarInstance::setMesh ( graphics::Mesh mesh)

在文件 AvatarInstance.cpp443 行定义.

引用了 mesh, name , 以及 eve::graphics::Renderable3D::setMesh().

◆ setMotion()

void eve::avatar::AvatarInstance::setMotion ( const std::string &  name)

◆ setParameter()

void eve::avatar::AvatarInstance::setParameter ( const std::string &  name,
float  value 
)

◆ setPosition()

void eve::avatar::AvatarInstance::setPosition ( float  x,
float  y 
)

在文件 AvatarInstance.cpp68 行定义.

引用了 x , 以及 y.

◆ setPosition3D()

void eve::avatar::AvatarInstance::setPosition3D ( float  x,
float  y,
float  z 
)

在文件 AvatarInstance.cpp462 行定义.

引用了 x, y , 以及 z.

◆ setRotation3D()

void eve::avatar::AvatarInstance::setRotation3D ( float  yaw,
float  pitch,
float  roll 
)

在文件 AvatarInstance.cpp468 行定义.

◆ setScale()

void eve::avatar::AvatarInstance::setScale ( float  sx,
float  sy 
)

在文件 AvatarInstance.cpp73 行定义.

◆ setScale3D()

void eve::avatar::AvatarInstance::setScale3D ( float  sx,
float  sy,
float  sz 
)

在文件 AvatarInstance.cpp474 行定义.

◆ setTexture()

void eve::avatar::AvatarInstance::setTexture ( graphics::Texture texture)

◆ setVisible()

void eve::avatar::AvatarInstance::setVisible ( bool  visible)

在文件 AvatarInstance.cpp78 行定义.

◆ sync()

void eve::avatar::AvatarInstance::sync ( )

Push image / live2d layers into ECS or draw queues.

在文件 AvatarInstance.cpp170 行定义.

◆ unbindTween()

void eve::avatar::AvatarInstance::unbindTween ( )

在文件 AvatarInstance.cpp179 行定义.

◆ update()

void eve::avatar::AvatarInstance::update ( float  dt)

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