-
-
Notifications
You must be signed in to change notification settings - Fork 184
/
qbcl.hexpat
82 lines (72 loc) · 1.2 KB
/
qbcl.hexpat
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#pragma description Qubicle voxel scene project
// Qubicle QBCL format
struct String {
u32 len;
char string[len];
};
struct Matrix {
u32 sizex;
u32 sizey;
u32 sizez;
s32 tx;
s32 ty;
s32 tz;
float pivotx;
float pivoty;
float pivotz;
u32 compressedDataSize;
u8 zip[compressedDataSize];
};
// Rotation matrix according to wikipedia
// https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations
struct Matrices {
float row1[3];
float row2[3];
float row3[3];
};
using Node;
struct Model {
Matrices rotation;
u32 childCount;
Node nodes[childCount];
};
struct Compound {
Matrix matrix;
u32 childCount;
Node nodes[childCount];
};
struct Node {
u32 type;
u32 unknown;
String name;
u8 visible;
u8 unknown2;
u8 locked;
if (type == 0) {
Matrix matrix;
} else if (type == 1) {
Model model;
} else if (type == 2) {
Compound compound;
}
};
struct Header {
u32 magic;
u32 version;
u32 fileversion;
u32 thumbwidth;
u32 thumbheight;
char bgra[thumbwidth * thumbheight * 4];
String title;
String desc;
String metadata;
String author;
String company;
String website;
String copyright;
// Maybe change and creation time?
double time1;
double time2;
Node node;
};
Header hdr @0x00;