载入中...
搜索中...
未找到
eve::model3d::ModelData类 参考

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>

类 eve::model3d::ModelData 继承关系图:
eve::Resource eve::Object

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::ImageDatagetEmbeddedTextureImageData (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
 
ObjectgetUpdate () const
 
void ref ()
 
void unref ()
 
- Protected 属性 继承自 eve::Resource
std::string uri
 
std::vector< eve::ref< Resource > > dependencies
 
- Protected 属性 继承自 eve::Object
Objectupdate
 
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.h23 行定义.

构造及析构函数说明

◆ ModelData()

eve::model3d::ModelData::ModelData ( medialoader::ModelScene  scene,
std::string  uri = "" 
)
explicit

在文件 ModelData.cpp53 行定义.

◆ ~ModelData()

eve::model3d::ModelData::~ModelData ( )
overridedefault

成员函数说明

◆ adopt()

void eve::model3d::ModelData::adopt ( eve::Resource replacement)
overridevirtual

Replace this scene with replacement's (cache reload).

实现了 eve::Resource.

在文件 ModelData.cpp58 行定义.

◆ empty()

bool eve::model3d::ModelData::empty ( ) const

在文件 ModelData.cpp63 行定义.

◆ getAnimationCount()

int eve::model3d::ModelData::getAnimationCount ( ) const

Scene-level animation clips (aiAnimation).

在文件 ModelData.cpp367 行定义.

引用了 getScene().

◆ getAnimationName()

std::string eve::model3d::ModelData::getAnimationName ( int  animIndex) const

在文件 ModelData.cpp372 行定义.

引用了 a , 以及 getScene().

◆ getBoneCount()

int eve::model3d::ModelData::getBoneCount ( int  meshIndex) const

在文件 ModelData.cpp298 行定义.

引用了 m.

◆ getBoneName()

std::string eve::model3d::ModelData::getBoneName ( int  meshIndex,
int  boneIndex 
) const

在文件 ModelData.cpp305 行定义.

引用了 b , 以及 m.

◆ getBoneWeightCount()

int eve::model3d::ModelData::getBoneWeightCount ( int  meshIndex,
int  boneIndex 
) const

在文件 ModelData.cpp339 行定义.

引用了 b , 以及 m.

◆ getBoneWeightValue()

float eve::model3d::ModelData::getBoneWeightValue ( int  meshIndex,
int  boneIndex,
int  weightIndex 
) const

在文件 ModelData.cpp357 行定义.

引用了 b , 以及 m.

◆ getBoneWeightVertex()

int eve::model3d::ModelData::getBoneWeightVertex ( int  meshIndex,
int  boneIndex,
int  weightIndex 
) const

在文件 ModelData.cpp347 行定义.

引用了 b , 以及 m.

◆ getEmbeddedTextureCount()

int eve::model3d::ModelData::getEmbeddedTextureCount ( ) const

在文件 ModelData.cpp218 行定义.

引用了 getScene().

◆ getEmbeddedTextureHeight()

int eve::model3d::ModelData::getEmbeddedTextureHeight ( int  idx) const

0 means a compressed blob (use getEmbeddedTextureImageData to decode).

在文件 ModelData.cpp239 行定义.

引用了 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.cpp246 行定义.

引用了 getScene(), h, idx , 以及 w.

◆ getEmbeddedTextureName()

std::string eve::model3d::ModelData::getEmbeddedTextureName ( int  idx) const

在文件 ModelData.cpp223 行定义.

引用了 getScene() , 以及 idx.

◆ getEmbeddedTextureWidth()

int eve::model3d::ModelData::getEmbeddedTextureWidth ( int  idx) const

在文件 ModelData.cpp232 行定义.

引用了 getScene() , 以及 idx.

◆ getFaceCount()

int eve::model3d::ModelData::getFaceCount ( int  meshIndex) const

在文件 ModelData.cpp104 行定义.

引用了 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.cpp314 行定义.

引用了 b , 以及 m.

◆ getMaterialBaseColorA()

float eve::model3d::ModelData::getMaterialBaseColorA ( int  matIndex) const

在文件 ModelData.cpp151 行定义.

◆ getMaterialBaseColorB()

float eve::model3d::ModelData::getMaterialBaseColorB ( int  matIndex) const

在文件 ModelData.cpp147 行定义.

◆ getMaterialBaseColorG()

float eve::model3d::ModelData::getMaterialBaseColorG ( int  matIndex) const

在文件 ModelData.cpp143 行定义.

◆ getMaterialBaseColorR()

float eve::model3d::ModelData::getMaterialBaseColorR ( int  matIndex) const

Base color: glTF BASE_COLOR, falling back to OBJ/legacy DIFFUSE.

在文件 ModelData.cpp139 行定义.

◆ getMaterialCount()

int eve::model3d::ModelData::getMaterialCount ( ) const

在文件 ModelData.cpp92 行定义.

引用了 getScene().

◆ getMaterialIndex()

int eve::model3d::ModelData::getMaterialIndex ( int  meshIndex) const

Assimp material slot referenced by a mesh; -1 when invalid.

在文件 ModelData.cpp125 行定义.

引用了 m.

◆ getMaterialMetallicFactor()

float eve::model3d::ModelData::getMaterialMetallicFactor ( int  matIndex) const

PBR factors; defaults 0 (metallic) / 0.45 (roughness) when absent.

在文件 ModelData.cpp155 行定义.

引用了 metallic.

◆ getMaterialName()

std::string eve::model3d::ModelData::getMaterialName ( int  matIndex) const

在文件 ModelData.cpp130 行定义.

引用了 name.

◆ getMaterialOpacity()

float eve::model3d::ModelData::getMaterialOpacity ( int  matIndex) const

在文件 ModelData.cpp173 行定义.

◆ getMaterialRoughnessFactor()

float eve::model3d::ModelData::getMaterialRoughnessFactor ( int  matIndex) const

在文件 ModelData.cpp164 行定义.

引用了 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.cpp211 行定义.

引用了 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.cpp199 行定义.

引用了 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.cpp191 行定义.

引用了 type.

◆ getMaterialTwoSided()

bool eve::model3d::ModelData::getMaterialTwoSided ( int  matIndex) const

在文件 ModelData.cpp182 行定义.

◆ getMesh()

const aiMesh * eve::model3d::ModelData::getMesh ( int  meshIndex) const

在文件 ModelData.cpp85 行定义.

◆ getMeshCount()

int eve::model3d::ModelData::getMeshCount ( ) const

在文件 ModelData.cpp87 行定义.

引用了 getScene().

◆ getMorphTargetCount()

int eve::model3d::ModelData::getMorphTargetCount ( int  meshIndex) const

Assimp morph / blend-shape targets on a mesh (aiAnimMesh).

在文件 ModelData.cpp274 行定义.

引用了 m.

被这些函数引用 eve::avatar::AvatarInstance::loadMorphNamesFromModel().

◆ getMorphTargetName()

std::string eve::model3d::ModelData::getMorphTargetName ( int  meshIndex,
int  morphIndex 
) const

在文件 ModelData.cpp280 行定义.

引用了 m.

被这些函数引用 eve::avatar::AvatarInstance::loadMorphNamesFromModel().

◆ getScene()

◆ getVertexCount()

int eve::model3d::ModelData::getVertexCount ( int  meshIndex) const

在文件 ModelData.cpp97 行定义.

引用了 m.

◆ hasBones()

bool eve::model3d::ModelData::hasBones ( int  meshIndex) const

Assimp skeletal skin data (aiBone / vertex weights) on a mesh.

在文件 ModelData.cpp291 行定义.

引用了 m.

◆ hasNormals()

bool eve::model3d::ModelData::hasNormals ( int  meshIndex) const

在文件 ModelData.cpp111 行定义.

引用了 m.

◆ hasTexCoords()

bool eve::model3d::ModelData::hasTexCoords ( int  meshIndex) const

在文件 ModelData.cpp118 行定义.

引用了 m.


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