Skip to content

feat(mesh): Mesh Loading System — OBJ parser, 3D components (RF5.2)#64

Merged
LyeZinho merged 1 commit intomainfrom
40-mesh-loading
May 8, 2026
Merged

feat(mesh): Mesh Loading System — OBJ parser, 3D components (RF5.2)#64
LyeZinho merged 1 commit intomainfrom
40-mesh-loading

Conversation

@LyeZinho
Copy link
Copy Markdown
Member

@LyeZinho LyeZinho commented May 8, 2026

Summary

  • Implements RF5.2: Mesh Loading System with OBJ parser and 3D spatial components
  • Adds Components3D.hpp (Position3D, Rotation3D, Scale3D)
  • Adds MeshTypes.hpp (Vertex3D, Mesh3D, Material3D, MeshRenderer)
  • Adds MeshLoader.hpp with OBJ parser and MeshSystem
  • 24 tests in test_mesh.cpp covering all components and OBJ parsing

Files

File Change
src/ecs/Components3D.hpp New — Position3D, Rotation3D, Scale3D components
src/assets/MeshTypes.hpp New — Vertex3D, Mesh3D, Material3D, MeshRenderer, Color, Rect3D
src/assets/MeshLoader.hpp New — MeshLoader (OBJ parser), MeshSystem : ECS::ISystem
tests/test_mesh.cpp New — 24 tests, always compiled (no SDL3 dep)
src/Caffeine.hpp Mesh includes added
tests/CMakeLists.txt test_mesh.cpp added to base sources
docs/fase5/mesh-loading.md Status → ✅, API rewritten to match implementation

Design Notes

  • MeshLoader::parseOBJ() supports all OBJ face formats: v/vt/vn, v//vn, v/vt, v
  • Negative indices in OBJ files supported (relative indexing)
  • Face triangulation via fan algorithm (for N-gons)
  • MeshLoader::fromMemory() creates mesh from raw vertex/index arrays
  • computeBounds() calculates AABB for frustum culling
  • GPU upload code guarded with #ifdef CF_HAS_SDL3
  • Rotation3D quaternion defaults to identity (0,0,0,1)
  • Scale3D defaults to uniform scale (1,1,1)
  • Material3D roughness defaults to 0.5f (PBR middle ground)
  • All structs default-constructible and safe for CPU-only builds

@LyeZinho LyeZinho linked an issue May 8, 2026 that may be closed by this pull request
4 tasks
@LyeZinho LyeZinho self-assigned this May 8, 2026
@LyeZinho LyeZinho added documentation Improvements or additions to documentation planned-implementation Implementations planned according with roadmap labels May 8, 2026
@LyeZinho LyeZinho added this to the phase 5 milestone May 8, 2026
@LyeZinho LyeZinho merged commit b69fcfa into main May 8, 2026
1 check passed
@LyeZinho LyeZinho deleted the 40-mesh-loading branch May 8, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation planned-implementation Implementations planned according with roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mesh Loading

1 participant