-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmesh.h
More file actions
40 lines (31 loc) · 686 Bytes
/
mesh.h
File metadata and controls
40 lines (31 loc) · 686 Bytes
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
#ifndef MESH_H
#define MESH_H
#include "types.h"
#include "lin_alg.h"
#include <vector>
struct Mesh
{
struct Triangle
{
uint32 v0;
uint32 v1;
uint32 v2;
Vec3f n;
};
struct Vertex
{
Vec3f p;
Vec3f n;
};
std::vector<Triangle> m_triangles;
std::vector<Vertex> m_vertices;
void Clear();
void ComputeAABB(Vec3f& aabb_min, Vec3f& aabb_max) const;
void Transform(Matrix44f mat);
void AddQuad(const float *quad_vtx);
void AddMesh(const Mesh& mesh);
void NormalizeDimensions();
bool Read(const char *filename, bool flip_winding = false);
void CornellBox();
};
#endif // MESH_H