-
Notifications
You must be signed in to change notification settings - Fork 0
/
mesh.h
63 lines (52 loc) · 1.15 KB
/
mesh.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <stdint.h>
#include <stdio.h>
#include "linear_math/vector.h"
#define VERTEX_MAX_BONE_COUNT 4
namespace Render
{
struct vertex
{
vec3 Position;
vec3 Normal;
vec3 Tangent;
struct UV
{
float U;
float V;
} UV;
float BoneWeights[VERTEX_MAX_BONE_COUNT];
int32_t BoneIndices[VERTEX_MAX_BONE_COUNT];
};
struct mesh
{
uint32_t VAO;
uint32_t VBO;
uint32_t EBO;
vertex* Vertices;
uint32_t* Indices;
int32_t VerticeCount;
int32_t IndiceCount;
bool HasUVs;
bool HasTangents;
bool HasBones;
int32_t BoneCount;
};
void SetUpMesh(Render::mesh* Mesh);
void CleanUpMesh(Render::mesh* Mesh);
void PrintMesh(const mesh* Mesh);
inline void
PrintMeshHeader(const mesh* Mesh)
{
printf("MESH HEADER\n");
printf("VerticeCount: %d\n", Mesh->VerticeCount);
printf("IndiceCount: %d\n", Mesh->IndiceCount);
}
inline void
PrintMeshHeader(const mesh* Mesh, int MeshIndex)
{
printf("MESH HEADER #%d \n", MeshIndex);
printf("VerticeCount: %d\n", Mesh->VerticeCount);
printf("IndiceCount: %d\n", Mesh->IndiceCount);
}
}