-
Notifications
You must be signed in to change notification settings - Fork 2
/
gwObj.h
executable file
·48 lines (38 loc) · 997 Bytes
/
gwObj.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
/*************************************************************************\
Engine: gearWorks
File: gwObj.h
Author: Zachry Thayer
Description: Loads and renders and Wavefront OBJ
Requires:
\*************************************************************************/
#ifndef _GWOBJ_H
#define _GWOBJ_H
#include "gwTypes.h"
#include "gwTexture.h"
#include <vector>
#include <stdio.h>
#include <pspgu.h>
#include <pspgum.h>
#include <pspkernel.h>
class gwObj{
private:
std::vector<gwTexture *>tex;
std::vector<gwVertV> verts;
std::vector<gwVertV> normals;
std::vector<gwPoint2f> uvs;
std::vector<unsigned int> faces; // v/t/n
unsigned int meshSize;
gwVertTNV *mesh;
void loadFromFile(char *file);
void parseObjData(char *data, unsigned int size);
gwVertTNV *buildMesh();
float uScale, vScale;
public:
gwObj(char *file);
gwObj(char *data, unsigned int size);
~gwObj();
void bindTexture(gwTexture *tex);
void setTexScale(float u, float v);
void render();
};
#endif