-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathObjMesh.h
More file actions
37 lines (29 loc) · 680 Bytes
/
ObjMesh.h
File metadata and controls
37 lines (29 loc) · 680 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
//
// Created by 孙万捷 on 16/4/24.
//
#ifndef SUNPATHTRACER_OBJMESH_H
#define SUNPATHTRACER_OBJMESH_H
#include <iostream>
#include <fstream>
#include <vector>
#include <cfloat>
#include <glm/glm.hpp>
class ObjMesh
{
public:
ObjMesh() {}
ObjMesh(std::string filename);
void Load(std::string filename);
void ApplyTransform(const glm::mat4& t);
private:
void FixNormal();
public:
std::vector<glm::vec3> vertices;
std::vector<glm::vec2> tex_coords;
std::vector<glm::uvec3> faces;
std::vector<glm::vec3> vertex_normals;
std::vector<glm::vec3> face_normals;
glm::vec3 vmax;
glm::vec3 vmin;
};
#endif //SUNPATHTRACER_OBJMESH_H