/
obj_loader.hpp
35 lines (28 loc) · 961 Bytes
/
obj_loader.hpp
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
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2020, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#ifndef _TYRA_OBJ_LOADER_
#define _TYRA_OBJ_LOADER_
#include "../models/mesh_frame.hpp"
#include <stdio.h>
/** Class responsible for loading&parsing .obj 3D files */
class ObjLoader
{
public:
ObjLoader();
~ObjLoader();
/** Parse .obj file, allocate output data and store it. Multitexture support
* Notice: At this moment textures names are MATERIAL names from .obj file!
* Notice 2: Faces MUST be triangulated (check out blender export settings).
*/
void load(MeshFrame *o_result, char *t_fileName, float t_scale, u8 t_invertT);
private:
void allocateObjMemory(FILE *t_file, MeshFrame *t_result);
};
#endif