group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
ModelLoader.hpp File Reference

Assimp-based model loading and CPU-side mesh/texture data types. More...

#include <cstddef>
#include <cstdint>
#include <glm/glm.hpp>
#include <string>
#include <vector>
Include dependency graph for ModelLoader.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ModelVertex
 One vertex in a loaded 3-D model (PBR-ready). More...
 
struct  MaterialData
 PBR material scalar parameters extracted from Assimp/glTF. More...
 
struct  MeshData
 CPU-side mesh data ready for GPU upload. More...
 
struct  TextureData
 RGBA pixel data for one texture (decoded from embedded PNG/JPEG). More...
 
struct  LoadedModel
 Everything returned by loadModel(). More...
 

Enumerations

enum class  AlphaMode { Opaque , Mask , Blend }
 glTF alpha blending mode. More...
 

Functions

bool loadModel (const std::string &path, LoadedModel &outModel, bool flipUVs=false)
 Load a model file via Assimp and decode its embedded textures.
 

Detailed Description

Assimp-based model loading and CPU-side mesh/texture data types.

Enumeration Type Documentation

◆ AlphaMode

enum class AlphaMode
strong

glTF alpha blending mode.

Enumerator
Opaque 
Mask 
Blend 

Function Documentation

◆ loadModel()

bool loadModel ( const std::string &  path,
LoadedModel outModel,
bool  flipUVs = false 
)

Load a model file via Assimp and decode its embedded textures.

Extracts PBR material properties (metallic, roughness, emissive factors) and tangent vectors for normal mapping. Traverses the full scene-graph and bakes per-node transforms into vertex data.

Parameters
pathAbsolute path to the model file (GLB, OBJ, FBX, …).
outModelFilled on success.
flipUVsFlip V texture coordinates (V = 1 − V). Set true for models from tools that use V=0 at bottom (Blender, OBJ).
Returns
True on success; false on failure (error logged via SDL_Log).
Here is the caller graph for this function: