类 | |
| 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 |
| ModelRenderOptions public API. 更多... | |
| struct | SurfaceUv |
| Owning result of mapping a triangle-local surface point to one UV channel. 更多... | |
函数 | |
| 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) |
| Result< void > | prepareFoliageDeformation (ModelData &model, int meshIndex, Renderable3D &renderable) |
| EVENGINE_API_WORLD graphics::Renderable3D * | buildRenderable (graphics::IResourceFactory &gfx, ModelData *model, int meshIndex, const ModelRenderOptions &options={}) |
| Builds renderable. | |
| EVENGINE_API_WORLD std::vector< graphics::Renderable3D * > | buildRenderables (graphics::IResourceFactory &gfx, ModelData *model, const ModelRenderOptions &options={}) |
| Builds renderables. | |
| Result< void > | prepareFoliageDeformation (ModelData &model, int meshIndex, graphics::Renderable3D &renderable) |
| Generate the PBR vegetation-motion rest stream for one imported mesh. | |
函数说明
◆ buildRenderable() [1/2]
| EVENGINE_API_WORLD graphics::Renderable3D * eve::model3d::buildRenderable | ( | graphics::IResourceFactory & | gfx, |
| ModelData * | model, | ||
| int | meshIndex, | ||
| const ModelRenderOptions & | options = {} |
||
| ) |
Builds renderable.
Build a Renderable3D for one Assimp mesh. Missing external preview textures report a warning and retain material factors; this does not relax canonical asset import or archive dependency validation. 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]
| EVENGINE_API_WORLD std::vector< graphics::Renderable3D * > eve::model3d::buildRenderables | ( | graphics::IResourceFactory & | gfx, |
| ModelData * | model, | ||
| const ModelRenderOptions & | options = {} |
||
| ) |
Builds renderables.
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 第 412 行定义.
◆ 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 第 147 行定义.
引用了 eve::ResourceManager::makeKey(), options , 以及 path.
被这些函数引用 eve::model3d::Model3D::newModelDataFromFile() , 以及 eve::model3d::Model3D::requestModelData().
◆ 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 第 157 行定义.
引用了 key.
◆ Module_IMPL()
| eve::model3d::Module_IMPL | ( | Model3D | , |
| new | Model3D() | ||
| ) |
◆ prepareFoliageDeformation() [1/2]
| Result< void > eve::model3d::prepareFoliageDeformation | ( | ModelData & | model, |
| int | meshIndex, | ||
| graphics::Renderable3D & | renderable | ||
| ) |
Generate the PBR vegetation-motion rest stream for one imported mesh.
- 参数
-
model Borrowed decoded model used to recover the authored vertex positions and node transform. meshIndex Mesh index used by buildRenderable with the default baked-world option. renderable Borrowed matching renderable whose graphics-owned Mesh receives the stream.
- 返回
- Success after atomic stream replacement, or InvalidArgument without changing the mesh. @ownership Retains no pointers and invokes no callbacks. Model, renderable, and mesh remain caller/factory-owned. @thread Render-thread affine because the destination Mesh is mutable render state. @cost O(vertex count) CPU work and nine floats of persistent mesh storage per vertex; call once per prototype.
◆ prepareFoliageDeformation() [2/2]
| Result< void > eve::model3d::prepareFoliageDeformation | ( | ModelData & | model, |
| int | meshIndex, | ||
| Renderable3D & | renderable | ||
| ) |
在文件 ModelRenderer.cpp 第 423 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), hash, height, eve::InvalidArgument, mesh, message, model, p, positions, radius, scene, source , 以及 world.
被这些函数引用 eve::model3d::Model3D::prepareFoliageDeformation() , 以及 eve::model3d::Model3D::~Model3D().