-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wavefront.h
50 lines (38 loc) · 940 Bytes
/
Wavefront.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
49
50
//
// Created by Marrony Neris on 12/22/15.
//
#ifndef WAVEFRONT_H
#define WAVEFRONT_H
#include "Vector.h"
#include "Allocator.h"
#include <stdint.h>
struct WavefrontMaterial {
char name[32];
};
struct WavefrontGroup {
char name[32];
char materialName[32];
int startIndices;
int numberIndices;
};
struct WavefrontObject {
int numberMaterials;
WavefrontMaterial* materials;
int numberGroups;
WavefrontGroup* groups;
int numberVertices;
Vector3* vertices;
Vector3* normals;
Vector3* tangent;
Vector3* bitangent;
Vector2* texture;
int numberIndices;
uint16_t* indices;
};
struct Wavefront {
int numberObjects;
WavefrontObject* objects;
};
bool mnLoadWavefront(HeapAllocator& allocator, const char* filename, Wavefront& wavefront, bool forceNotIndexed = false);
void mnDestroyWavefront(HeapAllocator& allocator, Wavefront& wavefront);
#endif //WAVEFRONT_H