VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
vex::MeshData Struct Reference

Mesh data structure for loading and managing mesh data. More...

#include <Mesh.hpp>

Public Member Functions

void loadFromFile (const std::string &path, VirtualFileSystem *vfs)
 Loads mesh data from a file using the Virtual File System.
void loadFromRawFile (const std::string &relativePath)
 Loads a mesh directly from the physical disk, bypassing the VFS.
void clear ()

Public Attributes

std::vector< Submeshsubmeshes
mesh_asset_path meshPath

Private Member Functions

void processScene (const aiScene *scene, const std::string &textureBaseDir)
 Internal helper to convert an Assimp aiScene into VEX Submesh structures.

Detailed Description

Mesh data structure for loading and managing mesh data.

Definition at line 41 of file Mesh.hpp.

Member Function Documentation

◆ clear()

void vex::MeshData::clear ( )
inline

Definition at line 57 of file Mesh.hpp.

◆ loadFromFile()

void vex::MeshData::loadFromFile ( const std::string & path,
VirtualFileSystem * vfs )

Loads mesh data from a file using the Virtual File System.

Uses Assimp with a custom VPKAssimpIOSystem to read files directly from VFS memory buffers (supporting compressed VPKs). Post-processes the mesh to Triangulate, Generate Normals, and Flip UVs.

Parameters
conststd::string& path - Path to the mesh file within the VFS.
VirtualFileSystem*vfs - Pointer to the active VirtualFileSystem instance.

Definition at line 271 of file Mesh.cpp.

◆ loadFromRawFile()

void vex::MeshData::loadFromRawFile ( const std::string & relativePath)

Loads a mesh directly from the physical disk, bypassing the VFS.

Useful for Editor assets or raw files not yet packed into VPKs. Reads relative to the executable directory.

Parameters
conststd::string& relativePath - File path relative to the executable.

Definition at line 240 of file Mesh.cpp.

◆ processScene()

void vex::MeshData::processScene ( const aiScene * scene,
const std::string & textureBaseDir )
private

Internal helper to convert an Assimp aiScene into VEX Submesh structures.

Extracts vertices, normals, and texture coordinates. If texture coordinates are missing, initializes UVs to (-100000.0f) to signal the shader.

Parameters
constaiScene* scene - The loaded Assimp scene pointer.
conststd::string& textureBaseDir - Base directory string for resolving texture paths.

Definition at line 183 of file Mesh.cpp.

Member Data Documentation

◆ meshPath

mesh_asset_path vex::MeshData::meshPath

Definition at line 43 of file Mesh.hpp.

◆ submeshes

std::vector<Submesh> vex::MeshData::submeshes

Definition at line 42 of file Mesh.hpp.


The documentation for this struct was generated from the following files: