CPU-side decoded 3D model (Assimp scene owned via medialoader::ModelScene). Does not upload to GPU — use graphics::Graphics::newMeshFromAssimp on getMesh(). 更多...
#include <ModelData.h>
Public 成员函数 | |
| ModelData (medialoader::ModelScene scene, std::string uri="") | |
| ~ModelData () override | |
| bool | empty () const |
| int | getMeshCount () const |
| int | getMaterialCount () const |
| int | getVertexCount (int meshIndex) const |
| int | getFaceCount (int meshIndex) const |
| bool | hasNormals (int meshIndex) const |
| bool | hasTexCoords (int meshIndex) const |
| int | getMaterialIndex (int meshIndex) const |
| Assimp material slot referenced by a mesh; -1 when invalid. | |
| std::string | getMaterialName (int matIndex) const |
| float | getMaterialBaseColorR (int matIndex) const |
| Base color: glTF BASE_COLOR, falling back to OBJ/legacy DIFFUSE. | |
| float | getMaterialBaseColorG (int matIndex) const |
| float | getMaterialBaseColorB (int matIndex) const |
| float | getMaterialBaseColorA (int matIndex) const |
| float | getMaterialMetallicFactor (int matIndex) const |
| PBR factors; defaults 0 (metallic) / 0.45 (roughness) when absent. | |
| float | getMaterialRoughnessFactor (int matIndex) const |
| float | getMaterialOpacity (int matIndex) const |
| bool | getMaterialTwoSided (int matIndex) const |
| int | getMaterialTextureSlotCount (int matIndex, const std::string &type) const |
| Texture type names (Squirrel strings): "base_color", "diffuse", "normals", "height", "emissive", "metalness", "roughness", "ambient_occlusion", "lightmap", "opacity", "specular", "shininess". | |
| std::string | getMaterialTexturePath (int matIndex, const std::string &type, int slot=0) const |
| External file path, or "*N" for an embedded texture. Empty when absent. | |
| int | getMaterialTextureEmbeddedIndex (int matIndex, const std::string &type, int slot=0) const |
| Scene texture index for embedded "*N" references; -1 for external files. | |
| int | getEmbeddedTextureCount () const |
| std::string | getEmbeddedTextureName (int idx) const |
| int | getEmbeddedTextureWidth (int idx) const |
| int | getEmbeddedTextureHeight (int idx) const |
| 0 means a compressed blob (use getEmbeddedTextureImageData to decode). | |
| image::ImageData * | getEmbeddedTextureImageData (int idx) const |
| int | getMorphTargetCount (int meshIndex) const |
| Assimp morph / blend-shape targets on a mesh (aiAnimMesh). | |
| std::string | getMorphTargetName (int meshIndex, int morphIndex) const |
| bool | hasBones (int meshIndex) const |
| Assimp skeletal skin data (aiBone / vertex weights) on a mesh. | |
| int | getBoneCount (int meshIndex) const |
| std::string | getBoneName (int meshIndex, int boneIndex) const |
| float | getInverseBindMatrixElement (int meshIndex, int boneIndex, int elementIndex) const |
| Inverse-bind (offset) matrix element, column-major, elementIndex in [0,15]. | |
| int | getBoneWeightCount (int meshIndex, int boneIndex) const |
| int | getBoneWeightVertex (int meshIndex, int boneIndex, int weightIndex) const |
| float | getBoneWeightValue (int meshIndex, int boneIndex, int weightIndex) const |
| int | getAnimationCount () const |
| Scene-level animation clips (aiAnimation). | |
| std::string | getAnimationName (int animIndex) const |
| const aiScene * | getScene () const |
| const aiMesh * | getMesh (int meshIndex) const |
| void | adopt (eve::Resource &replacement) override |
Replace this scene with replacement's (cache reload). | |
Public 成员函数 继承自 eve::Resource | |
| virtual | ~Resource () |
| std::string | getUri () const |
| std::vector< eve::ref< Resource > > | getDependencies () const |
| virtual void | addDependency (eve::ref< Resource > resource) |
Public 成员函数 继承自 eve::Object | |
| Object () | |
| void | setUpdate (Object *update) |
| Update the current object with a replacement. You don't need to care about the reference to the old object since it will be automatically updated in the ref smart pointer. | |
额外继承的成员函数 | |
Protected 成员函数 继承自 eve::Resource | |
| Resource (std::string uri) | |
| void | setUri (std::string value) |
| Set the resource URI (the cache key). Used by ResourceManager. | |
Protected 成员函数 继承自 eve::Object | |
| virtual | ~Object () |
| bool | isDirty () const |
| Object * | getUpdate () const |
| void | ref () |
| void | unref () |
Protected 属性 继承自 eve::Resource | |
| std::string | uri |
| std::vector< eve::ref< Resource > > | dependencies |
Protected 属性 继承自 eve::Object | |
| Object * | update |
| unsigned | ref_count = 0 |
详细描述
CPU-side decoded 3D model (Assimp scene owned via medialoader::ModelScene). Does not upload to GPU — use graphics::Graphics::newMeshFromAssimp on getMesh().
在文件 ModelData.h 第 23 行定义.
构造及析构函数说明
◆ ModelData()
|
explicit |
在文件 ModelData.cpp 第 53 行定义.
◆ ~ModelData()
|
overridedefault |
成员函数说明
◆ adopt()
|
overridevirtual |
Replace this scene with replacement's (cache reload).
实现了 eve::Resource.
在文件 ModelData.cpp 第 58 行定义.
◆ empty()
| bool eve::model3d::ModelData::empty | ( | ) | const |
在文件 ModelData.cpp 第 63 行定义.
◆ getAnimationCount()
| int eve::model3d::ModelData::getAnimationCount | ( | ) | const |
◆ getAnimationName()
| std::string eve::model3d::ModelData::getAnimationName | ( | int | animIndex | ) | const |
在文件 ModelData.cpp 第 372 行定义.
引用了 a , 以及 getScene().
◆ getBoneCount()
| int eve::model3d::ModelData::getBoneCount | ( | int | meshIndex | ) | const |
在文件 ModelData.cpp 第 298 行定义.
引用了 m.
◆ getBoneName()
| std::string eve::model3d::ModelData::getBoneName | ( | int | meshIndex, |
| int | boneIndex | ||
| ) | const |
在文件 ModelData.cpp 第 305 行定义.
◆ getBoneWeightCount()
| int eve::model3d::ModelData::getBoneWeightCount | ( | int | meshIndex, |
| int | boneIndex | ||
| ) | const |
在文件 ModelData.cpp 第 339 行定义.
◆ getBoneWeightValue()
| float eve::model3d::ModelData::getBoneWeightValue | ( | int | meshIndex, |
| int | boneIndex, | ||
| int | weightIndex | ||
| ) | const |
在文件 ModelData.cpp 第 357 行定义.
◆ getBoneWeightVertex()
| int eve::model3d::ModelData::getBoneWeightVertex | ( | int | meshIndex, |
| int | boneIndex, | ||
| int | weightIndex | ||
| ) | const |
在文件 ModelData.cpp 第 347 行定义.
◆ getEmbeddedTextureCount()
| int eve::model3d::ModelData::getEmbeddedTextureCount | ( | ) | const |
在文件 ModelData.cpp 第 218 行定义.
引用了 getScene().
◆ getEmbeddedTextureHeight()
| int eve::model3d::ModelData::getEmbeddedTextureHeight | ( | int | idx | ) | const |
0 means a compressed blob (use getEmbeddedTextureImageData to decode).
在文件 ModelData.cpp 第 239 行定义.
引用了 getScene() , 以及 idx.
◆ getEmbeddedTextureImageData()
| image::ImageData * eve::model3d::ModelData::getEmbeddedTextureImageData | ( | int | idx | ) | const |
Decode an embedded texture to RGBA8 ImageData (caller owns the result). Compressed blobs (PNG/JPEG/...) go through the image module; raw BGRA texels (mHeight > 0) are converted in place. Returns nullptr on failure.
在文件 ModelData.cpp 第 246 行定义.
引用了 getScene(), h, idx , 以及 w.
◆ getEmbeddedTextureName()
| std::string eve::model3d::ModelData::getEmbeddedTextureName | ( | int | idx | ) | const |
在文件 ModelData.cpp 第 223 行定义.
引用了 getScene() , 以及 idx.
◆ getEmbeddedTextureWidth()
| int eve::model3d::ModelData::getEmbeddedTextureWidth | ( | int | idx | ) | const |
在文件 ModelData.cpp 第 232 行定义.
引用了 getScene() , 以及 idx.
◆ getFaceCount()
| int eve::model3d::ModelData::getFaceCount | ( | int | meshIndex | ) | const |
在文件 ModelData.cpp 第 104 行定义.
引用了 m.
◆ getInverseBindMatrixElement()
| float eve::model3d::ModelData::getInverseBindMatrixElement | ( | int | meshIndex, |
| int | boneIndex, | ||
| int | elementIndex | ||
| ) | const |
Inverse-bind (offset) matrix element, column-major, elementIndex in [0,15].
在文件 ModelData.cpp 第 314 行定义.
◆ getMaterialBaseColorA()
| float eve::model3d::ModelData::getMaterialBaseColorA | ( | int | matIndex | ) | const |
在文件 ModelData.cpp 第 151 行定义.
◆ getMaterialBaseColorB()
| float eve::model3d::ModelData::getMaterialBaseColorB | ( | int | matIndex | ) | const |
在文件 ModelData.cpp 第 147 行定义.
◆ getMaterialBaseColorG()
| float eve::model3d::ModelData::getMaterialBaseColorG | ( | int | matIndex | ) | const |
在文件 ModelData.cpp 第 143 行定义.
◆ getMaterialBaseColorR()
| float eve::model3d::ModelData::getMaterialBaseColorR | ( | int | matIndex | ) | const |
Base color: glTF BASE_COLOR, falling back to OBJ/legacy DIFFUSE.
在文件 ModelData.cpp 第 139 行定义.
◆ getMaterialCount()
| int eve::model3d::ModelData::getMaterialCount | ( | ) | const |
在文件 ModelData.cpp 第 92 行定义.
引用了 getScene().
◆ getMaterialIndex()
| int eve::model3d::ModelData::getMaterialIndex | ( | int | meshIndex | ) | const |
◆ getMaterialMetallicFactor()
| float eve::model3d::ModelData::getMaterialMetallicFactor | ( | int | matIndex | ) | const |
PBR factors; defaults 0 (metallic) / 0.45 (roughness) when absent.
在文件 ModelData.cpp 第 155 行定义.
引用了 metallic.
◆ getMaterialName()
| std::string eve::model3d::ModelData::getMaterialName | ( | int | matIndex | ) | const |
在文件 ModelData.cpp 第 130 行定义.
引用了 name.
◆ getMaterialOpacity()
| float eve::model3d::ModelData::getMaterialOpacity | ( | int | matIndex | ) | const |
在文件 ModelData.cpp 第 173 行定义.
◆ getMaterialRoughnessFactor()
| float eve::model3d::ModelData::getMaterialRoughnessFactor | ( | int | matIndex | ) | const |
在文件 ModelData.cpp 第 164 行定义.
引用了 roughness.
◆ getMaterialTextureEmbeddedIndex()
| int eve::model3d::ModelData::getMaterialTextureEmbeddedIndex | ( | int | matIndex, |
| const std::string & | type, | ||
| int | slot = 0 |
||
| ) | const |
Scene texture index for embedded "*N" references; -1 for external files.
在文件 ModelData.cpp 第 211 行定义.
引用了 getMaterialTexturePath() , 以及 type.
◆ getMaterialTexturePath()
| std::string eve::model3d::ModelData::getMaterialTexturePath | ( | int | matIndex, |
| const std::string & | type, | ||
| int | slot = 0 |
||
| ) | const |
External file path, or "*N" for an embedded texture. Empty when absent.
在文件 ModelData.cpp 第 199 行定义.
引用了 type.
被这些函数引用 getMaterialTextureEmbeddedIndex().
◆ getMaterialTextureSlotCount()
| int eve::model3d::ModelData::getMaterialTextureSlotCount | ( | int | matIndex, |
| const std::string & | type | ||
| ) | const |
Texture type names (Squirrel strings): "base_color", "diffuse", "normals", "height", "emissive", "metalness", "roughness", "ambient_occlusion", "lightmap", "opacity", "specular", "shininess".
在文件 ModelData.cpp 第 191 行定义.
引用了 type.
◆ getMaterialTwoSided()
| bool eve::model3d::ModelData::getMaterialTwoSided | ( | int | matIndex | ) | const |
在文件 ModelData.cpp 第 182 行定义.
◆ getMesh()
| const aiMesh * eve::model3d::ModelData::getMesh | ( | int | meshIndex | ) | const |
在文件 ModelData.cpp 第 85 行定义.
◆ getMeshCount()
| int eve::model3d::ModelData::getMeshCount | ( | ) | const |
在文件 ModelData.cpp 第 87 行定义.
引用了 getScene().
◆ getMorphTargetCount()
| int eve::model3d::ModelData::getMorphTargetCount | ( | int | meshIndex | ) | const |
Assimp morph / blend-shape targets on a mesh (aiAnimMesh).
在文件 ModelData.cpp 第 274 行定义.
引用了 m.
被这些函数引用 eve::avatar::AvatarInstance::loadMorphNamesFromModel().
◆ getMorphTargetName()
| std::string eve::model3d::ModelData::getMorphTargetName | ( | int | meshIndex, |
| int | morphIndex | ||
| ) | const |
◆ getScene()
| const aiScene * eve::model3d::ModelData::getScene | ( | ) | const |
在文件 ModelData.cpp 第 65 行定义.
被这些函数引用 eve::sceneloader::SceneLoader::diff(), getAnimationCount(), getAnimationName(), getEmbeddedTextureCount(), getEmbeddedTextureHeight(), getEmbeddedTextureImageData(), getEmbeddedTextureName(), getEmbeddedTextureWidth(), getMaterialCount(), getMeshCount() , 以及 eve::housegen::HouseLayout::instantiate().
◆ getVertexCount()
| int eve::model3d::ModelData::getVertexCount | ( | int | meshIndex | ) | const |
在文件 ModelData.cpp 第 97 行定义.
引用了 m.
◆ hasBones()
| bool eve::model3d::ModelData::hasBones | ( | int | meshIndex | ) | const |
◆ hasNormals()
| bool eve::model3d::ModelData::hasNormals | ( | int | meshIndex | ) | const |
在文件 ModelData.cpp 第 111 行定义.
引用了 m.
◆ hasTexCoords()
| bool eve::model3d::ModelData::hasTexCoords | ( | int | meshIndex | ) | const |
在文件 ModelData.cpp 第 118 行定义.
引用了 m.
该类的文档由以下文件生成:
- src/modules/model3d/ModelData.h
- src/modules/model3d/ModelData.cpp
Public 成员函数 继承自