restructure v2

This commit is contained in:
Claire Schwarzer 2026-07-08 14:24:34 +02:00
parent e01595e155
commit dc5654ba9a
20 changed files with 910 additions and 791 deletions

50
engine/Backend/Mesh.h Normal file
View file

@ -0,0 +1,50 @@
#pragma once
#include <glm/glm.hpp>
#include <engine/Backend/Shader.h>
using namespace std;
#define MAX_BONE_INFLUENCE 4
struct Vertex {
// position
glm::vec3 Position;
// normal
glm::vec3 Normal;
// texCoords
glm::vec2 TexCoords;
// tangent
glm::vec3 Tangent;
// bitangent
glm::vec3 Bitangent;
//bone indexes which will influence this vertex
int m_BoneIDs[MAX_BONE_INFLUENCE];
//weights from each bone
float m_Weights[MAX_BONE_INFLUENCE];
};
struct Texture {
unsigned int id;
string type;
string path;
};
class Mesh {
public:
// mesh Data
vector<Vertex> vertices;
vector<unsigned int> indices;
vector<Texture> textures;
unsigned int VAO;
Mesh(vector<Vertex> vertices, vector<unsigned int> indices, vector<Texture> textures);
void Draw(Shader &shader);
private:
// render data
unsigned int VBO, EBO;
// initializes all the buffer objects/arrays
void setupMesh();
};