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

Assimp model loading, embedded texture decoding, and scene-graph traversal. More...

#include "ModelLoader.hpp"
#include <SDL3/SDL_log.h>
#include <stb_image.h>
#include <assimp/GltfMaterial.h>
#include <assimp/Importer.hpp>
#include <assimp/material.h>
#include <assimp/postprocess.h>
#include <assimp/scene.h>
#include <glm/gtc/type_ptr.hpp>
Include dependency graph for ModelLoader.cpp:

Macros

#define STB_IMAGE_IMPLEMENTATION
 

Functions

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

Detailed Description

Assimp model loading, embedded texture decoding, and scene-graph traversal.

Macro Definition Documentation

◆ STB_IMAGE_IMPLEMENTATION

#define STB_IMAGE_IMPLEMENTATION

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: