-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjLoader.cpp
43 lines (32 loc) · 1.12 KB
/
objLoader.cpp
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
#include "objLoader.h"
#include "obj_parser.h"
int objLoader::load(char *filename)
{
int no_error = 1;
no_error = parse_obj_scene(&data, filename);
if(no_error)
{
this->vertexCount = data.vertex_count;
this->normalCount = data.vertex_normal_count;
this->textureCount = data.vertex_texture_count;
this->faceCount = data.face_count;
this->sphereCount = data.sphere_count;
this->planeCount = data.plane_count;
this->lightPointCount = data.light_point_count;
this->lightDiscCount = data.light_disc_count;
this->lightQuadCount = data.light_quad_count;
this->materialCount = data.material_count;
this->vertexList = data.vertex_list;
this->normalList = data.vertex_normal_list;
this->textureList = data.vertex_texture_list;
this->faceList = data.face_list;
this->sphereList = data.sphere_list;
this->planeList = data.plane_list;
this->lightPointList = data.light_point_list;
this->lightDiscList = data.light_disc_list;
this->lightQuadList = data.light_quad_list;
this->materialList = data.material_list;
this->camera = data.camera;
}
return no_error;
}