LesDingeriesDeDjalimSurOpenGL/include/Mesh3D.h
Djalim Simaila 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

33 lines
696 B
C++

#ifndef _MESH3D
#define _MESH3D
#include "Texture2D.h"
#include <glm/ext/vector_float3.hpp>
#include <vector>
#include <string>
namespace djalim {
class Mesh3D {
public:
Mesh3D();
Mesh3D(const std::string& filepath, bool flipObjectVertically = false);
void loadOBJFile(const std::string& filepath, bool flipObjectVertically = false);
public:
Texture2D texture;
glm::vec3 position = {0.0f, 0.0f, 0.0f};
glm::vec3 rotation = {0.0f, 0.0f, 0.0f};
glm::vec3 scale = {1.0f, 1.0f, 1.0f};
std::vector<float> meshVertices;
int numMeshVertices = 0;
int numFaces = 0;
GLuint VBO;
GLuint VAO;
};
}
#endif // !_MESH3D