Model Loader¶
-
template<IsSpectral TSpectral>
class ModelLoader¶ Loader for 3D model files using ASSIMP.
Provides static methods to load models from disk and convert them into huira scene objects. Handles mesh conversion, node hierarchy, and basic transform extraction.
- Template Parameters:
TSpectral – Spectral type (must satisfy IsSpectral concept)
Public Static Functions
-
static std::shared_ptr<Model<TSpectral>> load(Scene<TSpectral> &scene, const fs::path &file_path, std::string name, unsigned int post_process_flags = DEFAULT_POST_PROCESS_FLAGS)¶
Load a 3D model from file and add it to the scene.
Loads the model using ASSIMP, converts meshes and node hierarchy, and attaches the model to the scene.
- Parameters:
scene – Reference to the scene to add the model to
file_path – Path to the model file
name – Name for the model (optional)
post_process_flags – ASSIMP post-processing flags (optional)
- Throws:
std::runtime_error – if loading fails
- Returns:
Shared pointer to the loaded Model
Public Static Attributes
-
static unsigned int DEFAULT_POST_PROCESS_FLAGS = aiProcess_Triangulate | aiProcess_GenNormals | aiProcess_FlipUVs | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType¶