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.
33 lines
696 B
C++
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
|
|
|