summaryrefslogtreecommitdiff
path: root/legacy/ephysics/src/lib/ephysics_trimesh.h
blob: 3d17c40a1c29270cf69351a4fdbdc4abcbe5a496 (plain)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#ifndef EPHYSICS_TRIMESH_H
#define EPHYSICS_TRIMESH_H

#define CYLINDER_NUM_VERTICES 46
#define CYLINDER_NUM_TRIANGLES 80

static btScalar cylinder_vertices[CYLINDER_NUM_VERTICES * 3] = {
      btScalar(0.378791), btScalar(-0.156900), btScalar(0.410000),
      btScalar(0.381661), btScalar(0.142468), btScalar(0.410000),
      btScalar(0.205276), btScalar(0.346467), btScalar(0.410000),
      btScalar(-0.062845), btScalar(0.397499), btScalar(0.410000),
      btScalar(-0.312196), btScalar(0.256566), btScalar(0.410000),
      btScalar(-0.409345), btScalar(0.003295), btScalar(0.410000),
      btScalar(-0.315929), btScalar(-0.250980), btScalar(0.410000),
      btScalar(-0.085737), btScalar(-0.392946), btScalar(0.410000),
      btScalar(0.181088), btScalar(-0.362629), btScalar(0.410000),
      btScalar(0.378791), btScalar(-0.156900), btScalar(-0.410000),
      btScalar(0.183474), btScalar(-0.361035), btScalar(-0.410000),
      btScalar(-0.085737), btScalar(-0.392946), btScalar(-0.410000),
      btScalar(-0.315929), btScalar(-0.250980), btScalar(-0.410000),
      btScalar(-0.409345), btScalar(0.003295), btScalar(-0.410000),
      btScalar(-0.312196), btScalar(0.256566), btScalar(-0.410000),
      btScalar(-0.062845), btScalar(0.397499), btScalar(-0.410000),
      btScalar(0.204218), btScalar(0.347174), btScalar(-0.410000),
      btScalar(0.381661), btScalar(0.142468), btScalar(-0.410000),
      btScalar(0.197462), btScalar(0.068348), btScalar(0.410000),
      btScalar(-0.036961), btScalar(0.150675), btScalar(0.410000),
      btScalar(0.067713), btScalar(-0.147128), btScalar(0.410000),
      btScalar(-0.178972), btScalar(-0.060078), btScalar(0.410000),
      btScalar(0.120907), btScalar(-0.105917), btScalar(-0.410000),
      btScalar(-0.151098), btScalar(-0.043779), btScalar(-0.410000),
      btScalar(0.039171), btScalar(0.161620), btScalar(-0.410000),
      btScalar(0.311630), btScalar(-0.257414), btScalar(0.203297),
      btScalar(-0.392051), btScalar(0.090235), btScalar(0.134737),
      btScalar(-0.360756), btScalar(-0.183891), btScalar(0.144512),
      btScalar(-0.141439), btScalar(-0.381866), btScalar(0.155320),
      btScalar(0.110283), btScalar(-0.388063), btScalar(0.161516),
      btScalar(0.320615), btScalar(-0.243966), btScalar(-0.082931),
      btScalar(0.043971), btScalar(-0.401254), btScalar(-0.106715),
      btScalar(-0.237476), btScalar(-0.324952), btScalar(-0.131440),
      btScalar(-0.392954), btScalar(-0.085698), btScalar(-0.130760),
      btScalar(-0.355705), btScalar(0.191451), btScalar(-0.132884),
      btScalar(-0.115651), btScalar(0.386996), btScalar(-0.130213),
      btScalar(0.169937), btScalar(0.370080), btScalar(-0.151207),
      btScalar(0.388128), btScalar(0.109959), btScalar(-0.173023),
      btScalar(0.401935), btScalar(-0.040547), btScalar(0.142301),
      btScalar(0.319544), btScalar(0.245570), btScalar(0.129082),
      btScalar(0.058047), btScalar(0.398454), btScalar(0.125903),
      btScalar(-0.223604), btScalar(0.334221), btScalar(0.131019),
      btScalar(-0.118588), btScalar(-0.126284), btScalar(-0.116393),
      btScalar(0.107303), btScalar(0.062176), btScalar(0.066999),
      btScalar(-0.052534), btScalar(0.162121), btScalar(-0.154024),
      btScalar(-0.027084), btScalar(-0.147475), btScalar(0.173698),
};

static int cylinder_indices[CYLINDER_NUM_TRIANGLES][3] = {
      {0,   1,  18},
      {1,   2,  18},
      {2,   3,  19},
      {18,   2,  19},
      {3,   4,  19},
      {8,   0,  20},
      {7,   8,  20},
      {0,  18,  20},
      {4,   5,  21},
      {19,   4,  21},
      {5,   6,  21},
      {6,   7,  21},
      {7,  20,  21},
      {18,  19,  20},
      {20,  19,  21},
      {9,  10,  22},
      {10,  11,  22},
      {11,  12,  23},
      {22,  11,  23},
      {12,  13,  23},
      {17,   9,  22},
      {13,  14,  23},
      {14,  15,  24},
      {23,  14,  24},
      {15,  16,  24},
      {16,  17,  24},
      {17,  22,  24},
      {23,  24,  22},
      {0,   8,  25},
      {5,   4,  26},
      {6,   5,  27},
      {5,  26,  27},
      {7,   6,  28},
      {6,  27,  28},
      {8,   7,  29},
      {25,   8,  29},
      {7,  28,  29},
      {10,   9,  30},
      {11,  10,  31},
      {10,  30,  31},
      {12,  11,  32},
      {11,  31,  32},
      {13,  12,  33},
      {12,  32,  33},
      {14,  13,  34},
      {13,  33,  34},
      {15,  14,  35},
      {14,  34,  35},
      {16,  15,  36},
      {15,  35,  36},
      {17,  16,  37},
      {16,  36,  37},
      {1,   0,  38},
      {2,   1,  39},
      {3,   2,  40},
      {4,   3,  41},
      {26,   4,  41},
      {3,  40,  41},
      {1,  38,  39},
      {17,  37,   9},
      {38,   0,  25},
      {30,   9,  37},
      {40,   2,  39},
      {39,  38,  37},
      {28,  27,  32},
      {31,  30,  29},
      {32,  31,  28},
      {33,  32,  27},
      {34,  33,  26},
      {36,  35,  40},
      {37,  36,  39},
      {30,  37,  38},
      {34,  26,  41},
      {27,  26,  33},
      {40,  39,  36},
      {28,  31,  29},
      {40,  35,  41},
      {30,  38,  25},
      {25,  29,  30},
      {41,  35,  34},
};

#define CUBE_NUM_VERTICES 54
#define CUBE_NUM_TRIANGLES 90

static btScalar cube_vertices[CUBE_NUM_VERTICES * 3] = {
      btScalar(0.400000), btScalar(-0.400000), btScalar(-0.400000),
      btScalar(0.400000), btScalar(-0.400000), btScalar(-0.129695),
      btScalar(0.400000), btScalar(-0.400000), btScalar(0.157468),
      btScalar(0.400000), btScalar(-0.400000), btScalar(0.400000),
      btScalar(-0.400000), btScalar(-0.400000), btScalar(-0.400000),
      btScalar(-0.137266), btScalar(-0.400000), btScalar(-0.400000),
      btScalar(0.142832), btScalar(-0.400000), btScalar(-0.400000),
      btScalar(-0.400000), btScalar(-0.400000), btScalar(0.400000),
      btScalar(-0.400000), btScalar(-0.400000), btScalar(0.144537),
      btScalar(-0.400000), btScalar(-0.400000), btScalar(-0.132810),
      btScalar(0.147946), btScalar(-0.400000), btScalar(0.400000),
      btScalar(-0.127038), btScalar(-0.400000), btScalar(0.400000),
      btScalar(0.400000), btScalar(-0.156914), btScalar(-0.400000),
      btScalar(0.400000), btScalar(0.110878), btScalar(-0.400000),
      btScalar(0.400000), btScalar(0.400000), btScalar(-0.400000),
      btScalar(0.400000), btScalar(0.400000), btScalar(0.400000),
      btScalar(0.400000), btScalar(0.143565), btScalar(0.400000),
      btScalar(0.400000), btScalar(-0.142881), btScalar(0.400000),
      btScalar(0.400000), btScalar(0.400000), btScalar(-0.142285),
      btScalar(0.400000), btScalar(0.400000), btScalar(0.142285),
      btScalar(-0.400000), btScalar(-0.155504), btScalar(-0.400000),
      btScalar(-0.400000), btScalar(0.143304), btScalar(-0.400000),
      btScalar(-0.400000), btScalar(0.400000), btScalar(-0.400000),
      btScalar(-0.137266), btScalar(0.400000), btScalar(-0.400000),
      btScalar(0.142832), btScalar(0.400000), btScalar(-0.400000),
      btScalar(-0.400000), btScalar(0.400000), btScalar(0.400000),
      btScalar(-0.400000), btScalar(0.123157), btScalar(0.400000),
      btScalar(-0.400000), btScalar(-0.151643), btScalar(0.400000),
      btScalar(0.147946), btScalar(0.400000), btScalar(0.400000),
      btScalar(-0.127038), btScalar(0.400000), btScalar(0.400000),
      btScalar(-0.400000), btScalar(0.400000), btScalar(-0.145673),
      btScalar(-0.400000), btScalar(0.400000), btScalar(0.145673),
      btScalar(0.149457), btScalar(-0.400000), btScalar(0.029476),
      btScalar(-0.118651), btScalar(-0.400000), btScalar(-0.091520),
      btScalar(-0.116729), btScalar(-0.400000), btScalar(0.185444),
      btScalar(0.400000), btScalar(-0.030750), btScalar(0.108353),
      btScalar(0.400000), btScalar(-0.017128), btScalar(-0.173998),
      btScalar(-0.098445), btScalar(-0.123516), btScalar(-0.400000),
      btScalar(0.189421), btScalar(-0.129196), btScalar(-0.400000),
      btScalar(0.028300), btScalar(0.131810), btScalar(-0.400000),
      btScalar(-0.121334), btScalar(-0.101441), btScalar(0.400000),
      btScalar(0.149876), btScalar(0.018849), btScalar(0.400000),
      btScalar(-0.114236), btScalar(0.180350), btScalar(0.400000),
      btScalar(0.140128), btScalar(0.400000), btScalar(0.051515),
      btScalar(-0.119461), btScalar(0.400000), btScalar(-0.055704),
      btScalar(-0.400000), btScalar(-0.140426), btScalar(-0.044838),
      btScalar(-0.400000), btScalar(0.123997), btScalar(0.045044),
      btScalar(-0.157858), btScalar(-0.190293), btScalar(0.146609),
      btScalar(0.104141), btScalar(-0.199541), btScalar(0.222140),
      btScalar(-0.207788), btScalar(0.065226), btScalar(0.172945),
      btScalar(0.103299), btScalar(-0.168979), btScalar(-0.094225),
      btScalar(0.130475), btScalar(0.068676), btScalar(-0.129420),
      btScalar(0.065630), btScalar(0.075409), btScalar(0.150963),
      btScalar(-0.172328), btScalar(0.041173), btScalar(-0.142551),
};

static int cube_indices[CUBE_NUM_TRIANGLES][3] = {
      {0,   1,   6},
      {1,   2,  32},
      {2,   3,  10},
      {4,   5,   9},
      {5,   6,  33},
      {9,   5,  33},
      {8,  34,   7},
      {8,   9,  33},
      {10,  11,  34},
      {11,   7,  34},
      {2,  10,  32},
      {6,   1,  32},
      {34,   8,  33},
      {6,  32,  33},
      {10,  34,  32},
      {32,  34,  33},
      {36,   1,  12},
      {2,   1,  35},
      {3,   2,  17},
      {12,  13,  36},
      {13,  14,  18},
      {15,  16,  19},
      {19,  16,  35},
      {16,  17,  35},
      {18,  19,  35},
      {17,   2,  35},
      {0,  12,   1},
      {13,  18,  36},
      {35,   1,  36},
      {36,  18,  35},
      {6,  38,   0},
      {5,   4,  20},
      {6,   5,  37},
      {5,  20,  37},
      {13,  12,  38},
      {14,  13,  24},
      {20,  21,  37},
      {21,  22,  23},
      {23,  24,  39},
      {21,  23,  39},
      {24,  13,  39},
      {12,   0,  38},
      {13,  38,  39},
      {37,  21,  39},
      {39,  38,  37},
      {6,  37,  38},
      {10,   3,  17},
      {7,  11,  27},
      {27,  11,  40},
      {11,  10,  40},
      {16,  15,  28},
      {17,  16,  41},
      {26,  42,  25},
      {26,  27,  40},
      {28,  29,  42},
      {29,  25,  42},
      {16,  28,  41},
      {10,  17,  41},
      {10,  41,  40},
      {26,  40,  42},
      {42,  40,  41},
      {28,  42,  41},
      {18,  14,  24},
      {15,  19,  28},
      {19,  18,  43},
      {28,  19,  43},
      {23,  22,  30},
      {24,  23,  44},
      {25,  29,  31},
      {29,  28,  43},
      {23,  30,  44},
      {44,  30,  31},
      {43,  44,  29},
      {18,  24,  43},
      {31,  29,  44},
      {24,  44,  43},
      {4,   9,  20},
      {8,   7,  27},
      {9,   8,  45},
      {8,  27,  45},
      {22,  21,  30},
      {26,  25,  31},
      {26,  31,  46},
      {27,  26,  46},
      {31,  30,  46},
      {20,   9,  45},
      {30,  21,  46},
      {45,  27,  46},
      {46,  21,  45},
      {21,  20,  45},
};

#endif