类 | |
| class | EveFileSystem |
| medialoader::FileSystem adapter over eve::filesystem (physfs / VFS). 更多... | |
| class | Model3D |
| Resource module for decoding 3D models via medialoader (Assimp). Produces ModelData; GPU upload is graphics' responsibility. 更多... | |
| class | ModelData |
| CPU-side decoded 3D model (Assimp scene owned via medialoader::ModelScene). Does not upload to GPU — use graphics::Graphics::newMeshFromAssimp on getMesh(). 更多... | |
| struct | ModelLoadOptions |
| Toggles for the Assimp post-processing steps applied by medialoader on decode. All default to on (matches the historical behavior); disabling a step changes vertex/triangle layout (e.g. joinIdenticalVertices=false keeps per-face vertices for hard-edged flat shading). Normals are generated with aiProcess_GenSmoothNormals when a mesh lacks them (see the configure-time medialoader patch in CMakeLists.txt), keeping hard seams beyond the 80-degree smoothing angle. 更多... | |
| struct | ModelRenderOptions |
函数 | |
| Module_IMPL (Model3D, new Model3D()) | |
| std::string | modelCacheKey (const std::string &path, const ModelLoadOptions &options) |
Build a deterministic ResourceManager cache key for path + options. | |
| ModelLoadOptions | modelOptionsFromKey (const std::string &key) |
| Parse the options back out of a model cache key (inverse of modelCacheKey). | |
| Renderable3D * | buildRenderable (IResourceFactory &gfx, ModelData *model, int meshIndex, const ModelRenderOptions &options) |
| std::vector< Renderable3D * > | buildRenderables (IResourceFactory &gfx, ModelData *model, const ModelRenderOptions &options) |
| graphics::Renderable3D * | buildRenderable (graphics::IResourceFactory &gfx, ModelData *model, int meshIndex, const ModelRenderOptions &options={}) |
| std::vector< graphics::Renderable3D * > | buildRenderables (graphics::IResourceFactory &gfx, ModelData *model, const ModelRenderOptions &options={}) |
函数说明
◆ buildRenderable() [1/2]
| graphics::Renderable3D * eve::model3d::buildRenderable | ( | graphics::IResourceFactory & | gfx, |
| ModelData * | model, | ||
| int | meshIndex, | ||
| const ModelRenderOptions & | options = {} |
||
| ) |
Build a Renderable3D for one Assimp mesh. The mesh index is looked up in the scene graph to bake its node world transform (when bakeWorldTransform is on); if several nodes reference the mesh, the first is used. Returns nullptr for invalid/empty meshes. The entity is registered in the current ECS; the caller keeps it alive by owning a reference in script state.
◆ buildRenderable() [2/2]
| Renderable3D * eve::model3d::buildRenderable | ( | IResourceFactory & | gfx, |
| ModelData * | model, | ||
| int | meshIndex, | ||
| const ModelRenderOptions & | options | ||
| ) |
◆ buildRenderables() [1/2]
| std::vector< graphics::Renderable3D * > eve::model3d::buildRenderables | ( | graphics::IResourceFactory & | gfx, |
| ModelData * | model, | ||
| const ModelRenderOptions & | options = {} |
||
| ) |
Build one Renderable3D per mesh referenced by the scene graph.
◆ buildRenderables() [2/2]
| std::vector< Renderable3D * > eve::model3d::buildRenderables | ( | IResourceFactory & | gfx, |
| ModelData * | model, | ||
| const ModelRenderOptions & | options | ||
| ) |
在文件 ModelRenderer.cpp 第 198 行定义.
引用了 model.
◆ modelCacheKey()
| std::string eve::model3d::modelCacheKey | ( | const std::string & | path, |
| const ModelLoadOptions & | options | ||
| ) |
Build a deterministic ResourceManager cache key for path + options.
- 参数
-
path VFS path of the model file. options Decode options; each flag becomes a ?param=0|1entry.
- 返回
- The cache key, e.g. "sofa.obj?triangulate=1&normals=1&...".
在文件 ModelLoader.cpp 第 131 行定义.
引用了 eve::model3d::ModelLoadOptions::flipUVs, eve::model3d::ModelLoadOptions::generateNormalsIfMissing, eve::model3d::ModelLoadOptions::improveCacheLocality, eve::model3d::ModelLoadOptions::joinIdenticalVertices, eve::ResourceManager::makeKey() , 以及 eve::model3d::ModelLoadOptions::triangulate.
◆ modelOptionsFromKey()
| ModelLoadOptions eve::model3d::modelOptionsFromKey | ( | const std::string & | key | ) |
Parse the options back out of a model cache key (inverse of modelCacheKey).
- 参数
-
key A key produced by modelCacheKey.
- 返回
- The decoded options (defaults for missing parameters).
在文件 ModelLoader.cpp 第 141 行定义.
◆ Module_IMPL()
| eve::model3d::Module_IMPL | ( | Model3D | , |
| new | Model3D() | ||
| ) |