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

Resource module for decoding 3D models via medialoader (Assimp). Produces ModelData; GPU upload is graphics' responsibility. 更多...

#include <Model3D.h>

类 eve::model3d::Model3D 继承关系图:
eve::Module

Public 成员函数

 Module_REG (Model3D)
 
 Model3D ()
 Model 3 d.
 
 ~Model3D () override
 Model 3 d.
 
ModelData * newModelData (Data *data, std::string hintExt="")
 Decode model from in-memory bytes.
 
ModelData * newModelData (Data *data, std::string hintExt, const ModelLoadOptions &options)
 newModelData with explicit decode options.
 
ModelData * newModelDataFromFile (std::string path)
 Decode model from a VFS path (physfs). Uses EveFileSystem so sidecar files (.mtl, textures) resolve through the same filesystem.
 
ModelData * newModelDataFromFile (std::string path, const ModelLoadOptions &options)
 newModelDataFromFile with explicit decode options.
 
eve::Result< void > requestModelData (const std::string &path)
 Queue default-option model decoding on the engine resource worker pool.
 
eve::Result< void > requestModelData (const std::string &path, const ModelLoadOptions &options)
 Queue CPU decoding with explicit postprocess options, copied into the cache key.
 
graphics::Renderable3D * createRenderable (graphics::Graphics *gfx, ModelData *model, int meshIndex)
 Creates renderable.
 
eve::Result< void > prepareFoliageDeformation (ModelData *model, int meshIndex, graphics::Renderable3D *renderable)
 Prepare one default-imported renderable for native PBR vegetation motion.
 
bool bakeModel (const std::string &sourcePath, const std::string &destinationPath)
 Pack a self-contained source model (normally GLB or embedded FBX) into EVEngine's deterministic .evmodel envelope for deployment.
 
- Public 成员函数 继承自 eve::Module
virtual ~Module ()
 Module.
 
virtual std::string getName () const =0
 Returns the name.
 

详细描述

Resource module for decoding 3D models via medialoader (Assimp). Produces ModelData; GPU upload is graphics' responsibility.

在文件 Model3D.h 第 43 行定义.

构造及析构函数说明

◆ Model3D()

eve::model3d::Model3D::Model3D ( )
default

Model 3 d.

◆ ~Model3D()

eve::model3d::Model3D::~Model3D ( )
overridedefault

成员函数说明

◆ bakeModel()

bool eve::model3d::Model3D::bakeModel ( const std::string &  sourcePath,
const std::string &  destinationPath 
)

Pack a self-contained source model (normally GLB or embedded FBX) into EVEngine's deterministic .evmodel envelope for deployment.

返回
False when the source cannot be read or the destination cannot be written.

在文件 Model3D.cpp 第 189 行定义.

引用了 bytes, n, eve::filesystem::Filesystem::read(), source, sourcePath , 以及 eve::filesystem::Filesystem::write().

◆ createRenderable()

graphics::Renderable3D * eve::model3d::Model3D::createRenderable ( graphics::Graphics *  gfx,
ModelData *  model,
int  meshIndex 
)

Creates renderable.

Assemble one Renderable3D for a mesh of a decoded model: node transform baked into vertices, material base color / metallic / roughness applied, and albedo / normal / height textures loaded (embedded or through the VFS). Script-friendly counterpart of the C++ buildRenderable helpers.

在文件 Model3D.cpp 第 172 行定义.

引用了 eve::model3d::buildRenderable() , 以及 model.

◆ Module_REG()

eve::model3d::Model3D::Module_REG ( Model3D  )

◆ newModelData() [1/2]

ModelData * eve::model3d::Model3D::newModelData ( Data *  data,
std::string  hintExt,
const ModelLoadOptions &  options 
)

newModelData with explicit decode options.

在文件 Model3D.cpp 第 93 行定义.

引用了 options, payload, scene , 以及 uri.

◆ newModelData() [2/2]

ModelData * eve::model3d::Model3D::newModelData ( Data *  data,
std::string  hintExt = "" 
)

Decode model from in-memory bytes.

参数
dataEncoded model bytes (e.g. FileData / ByteData).
hintExtExtension hint for Assimp (e.g. ".obj"). If empty and data is FileData, uses FileData::getExtension().

在文件 Model3D.cpp 第 89 行定义.

引用了 newModelData().

被这些函数引用 newModelData().

◆ newModelDataFromFile() [1/2]

ModelData * eve::model3d::Model3D::newModelDataFromFile ( std::string  path)

Decode model from a VFS path (physfs). Uses EveFileSystem so sidecar files (.mtl, textures) resolve through the same filesystem.

在文件 Model3D.cpp 第 137 行定义.

引用了 newModelDataFromFile() , 以及 path.

被这些函数引用 newModelDataFromFile().

◆ newModelDataFromFile() [2/2]

ModelData * eve::model3d::Model3D::newModelDataFromFile ( std::string  path,
const ModelLoadOptions &  options 
)

newModelDataFromFile with explicit decode options.

在文件 Model3D.cpp 第 159 行定义.

引用了 eve::ResourceManager::get(), eve::ResourceManager::getInstance(), key, eve::model3d::modelCacheKey(), options, path , 以及 resource.

◆ prepareFoliageDeformation()

eve::Result< void > eve::model3d::Model3D::prepareFoliageDeformation ( ModelData *  model,
int  meshIndex,
graphics::Renderable3D *  renderable 
)

Prepare one default-imported renderable for native PBR vegetation motion.

参数
modelBorrowed decoded model.
meshIndexMatching imported mesh index.
renderableBorrowed renderable returned by createRenderable for that index.
返回
Success or InvalidArgument; failure preserves the mesh stream. @ownership Retains nothing; call on the render thread before submitting the prototype. @cost O(vertex count) and nine persistent floats per vertex; intended as a one-time prototype build step.

在文件 Model3D.cpp 第 181 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, model , 以及 eve::model3d::prepareFoliageDeformation().

◆ requestModelData() [1/2]

eve::Result< void > eve::model3d::Model3D::requestModelData ( const std::string &  path)

Queue default-option model decoding on the engine resource worker pool.

参数
pathVFS model path, copied into the cache request.
返回
Success means queued/already cached, not decoded; InvalidArgument for an empty path, Unsupported without a worker executor, or the resource request diagnostic. @ownership ResourceManager owns pending work and decoded data; no model pointer is returned.
  • @lifetime A later newModelDataFromFile joins the same cache entry and reports decode failure. Cache unload/clear follows ResourceManager's epoch and lifetime contract. @thread Call on the game thread. Workers perform CPU decode only; no script or GPU calls. @reentrancy Invokes no script callbacks; do not synchronously wait from the same worker pool.

在文件 Model3D.cpp 第 141 行定义.

引用了 path , 以及 requestModelData().

被这些函数引用 requestModelData().

◆ requestModelData() [2/2]

eve::Result< void > eve::model3d::Model3D::requestModelData ( const std::string &  path,
const ModelLoadOptions &  options 
)

Queue CPU decoding with explicit postprocess options, copied into the cache key.

参数
pathVFS path copied before submission.
optionsDecode settings; the later read must use identical settings to join this job.
返回
Submission result. Ownership, thread affinity and lifetime match requestModelData(path).

在文件 Model3D.cpp 第 145 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::ResourceManager::getInstance(), eve::InvalidArgument, eve::model3d::modelCacheKey(), options, path, eve::ResourceManager::request() , 以及 eve::Unsupported.


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