-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkmdldescription.txt
88 lines (83 loc) · 2.03 KB
/
pkmdldescription.txt
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
This file explains in a very informal way (c pseudocode) how the painkiller model
file format works. Lots of data I still haven't figured out, and data listed here
might have more functionality than I am aware of.
struct string
{
int length
char carray[length]
}
note: both values include terminating zero byte in models but not in animations
struct model
{
int identifier = 3
string filename
string pathname
string ameshtext = "AnimatedMesh"
int ????[4] = 1,0,2,1
int restoffilesize = the actual filesize minus restoffilestart
int restoffilestart = &restoffilestart + 4
string pathname2
short ???? = 1 (number of skeletons perhaps?)
struct skeleton
{
int numbones
struct bone
{
string bonename
float localmatrix[16]
unsigned char numchildren
} bones[numbones]
} skeleton
int numpolysurfaces
struct polysurface
{
string surfacename
int ????[3] = 0,0,0
int numtextures
struct texturedef
{
string texturefilename[numtextures]
int firstvertexindex = prev firstvertexindex + 3 * prev numtriangles
int numtriangles
} textures[numtextures]
int numvertindices = 3 * the sum of all numtriangles
short triangles[3][numtriangles]
int ???? = 0
int numvertices
struct vertex
{
float position[3]
float normal[3]
float uvcoordinates[2]
} vertices[numvertices]
int ????[2] = 0,0
int numvertices2 = numvertices
struct skininfo
{
int numbonesaffectedby
struct
{
unsigned short boneindex
float weight
} boneinfo [numbonesaffectedby]
} skininfos[numvertices]
} polysurfaces[numpolysurfaces]
}
struct animation
{
char skel[4] = "skel"
float animlength
int numboneanims
struct boneanim
{
string bonename
int numframes
struct frame
{
float timestamp
float matrix[16]
} frames [numframes]
} boneanims [numboneanims]
}
An = behind a value means all of the PKMDL files and ANI files I checked have
that value, so that's a good way to check whether it's a correctly working file.