Commit Graph

5 Commits

Author SHA1 Message Date
652577d0e6 feat(mesh): add optional vertical flip when loading OBJ files
Add a boolean flag to Mesh3D constructor and loadOBJFile to optionally
flip the Y coordinate of vertices.
Update engine to use this flag for specific objects (e.g., mimikyu) that
require flipping.
2025-10-29 21:29:13 +01:00
7e36811c91 ♻️ refactor engine to use Mesh3D with transform support
- Add position, rotation and scale fields to `Mesh3D` and expose them publicly.
- Remove the old `Object3D` struct; `Objects3D` now stores `unique_ptr<Mesh3D>`.
- Implement a new `createObject(name,textures,filepath,position,rotation,scale)` overload that sets transforms after loading the mesh.
- Add a `draw(Mesh3D*)` helper that binds the texture, builds a model matrix and issues `glDrawArrays`.
- Update the rendering loop to use `draw()` instead of the old cube routine.
- Simplify `onCreate`: enable depth test, flip textures, create two objects with proper transforms, set clear color.
- Enable window resizing (`GLFW_RESIZABLE`), change default size to 800×600 in `main.cpp`.
- Clean up includes and remove unused `cube.cpp`; refactor OBJ parsing for robustness.

These changes unify object handling, allow per‑object transformations, simplify the rendering pipeline, improve maintainability, and make the window resizable.
2025-10-25 19:46:49 +02:00
646efa9383 ♻️ (engine): store Mesh3D objects as unique_ptr for safer memory handling 2025-10-24 09:50:00 +02:00
430b1fb364 ♻️ (engine, Mesh3D): refactor 3D object handling
- Introduce Mesh3D class with vertices, texture, VBO/VAO.
- Replace Object3D struct and textures map in engine with Mesh3D objects.
- Update createObject to load from file path instead of vertex array.
- Adjust cube rendering to use new vertex count.
- Remove debug prints from Texture2D loading.
- Toggle fragment shader color vs texture usage.
2025-10-24 07:58:20 +02:00
f5430f4dd7 Add Mesh3D class for loading OBJ files 2025-10-15 10:03:25 +02:00