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 | |
| AvatarInstance & | operator= (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::Renderable3D * | getRenderable3D () const |
| graphics::Mesh * | getBoundMesh () 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::Tween * | getBoundTween () 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.h 第 51 行定义.
构造及析构函数说明
◆ AvatarInstance() [1/2]
|
explicit |
在文件 AvatarInstance.cpp 第 49 行定义.
◆ ~AvatarInstance()
| eve::avatar::AvatarInstance::~AvatarInstance | ( | ) |
在文件 AvatarInstance.cpp 第 54 行定义.
引用了 release().
◆ AvatarInstance() [2/2]
|
delete |
成员函数说明
◆ addLayer()
| bool eve::avatar::AvatarInstance::addLayer | ( | const std::string & | name, |
| graphics::Texture * | texture, | ||
| int | zIndex | ||
| ) |
在文件 AvatarInstance.cpp 第 217 行定义.
引用了 eve::graphics::Texture::getHeight(), eve::graphics::Texture::getWidth() , 以及 name.
◆ applyExpression()
| bool eve::avatar::AvatarInstance::applyExpression | ( | const std::string & | name | ) |
◆ bakeMorphs()
| bool eve::avatar::AvatarInstance::bakeMorphs | ( | ) |
Push parameter weights onto Mesh morphs and bake GPU verts when possible.
在文件 AvatarInstance.cpp 第 490 行定义.
◆ bindTween()
| void eve::avatar::AvatarInstance::bindTween | ( | animation::Tween * | tween | ) |
Drive x/y/sx/sy and matching parameters from a Tween each update().
在文件 AvatarInstance.cpp 第 177 行定义.
◆ bindVroidModelData()
| bool eve::avatar::AvatarInstance::bindVroidModelData | ( | model3d::ModelData * | data | ) |
在文件 AvatarInstance.cpp 第 421 行定义.
引用了 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.cpp 第 291 行定义.
引用了 name.
◆ getBoundMesh()
| graphics::Mesh * eve::avatar::AvatarInstance::getBoundMesh | ( | ) | const |
在文件 AvatarInstance.cpp 第 480 行定义.
◆ getBoundTween()
|
inline |
在文件 AvatarInstance.h 第 133 行定义.
◆ getExpression()
|
inline |
在文件 AvatarInstance.h 第 76 行定义.
◆ getKind()
|
inline |
在文件 AvatarInstance.h 第 59 行定义.
◆ getLayer()
|
inline |
在文件 AvatarInstance.h 第 73 行定义.
◆ getLayerCount()
| int eve::avatar::AvatarInstance::getLayerCount | ( | ) | const |
在文件 AvatarInstance.cpp 第 282 行定义.
◆ getLayerName()
| std::string eve::avatar::AvatarInstance::getLayerName | ( | int | index | ) | const |
在文件 AvatarInstance.cpp 第 284 行定义.
◆ getLive2DBackendName()
| std::string eve::avatar::AvatarInstance::getLive2DBackendName | ( | ) | const |
◆ getMotion()
|
inline |
在文件 AvatarInstance.h 第 79 行定义.
◆ getParameter()
| float eve::avatar::AvatarInstance::getParameter | ( | const std::string & | name | ) | const |
在文件 AvatarInstance.cpp 第 141 行定义.
◆ getParameterCount()
| int eve::avatar::AvatarInstance::getParameterCount | ( | ) | const |
在文件 AvatarInstance.cpp 第 154 行定义.
◆ getParameterName()
| std::string eve::avatar::AvatarInstance::getParameterName | ( | int | index | ) | const |
在文件 AvatarInstance.cpp 第 156 行定义.
◆ getRenderable3D()
|
inline |
在文件 AvatarInstance.h 第 123 行定义.
◆ getScaleX()
|
inline |
在文件 AvatarInstance.h 第 66 行定义.
◆ getScaleY()
|
inline |
在文件 AvatarInstance.h 第 67 行定义.
◆ getVroidModelPath()
|
inline |
在文件 AvatarInstance.h 第 125 行定义.
◆ getX()
|
inline |
在文件 AvatarInstance.h 第 62 行定义.
◆ getY()
|
inline |
在文件 AvatarInstance.h 第 63 行定义.
◆ hasLayer()
| bool eve::avatar::AvatarInstance::hasLayer | ( | const std::string & | name | ) | const |
在文件 AvatarInstance.cpp 第 289 行定义.
引用了 name.
◆ hasLive2DBackend()
| bool eve::avatar::AvatarInstance::hasLive2DBackend | ( | ) | const |
在文件 AvatarInstance.cpp 第 411 行定义.
◆ hasParameter()
| bool eve::avatar::AvatarInstance::hasParameter | ( | const std::string & | name | ) | const |
◆ isVisible()
|
inline |
在文件 AvatarInstance.h 第 70 行定义.
◆ 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.cpp 第 428 行定义.
引用了 eve::model3d::ModelData::getMorphTargetCount(), eve::model3d::ModelData::getMorphTargetName(), hasParameter(), n , 以及 name.
被这些函数引用 bindVroidModelData().
◆ loadVroidModelPath()
| bool eve::avatar::AvatarInstance::loadVroidModelPath | ( | const std::string & | path | ) |
在文件 AvatarInstance.cpp 第 415 行定义.
◆ operator=()
|
delete |
◆ release()
| void eve::avatar::AvatarInstance::release | ( | ) |
在文件 AvatarInstance.cpp 第 56 行定义.
被这些函数引用 ~AvatarInstance().
◆ setExpression()
| void eve::avatar::AvatarInstance::setExpression | ( | const std::string & | name | ) |
◆ setLayer()
| void eve::avatar::AvatarInstance::setLayer | ( | int | layer | ) |
在文件 AvatarInstance.cpp 第 80 行定义.
引用了 layer.
◆ setLayerColor()
| bool eve::avatar::AvatarInstance::setLayerColor | ( | const std::string & | name, |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a | ||
| ) |
在文件 AvatarInstance.cpp 第 257 行定义.
◆ setLayerOffset()
| bool eve::avatar::AvatarInstance::setLayerOffset | ( | const std::string & | name, |
| float | ox, | ||
| float | oy | ||
| ) |
在文件 AvatarInstance.cpp 第 249 行定义.
引用了 name.
◆ setLayerSize()
| bool eve::avatar::AvatarInstance::setLayerSize | ( | const std::string & | name, |
| float | w, | ||
| float | h | ||
| ) |
在文件 AvatarInstance.cpp 第 274 行定义.
◆ setLayerTexture()
| bool eve::avatar::AvatarInstance::setLayerTexture | ( | const std::string & | name, |
| graphics::Texture * | texture | ||
| ) |
在文件 AvatarInstance.cpp 第 231 行定义.
引用了 eve::graphics::Texture::getHeight(), eve::graphics::Texture::getWidth() , 以及 name.
◆ setLayerVisible()
| bool eve::avatar::AvatarInstance::setLayerVisible | ( | const std::string & | name, |
| bool | visible | ||
| ) |
在文件 AvatarInstance.cpp 第 242 行定义.
引用了 name.
◆ setLayerZ()
| bool eve::avatar::AvatarInstance::setLayerZ | ( | const std::string & | name, |
| int | zIndex | ||
| ) |
在文件 AvatarInstance.cpp 第 267 行定义.
引用了 name.
◆ setMesh()
| void eve::avatar::AvatarInstance::setMesh | ( | graphics::Mesh * | mesh | ) |
在文件 AvatarInstance.cpp 第 443 行定义.
引用了 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.cpp 第 68 行定义.
◆ setPosition3D()
| void eve::avatar::AvatarInstance::setPosition3D | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
在文件 AvatarInstance.cpp 第 462 行定义.
◆ setRotation3D()
| void eve::avatar::AvatarInstance::setRotation3D | ( | float | yaw, |
| float | pitch, | ||
| float | roll | ||
| ) |
在文件 AvatarInstance.cpp 第 468 行定义.
◆ setScale()
| void eve::avatar::AvatarInstance::setScale | ( | float | sx, |
| float | sy | ||
| ) |
在文件 AvatarInstance.cpp 第 73 行定义.
◆ setScale3D()
| void eve::avatar::AvatarInstance::setScale3D | ( | float | sx, |
| float | sy, | ||
| float | sz | ||
| ) |
在文件 AvatarInstance.cpp 第 474 行定义.
◆ setTexture()
| void eve::avatar::AvatarInstance::setTexture | ( | graphics::Texture * | texture | ) |
在文件 AvatarInstance.cpp 第 456 行定义.
◆ setVisible()
| void eve::avatar::AvatarInstance::setVisible | ( | bool | visible | ) |
在文件 AvatarInstance.cpp 第 78 行定义.
◆ sync()
| void eve::avatar::AvatarInstance::sync | ( | ) |
Push image / live2d layers into ECS or draw queues.
在文件 AvatarInstance.cpp 第 170 行定义.
◆ unbindTween()
| void eve::avatar::AvatarInstance::unbindTween | ( | ) |
在文件 AvatarInstance.cpp 第 179 行定义.
◆ update()
| void eve::avatar::AvatarInstance::update | ( | float | dt | ) |
该类的文档由以下文件生成:
- src/modules/avatar/AvatarInstance.h
- src/modules/avatar/AvatarInstance.cpp