-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCDT.bt
112 lines (75 loc) · 2.86 KB
/
CDT.bt
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
// 010 Editor Template for Forgelight CDT files
// from Planetside 2
// July, 2018
typedef struct
{
byte magic[4]<name="Magic", fgcolor=cRed>;
uint something_1<name="Something_1">;
uint something_2<name="Something_2">;
uint something_3<name="Something_3">;
uint something_4<name="Something_4">;
} header_t;
typedef struct
{
float x<name="X">;
float y<name="Y">;
float z<name="Z">;
} position_t<read=fn_Read_position_t>;
typedef struct
{
ushort vert_index_0<name="PointIndex_0">;
ushort vert_index_1<name="PointIndex_1">;
ushort vert_index_2<name="PointIndex_2">;
} triangle_t<read=fn_Read_triangle_t>;
typedef struct
{
byte magic[4]<name="Magic", fgcolor=cRed>;
byte type[4]<name="Type">;
uint nxs_something_1<name="NXS_Something_1">;
uint nxs_something_2<name="NXS_Something_2">;
float nxs_something_3<name="NXS_Something_3">;
uint nxs_vert_count<name="NXS_Vert_Count">;
uint nxs_face_count<name="NXS_Face_Count">;
position_t nxs_verts[nxs_vert_count]<name="NXS_Verts">;
triangle_t nxs_faces[nxs_face_count]<name="NXS_Triangles">;
uint nxs_face_count_2<name="NXS_Face_Count_2">;
//position_t nxs_verts_2[nxs_vert_count_2]<name="NXS_Verts_2">;
triangle_t nxs_faces_2[nxs_face_count_2]<name="NXS_Triangles_2">;
uint nxs_face_count_3<name="NXS_Face_Count_3">;
position_t nxs_verts_3[nxs_vert_count_3]<name="NXS_Verts_3">;
triangle_t nxs_faces_3[nxs_face_count_3 / 3]<name="NXS_Triangles_3">;
} nxs_header_t;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
typedef struct
{
uint vert_count<name="Vert_Count">;
position_t verts[vert_count]<name="Verts">;
} verts_t;
typedef struct
{
uint face_count<name="Face_Count">;
triangle_t faces[face_count]<name="Triangles">;
} triangles_t;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
string fn_Read_position_t(position_t &pos)
{
string s;
SPrintf(s, "xyz: %6.6f, %6.6f, %6.6f", pos.x, pos.y, pos.z);
return s;
}
string fn_Read_triangle_t(triangle_t &tri)
{
string s;
return SPrintf(s, "%u, %u, %u", tri.vert_index_0, tri.vert_index_1, tri.vert_index_2);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
LittleEndian();
header_t header<name="Header">;
verts_t verts<name="Verts">;
triangles_t faces<name="Faces">;
uint nxs_size<name="NXS_Size">;
nxs_header_t nxs<name="NXS_Header">;