CPU linear-blend skinning binding for one mesh against an AnimSkeleton. 更多...
#include <AnimSkin.h>
Public 成员函数 | |
| AnimSkin ()=default | |
| ~AnimSkin ()=default | |
| AnimSkin (const AnimSkin &)=delete | |
| AnimSkin & | operator= (const AnimSkin &)=delete |
| int | getVertexCount () const |
| int | getBoneCount () const |
| int | getInfluenceCount () const |
| int | getSkeletonBone (int skinBoneIndex) const |
| Skeleton bone index used by skin joint i (-1 if unused). | |
| std::string | getSkinBoneName (int skinBoneIndex) const |
| float | getInverseBindElement (int skinBoneIndex, int elementIndex) const |
| Inverse-bind matrix element (column-major, 0..15) for skin joint i. | |
| void | skinPositions (const AnimPose *pose, float *outPosXYZ) const |
| Linear-blend skin bind-pose positions into outPosXYZ (vertexCount*3 floats). pose must already have computeWorld(skeleton) applied and match the skeleton used at fromModel time. | |
| bool | skinPositionsTo (const AnimPose *pose, std::vector< float > &outPosXYZ) const |
| Convenience: skin into a vector sized vertexCount*3. Returns false if pose is null or bone count mismatches. | |
| bool | updateSkinnedPositions (const AnimPose *pose) |
| Skin into an internal cache readable via getSkinnedPosition*. Returns false if pose is null or there are no vertices. | |
| bool | hasSkinnedPositions () const |
| True after a successful updateSkinnedPositions(). | |
| float | getSkinnedPositionX (int vertexIndex) const |
| Cached skinned position component (requires updateSkinnedPositions). | |
| float | getSkinnedPositionY (int vertexIndex) const |
| float | getSkinnedPositionZ (int vertexIndex) const |
| float | getBindPositionX (int vertexIndex) const |
| Bind-pose (unskinned) position component for vertex v (0..vertexCount-1). | |
| float | getBindPositionY (int vertexIndex) const |
| float | getBindPositionZ (int vertexIndex) const |
| int | getVertexBone (int vertexIndex, int influenceIndex) const |
| Influence slot i (0..3) for vertex: skeleton bone index or -1. | |
| float | getVertexWeight (int vertexIndex, int influenceIndex) const |
静态 Public 成员函数 | |
| static AnimSkin * | fromModel (const model3d::ModelData *model, int meshIndex, const AnimSkeleton *skeleton) |
| Build skin binding for meshIndex on model, mapping bone names onto skeleton. Throws if the mesh has no bones or no bone names match the skeleton. Returned pointer is owned by the caller / script GC. | |
静态 Public 属性 | |
| static constexpr int | kMaxInfluences = 4 |
详细描述
CPU linear-blend skinning binding for one mesh against an AnimSkeleton.
Built from Assimp skin data on ModelData (bone names, inverse-bind matrices, per-vertex weights). Call skinPositions() after AnimPose::computeWorld().
Script type: AnimSkin.
在文件 AnimSkin.h 第 25 行定义.
构造及析构函数说明
◆ AnimSkin() [1/2]
|
default |
被这些函数引用 fromModel().
◆ ~AnimSkin()
|
default |
◆ AnimSkin() [2/2]
|
delete |
成员函数说明
◆ fromModel()
|
static |
Build skin binding for meshIndex on model, mapping bone names onto skeleton. Throws if the mesh has no bones or no bone names match the skeleton. Returned pointer is owned by the caller / script GC.
在文件 AnimSkin.cpp 第 58 行定义.
引用了 a, AnimSkin(), b, eve::animation::AnimSkeleton::findBone(), kMaxInfluences, mesh, model, name, p, v , 以及 w.
◆ getBindPositionX()
| float eve::animation::AnimSkin::getBindPositionX | ( | int | vertexIndex | ) | const |
Bind-pose (unskinned) position component for vertex v (0..vertexCount-1).
在文件 AnimSkin.cpp 第 173 行定义.
◆ getBindPositionY()
| float eve::animation::AnimSkin::getBindPositionY | ( | int | vertexIndex | ) | const |
在文件 AnimSkin.cpp 第 177 行定义.
◆ getBindPositionZ()
| float eve::animation::AnimSkin::getBindPositionZ | ( | int | vertexIndex | ) | const |
在文件 AnimSkin.cpp 第 181 行定义.
◆ getBoneCount()
|
inline |
在文件 AnimSkin.h 第 44 行定义.
◆ getInfluenceCount()
|
inline |
在文件 AnimSkin.h 第 45 行定义.
引用了 kMaxInfluences.
◆ getInverseBindElement()
| float eve::animation::AnimSkin::getInverseBindElement | ( | int | skinBoneIndex, |
| int | elementIndex | ||
| ) | const |
Inverse-bind matrix element (column-major, 0..15) for skin joint i.
在文件 AnimSkin.cpp 第 165 行定义.
引用了 m.
◆ getSkeletonBone()
| int eve::animation::AnimSkin::getSkeletonBone | ( | int | skinBoneIndex | ) | const |
Skeleton bone index used by skin joint i (-1 if unused).
在文件 AnimSkin.cpp 第 155 行定义.
◆ getSkinBoneName()
| std::string eve::animation::AnimSkin::getSkinBoneName | ( | int | skinBoneIndex | ) | const |
在文件 AnimSkin.cpp 第 160 行定义.
◆ getSkinnedPositionX()
| float eve::animation::AnimSkin::getSkinnedPositionX | ( | int | vertexIndex | ) | const |
Cached skinned position component (requires updateSkinnedPositions).
在文件 AnimSkin.cpp 第 266 行定义.
被这些函数引用 eve::particles::sampleSkinSpawn().
◆ getSkinnedPositionY()
| float eve::animation::AnimSkin::getSkinnedPositionY | ( | int | vertexIndex | ) | const |
在文件 AnimSkin.cpp 第 271 行定义.
被这些函数引用 eve::particles::sampleSkinSpawn().
◆ getSkinnedPositionZ()
| float eve::animation::AnimSkin::getSkinnedPositionZ | ( | int | vertexIndex | ) | const |
在文件 AnimSkin.cpp 第 276 行定义.
被这些函数引用 eve::particles::sampleSkinSpawn().
◆ getVertexBone()
| int eve::animation::AnimSkin::getVertexBone | ( | int | vertexIndex, |
| int | influenceIndex | ||
| ) | const |
Influence slot i (0..3) for vertex: skeleton bone index or -1.
在文件 AnimSkin.cpp 第 186 行定义.
◆ getVertexCount()
|
inline |
在文件 AnimSkin.h 第 43 行定义.
◆ getVertexWeight()
| float eve::animation::AnimSkin::getVertexWeight | ( | int | vertexIndex, |
| int | influenceIndex | ||
| ) | const |
在文件 AnimSkin.cpp 第 198 行定义.
◆ hasSkinnedPositions()
|
inline |
True after a successful updateSkinnedPositions().
在文件 AnimSkin.h 第 74 行定义.
◆ operator=()
◆ skinPositions()
| void eve::animation::AnimSkin::skinPositions | ( | const AnimPose * | pose, |
| float * | outPosXYZ | ||
| ) | const |
Linear-blend skin bind-pose positions into outPosXYZ (vertexCount*3 floats). pose must already have computeWorld(skeleton) applied and match the skeleton used at fromModel time.
在文件 AnimSkin.cpp 第 207 行定义.
引用了 px, v , 以及 eve::animation::AnimPose::world().
◆ skinPositionsTo()
| bool eve::animation::AnimSkin::skinPositionsTo | ( | const AnimPose * | pose, |
| std::vector< float > & | outPosXYZ | ||
| ) | const |
Convenience: skin into a vector sized vertexCount*3. Returns false if pose is null or bone count mismatches.
在文件 AnimSkin.cpp 第 248 行定义.
◆ updateSkinnedPositions()
| bool eve::animation::AnimSkin::updateSkinnedPositions | ( | const AnimPose * | pose | ) |
Skin into an internal cache readable via getSkinnedPosition*. Returns false if pose is null or there are no vertices.
在文件 AnimSkin.cpp 第 255 行定义.
类成员变量说明
◆ kMaxInfluences
|
staticconstexpr |
在文件 AnimSkin.h 第 27 行定义.
被这些函数引用 fromModel() , 以及 getInfluenceCount().
该类的文档由以下文件生成:
- src/modules/animation/AnimSkin.h
- src/modules/animation/AnimSkin.cpp