-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpk_spec.c
129 lines (128 loc) · 3.46 KB
/
mpk_spec.c
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*******************************************************
PAINKILLER MPK
(pseudo C syntax, 3dsmax default axes)
*******************************************************/
/***************************************************
mesh definition
***************************************************/
for (meshcount) {
/***********************************************
mesh entry
***********************************************/
(long) 0xDEAFBABE
/***********************************************
mesh name
***********************************************/
(long) namelength
(null_terminated_string) name
/***********************************************
transform matrix
***********************************************/
16 x float // 1,0,0,0 0,1,0,0 0,0,1,0 0,0,0,1
/***********************************************
vertices
***********************************************/
(long) numUVs // the value must be 1 or 2
(long) num_vert
for (num_vert) {
(float) X
(float) Z
(float) -Y
if(numUVs==2){
(float) 0
(float) U_ch1
(float) 1-V_ch1
(float) U_ch2
(float) 1-V_ch2
}
else{
(float) X-normal
(float) Z-normal
(float) -Y-normal
(float) U_ch1
(float) 1-V_ch1
}
}
/***********************************************
normals
***********************************************/
if(numUVs==2){
(long) num_vert
for (num_vert) {
(float) X-normal
(float) Z-normal
(float) -Y-normal
}
}
else{
(long) 0
}
/***********************************************
bounding box
***********************************************/
6 x float // x,z,y x,z,y
/***********************************************
faces
***********************************************/
(long) numfaces*3
for (numfaces) {
(short) vertex 0
(short) vertex 2
(short) vertex 1
}
/***********************************************
materials
***********************************************/
(long) nummat
for (nummat){
(short) mat_offset // by vertices
(short) mat_size // by faces
/*******************************************
color map : uses 1st UV-channel
*******************************************/
(long) texnamelength
(null_terminated_string) texname
(float) Offset_u
(float) Offset_v
(float) Tiling_u
(float) Tiling_v
/*******************************************
light map : uses 2nd UV-channel
*******************************************/
(long) texnamelength
(null_terminated_string) texname
(float) Offset_u
(float) Offset_v
(float) Tiling_u
(float) Tiling_v
/*******************************************
blend map : uses 1st UV-channel
*******************************************/
(long) texnamelength
(null_terminated_string) texname
(float) Offset_u
(float) Offset_v
(float) Tiling_u
(float) Tiling_v
/*******************************************
alpha map : uses 2nd UV-channel
*******************************************/
(long) texnamelength
(null_terminated_string) texname
(float) Offset_u
(float) Offset_v
(float) Tiling_u
(float) Tiling_v
}
}
/***************************************************
addressing
***************************************************/
for(meshcount){
(long) meshoffset
}
(long) meshcount
/***************************************************
end of file
***************************************************/
(long) 0xDEADBEEF