Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
DebugShapes.c
Go to the documentation of this file.
1/*************************************************************************************
2* This file contains additional debug shape functions
3*************************************************************************************/
4
5//------------------------------------------------------------------------------------------------
6// Visualizes a bone in an entity with axial lines
7void ShowBoneDebug(IEntity ent, int bone, float scale)
8{
9 vector boneMat[4];
10 if (ent.GetAnimation().GetBoneMatrix(bone, boneMat))
11 {
12 vector mat[4];
13 ent.GetTransform(mat);
14
15 vector pBase = boneMat[3];
16 vector p0 = boneMat[0] * scale + boneMat[3];
17 vector p1 = boneMat[1] * scale + boneMat[3];
18 vector p2 = boneMat[2] * scale + boneMat[3];
19 pBase = pBase.Multiply4(mat);
20 p0 = p0.Multiply4(mat);
21 p1 = p1.Multiply4(mat);
22 p2 = p2.Multiply4(mat);
23 Shape.Create(ShapeType.LINE, ARGB(255, 255, 0, 0), ShapeFlags.ONCE|ShapeFlags.NOZBUFFER, pBase, p0);
24 Shape.Create(ShapeType.LINE, ARGB(255, 0, 255, 0), ShapeFlags.ONCE|ShapeFlags.NOZBUFFER, pBase, p1);
25 Shape.Create(ShapeType.LINE, ARGB(255, 0, 0, 255), ShapeFlags.ONCE|ShapeFlags.NOZBUFFER, pBase, p2);
26 }
27}
28
29//------------------------------------------------------------------------------------------------
38Shape CreateCone(vector pos, vector aroundDir, float coneAngX, float coneAngY, float coneLength, int color, int subdivisions, ShapeFlags flags)
39{
40 if (subdivisions < 2)
41 subdivisions = 2;
42 if (subdivisions > 50)
43 subdivisions = 50;
44
45 vector rt = "1 0 0";
46 if (rt == aroundDir)
47 rt = "0 1 0";
48 vector fw = rt * aroundDir;
49 fw.Normalize();
50 rt = aroundDir * fw;
51 rt.Normalize();
52
53 vector mat[3];
54 mat[0] = rt;
55 mat[1] = aroundDir;
56 mat[2] = fw;
57
58 float sectionDeg = 360 / subdivisions;
59 subdivisions++;
60
61 vector pts[200];
62 int curPts = 0;
63 for (int i = 0; i < subdivisions; i++)
64 {
65 float xValue = Math.Sin(sectionDeg * i * Math.DEG2RAD);
66 xValue *= xValue;
67 float yValue = Math.Cos(sectionDeg * i * Math.DEG2RAD);
68 yValue *= yValue;
69
70 float lineAng = Math.AbsFloat(xValue * coneAngX);
71 lineAng += Math.AbsFloat(yValue * coneAngY);
72
73 vector pt = Vector(0, 0, coneLength);
74 vector rotMat[3];
75 Math3D.AnglesToMatrix(Vector(sectionDeg * i, 90 - lineAng, 0), rotMat);
76 pt = pt.Multiply3(rotMat);
77 pt = pt.Multiply3(mat);
78 pts[curPts] = pt + pos;
79 curPts++;
80 pts[curPts] = pos;
81 curPts++;
82 pts[curPts] = pt + pos; // Have to make an additional line back to the circle to keep it as one shape object
83 curPts++;
84 }
85 pts[curPts] = pts[0];
86
87 return Shape.CreateLines(color, flags, pts, curPts);
88}
89
90//------------------------------------------------------------------------------------------------
91Shape CreateCircle(vector pos, vector aroundDir, float radius, int color, int subdivisions, ShapeFlags flags)
92{
93 if (subdivisions < 2)
94 subdivisions = 2;
95 if (subdivisions > 50)
96 subdivisions = 50;
97
98 vector rt = "1 0 0";
99 if (rt == aroundDir)
100 rt = "0 1 0";
101 vector fw = rt * aroundDir;
102 fw.Normalize();
103 rt = aroundDir * fw;
104 rt.Normalize();
105
106 vector mat[3];
107 mat[0] = rt;
108 mat[1] = aroundDir;
109 mat[2] = fw;
110
111 float sectionDeg = 360 / subdivisions;
112 subdivisions++;
113
114 vector pts[51];
115 for (int i = 0; i < subdivisions; i++)
116 {
117 vector pt = vector.FromYaw(sectionDeg * i) * radius;
118 pt = pt.Multiply3(mat);
119 pts[i] = pt + pos;
120 }
121 pts[subdivisions - 1] = pts[0];
122
123 return Shape.CreateLines(color, flags, pts, subdivisions);
124}
125
126//------------------------------------------------------------------------------------------------
127Shape CreateCircleArc(vector pos, vector aroundDir, vector forwardDir, float angMin, float angMax, float radius, int color, int subdivisions, ShapeFlags flags)
128{
129 if (subdivisions < 2)
130 subdivisions = 2;
131
132 if (subdivisions > 50)
133 subdivisions = 50;
134
135 if (angMin > angMax)
136 {
137 float angTmp = angMin;
138 angMin = angMax;
139 angMax = angTmp;
140 }
141
142 if (angMin > 360 || angMax > 360)
143 return CreateCircle(pos, aroundDir, radius, color, subdivisions, flags);
144
145 vector rt = aroundDir * forwardDir;
146 rt.Normalize();
147
148 vector mat[3];
149 mat[0] = rt;
150 mat[1] = aroundDir;
151 mat[2] = forwardDir;
152
153 float sectionDeg = Math.AbsFloat(angMax - angMin) / subdivisions;
154
155 subdivisions++;
156
157 vector pts[51];
158 for (int i = 0; i < subdivisions; i++)
159 {
160 vector pt = vector.FromYaw(sectionDeg * i + angMin) * radius;
161 pt = pt.Multiply3(mat);
162 pts[i] = pos + pt;
163 }
164
165 return Shape.CreateLines(color, flags, pts, subdivisions);
166}
167
168//------------------------------------------------------------------------------------------------
173Shape CreateCircleSlice(vector pos, vector aroundDir, vector forwardDir, float angMin, float angMax, float radius, int color, int subdivisions, ShapeFlags flags)
174{
175 if (subdivisions < 2)
176 subdivisions = 2;
177 if (subdivisions > 50)
178 subdivisions = 50;
179 if (angMin > angMax) // Min greater than max, do full circle
180 return CreateCircle(pos, aroundDir, radius, color, subdivisions, flags);
181
182 subdivisions++;
183
184 vector rt = aroundDir * forwardDir;
185 rt.Normalize();
186
187 vector mat[3];
188 mat[0] = rt;
189 mat[1] = aroundDir;
190 mat[2] = forwardDir;
191
192 float sectionDeg = Math.AbsFloat(angMax - angMin) / (subdivisions - 1);
193
194 vector pts[53];
195 for (int i = 0; i < subdivisions; i++)
196 {
197 int ptIndex = i + 1;
198 vector pt = vector.FromYaw(sectionDeg * i + angMin) * radius;
199 pt = pt.Multiply3(mat);
200 pts[ptIndex] = pt + pos;
201 }
202 subdivisions += 2;
203 pts[0] = pos;
204 pts[subdivisions - 1] = pos;
205
206 return Shape.CreateLines(color, flags, pts, subdivisions);
207}
208
209//------------------------------------------------------------------------------------------------
210void CreateArrowLinkLines(vector from, vector to, vector faceDir, float size, int numArrows, int color, ShapeFlags flags)
211{
212 if (numArrows == 0)
213 return;
214
215 vector fw = to - from;
216 fw.Normalize();
217 vector rt = faceDir * fw;
218 rt.Normalize();
219 vector up = fw * rt;
220 up.Normalize();
221
222 vector scaledMat[3];
223 scaledMat[0] = rt;
224 scaledMat[1] = up;
225 scaledMat[2] = fw;
226
227 Shape shp;
228
229 vector pts[3];
230
231 float distInc = vector.Distance(from, to) / numArrows;
232 for (int i = 0; i < numArrows; i++)
233 {
234
235 vector pos = fw * (distInc * i) + from;
236 pts[0] = Vector(-1, 0, 0).Multiply3(scaledMat) * size + pos;
237 pts[1] = Vector(0, 0, 0.5).Multiply3(scaledMat) * size + pos;
238 pts[2] = Vector(1, 0, 0).Multiply3(scaledMat) * size + pos;
239 shp = Shape.CreateLines(color, flags, pts, 3);
240 }
241}
242
243//------------------------------------------------------------------------------------------------
244void CreateSimpleText(string text, vector mat[4], float size, int color, ShapeFlags flags, array<ref Shape> output = null, float scaleWidth = 1, bool doBackground = false, int backgroundColor = 0x80000000)
245{
246 vector scaledMat[4];
247 scaledMat[0] = mat[0] * size * scaleWidth;
248 scaledMat[1] = mat[1] * size;
249 scaledMat[2] = mat[2];
250 scaledMat[3] = mat[3];
251
252 vector pts[14];
253
254 int numLetters = text.Length();
255 float offsetStartLeft = numLetters * -0.5;
256 Shape shp;
257
258 // Add background
259 if (doBackground)
260 {
261 ShapeFlags bgFlags = ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE | ShapeFlags.NOZWRITE;
262 if (flags & ShapeFlags.ONCE)
263 bgFlags |= ShapeFlags.ONCE;
264 if (flags & ShapeFlags.NOZBUFFER)
265 bgFlags |= ShapeFlags.NOZBUFFER;
266
267 shp = Shape.Create(ShapeType.BBOX, backgroundColor, bgFlags, Vector(offsetStartLeft - 0.25, -0.25, 0.01), Vector(-offsetStartLeft + 0.25, 1.25, 0.01));
268 shp.SetMatrix(scaledMat);
269 if (output)
270 output.Insert(shp);
271 }
272
273 for (int i = 0; i < numLetters; i++)
274 {
275 float start = i + offsetStartLeft + 0.1;
276 string letter = text.Get(i);
277 string letterUpper = letter;
278 letterUpper.ToUpper();
279
280 float caseScale;
281 if (letterUpper == letter) // Is upper case
282 caseScale = 1;
283 else
284 caseScale = 0.6;
285
286 switch (letterUpper)
287 {
288 // Letters --------------------------------------------
289 case "A":
290 {
291 pts[0][0] = start; pts[0][1] = 0;
292 pts[1][0] = start + 0.3; pts[1][1] = caseScale * 0.9;
293 pts[2][0] = start + 0.6; pts[2][1] = 0;
294 pts[3][0] = start + 0.47; pts[3][1] = caseScale * 0.37;
295 pts[4][0] = start + 0.13; pts[4][1] = caseScale * 0.37;
296 shp = Shape.CreateLines(color, flags, pts, 5);
297 shp.SetMatrix(scaledMat);
298 if (output)
299 output.Insert(shp);
300 break;
301 }
302 case "B":
303 {
304 pts[0][0] = start + 0.1; pts[0][1] = 0;
305 pts[1][0] = start + 0.1; pts[1][1] = caseScale * 0.9;
306 pts[2][0] = start + 0.5; pts[2][1] = caseScale * 0.9;
307 pts[3][0] = start + 0.6; pts[3][1] = caseScale * 0.8;
308 pts[4][0] = start + 0.6; pts[4][1] = caseScale * 0.6;
309 pts[5][0] = start + 0.5; pts[5][1] = caseScale * 0.5;
310 pts[6][0] = start + 0.1; pts[6][1] = caseScale * 0.5;
311 pts[7] = pts[5];
312 pts[8][0] = start + 0.6; pts[8][1] = caseScale * 0.4;
313 pts[9][0] = start + 0.6; pts[9][1] = caseScale * 0.1;
314 pts[10][0] = start + 0.5; pts[10][1] = 0;
315 pts[11][0] = start + 0.1; pts[11][1] = 0;
316 shp = Shape.CreateLines(color, flags, pts, 12);
317 shp.SetMatrix(scaledMat);
318 if (output)
319 output.Insert(shp);
320
321 break;
322 }
323 case "C":
324 {
325 pts[0][0] = start + 0.6; pts[0][1] = caseScale * 0.2;
326 pts[1][0] = start + 0.4; pts[1][1] = 0;
327 pts[2][0] = start + 0.2; pts[2][1] = 0;
328 pts[3][0] = start; pts[3][1] = caseScale * 0.2;
329 pts[4][0] = start; pts[4][1] = caseScale * 0.7;
330 pts[5][0] = start + 0.2; pts[5][1] = caseScale * 0.9;
331 pts[6][0] = start + 0.4; pts[6][1] = caseScale * 0.9;
332 pts[7][0] = start + 0.6; pts[7][1] = caseScale * 0.7;
333 shp = Shape.CreateLines(color, flags, pts, 8);
334 shp.SetMatrix(scaledMat);
335 if (output)
336 output.Insert(shp);
337
338 break;
339 }
340 case "D":
341 {
342 pts[0][0] = start; pts[0][1] = caseScale * 0.9;
343 pts[1][0] = start + 0.4; pts[1][1] = caseScale * 0.9;
344 pts[2][0] = start + 0.6; pts[2][1] = caseScale * 0.7;
345 pts[3][0] = start + 0.6; pts[3][1] = caseScale * 0.2;
346 pts[4][0] = start + 0.4; pts[4][1] = 0;
347 pts[5][0] = start; pts[5][1] = 0;
348 pts[6][0] = start; pts[6][1] = caseScale * 0.9;
349 shp = Shape.CreateLines(color, flags, pts, 7);
350 shp.SetMatrix(scaledMat);
351 if (output)
352 output.Insert(shp);
353
354 break;
355 }
356 case "E":
357 {
358 pts[0][0] = start + 0.5; pts[0][1] = 0;
359 pts[1][0] = start; pts[1][1] = 0;
360 pts[2][0] = start; pts[2][1] = caseScale * 0.4;
361 pts[3][0] = start + 0.4; pts[3][1] = caseScale * 0.4;
362 pts[4] = pts[2];
363 pts[5][0] = start; pts[5][1] = caseScale * 0.9;
364 pts[6][0] = start + 0.5; pts[6][1] = caseScale * 0.9;
365 shp = Shape.CreateLines(color, flags, pts, 7);
366 shp.SetMatrix(scaledMat);
367 if (output)
368 output.Insert(shp);
369 break;
370 }
371 case "F":
372 {
373 pts[0] = Vector(start, 0, 0);
374 pts[1] = Vector(start, caseScale * 0.4, 0);
375 pts[2] = Vector(start + 0.4, caseScale * 0.4, 0);
376 pts[3] = pts[1];
377 pts[4] = Vector(start, caseScale * 0.9, 0);
378 pts[5] = Vector(start + 0.5, caseScale * 0.9, 0);
379 shp = Shape.CreateLines(color, flags, pts, 6);
380 shp.SetMatrix(scaledMat);
381 if (output)
382 output.Insert(shp);
383 break;
384 }
385 case "G":
386 {
387 pts[0] = Vector(start + 0.4, caseScale * 0.4, 0);
388 pts[1] = Vector(start + 0.6, caseScale * 0.4, 0);
389 pts[2] = Vector(start + 0.6, caseScale * 0.2, 0);
390 pts[3] = Vector(start + 0.4, 0, 0);
391 pts[4] = Vector(start + 0.2, 0, 0);
392 pts[5] = Vector(start, caseScale * 0.2, 0);
393 pts[6] = Vector(start, caseScale * 0.7, 0);
394 pts[7] = Vector(start + 0.2, caseScale * 0.9, 0);
395 pts[8] = Vector(start + 0.4, caseScale * 0.9, 0);
396 pts[9] = Vector(start + 0.6, caseScale * 0.7, 0);
397 shp = Shape.CreateLines(color, flags, pts, 10);
398 shp.SetMatrix(scaledMat);
399 if (output)
400 output.Insert(shp);
401
402 break;
403 }
404 case "H":
405 {
406 pts[0] = Vector(start, 0, 0);
407 pts[1] = Vector(start, caseScale * 0.9, 0);
408 pts[2] = Vector(start, caseScale * 0.4, 0);
409 pts[3] = Vector(start + 0.6, caseScale * 0.4, 0);
410 pts[4] = Vector(start + 0.6, caseScale * 0.9, 0);
411 pts[5] = Vector(start + 0.6, 0, 0);
412
413 shp = Shape.CreateLines(color, flags, pts, 6);
414 shp.SetMatrix(scaledMat);
415 if (output)
416 output.Insert(shp);
417 break;
418 }
419 case "I":
420 {
421 pts[0][0] = start + 0.1; pts[0][1] = caseScale * 0.9;
422 pts[1][0] = start + 0.5; pts[1][1] = caseScale * 0.9;
423 pts[2][0] = start + 0.3; pts[2][1] = caseScale * 0.9;
424 pts[3][0] = start + 0.3; pts[3][1] = 0;
425 pts[4][0] = start + 0.5; pts[4][1] = 0;
426 pts[5][0] = start + 0.1; pts[5][1] = 0;
427 shp = Shape.CreateLines(color, flags, pts, 6);
428 shp.SetMatrix(scaledMat);
429 if (output)
430 output.Insert(shp);
431 break;
432 }
433 case "J":
434 {
435 pts[0] = Vector(start, caseScale * 0.9, 0);
436 pts[1] = Vector(start + 0.6, caseScale * 0.9, 0);
437 pts[2] = Vector(start + 0.3, caseScale * 0.9, 0);
438 pts[3] = Vector(start + 0.3, caseScale * 0.1, 0);
439 pts[4] = Vector(start + 0.2, 0, 0);
440 pts[5] = Vector(start + 0.1, 0, 0);
441 pts[6] = Vector(start, caseScale * 0.1, 0);
442 pts[7] = Vector(start, caseScale * 0.3, 0);
443
444 shp = Shape.CreateLines(color, flags, pts, 8);
445 shp.SetMatrix(scaledMat);
446 if (output)
447 output.Insert(shp);
448 break;
449 }
450 case "K":
451 {
452 pts[0] = Vector(start, 0, 0);
453 pts[1] = Vector(start, caseScale * 0.9, 0);
454 pts[2] = Vector(start, caseScale * 0.5, 0);
455 pts[3] = Vector(start + 0.2, caseScale * 0.5, 0);
456 pts[4] = Vector(start + 0.6, 0, 0);
457 pts[5] = pts[3];
458 pts[6] = Vector(start + 0.6, caseScale * 0.9, 0);
459 shp = Shape.CreateLines(color, flags, pts, 7);
460 shp.SetMatrix(scaledMat);
461 if (output)
462 output.Insert(shp);
463 break;
464 }
465 case "L":
466 {
467 pts[0] = Vector(start, caseScale * 0.9, 0);
468 pts[1] = Vector(start, 0, 0);
469 pts[2] = Vector(start + 0.6, 0, 0);
470 shp = Shape.CreateLines(color, flags, pts, 3);
471 shp.SetMatrix(scaledMat);
472 if (output)
473 output.Insert(shp);
474
475 break;
476 }
477 case "M":
478 {
479 pts[0] = Vector(start, 0, 0);
480 pts[1] = Vector(start, caseScale * 0.9, 0);
481 pts[2] = Vector(start + 0.3, caseScale * 0.5, 0);
482 pts[3] = Vector(start + 0.6, caseScale * 0.9, 0);
483 pts[4] = Vector(start + 0.6, 0, 0);
484 shp = Shape.CreateLines(color, flags, pts, 5);
485 shp.SetMatrix(scaledMat);
486 if (output)
487 output.Insert(shp);
488
489 break;
490 }
491 case "N":
492 {
493 pts[0] = Vector(start, 0, 0);
494 pts[1] = Vector(start, caseScale * 0.9, 0);
495 pts[2] = Vector(start + 0.6, 0, 0);
496 pts[3] = Vector(start + 0.6, caseScale * 0.9, 0);
497 shp = Shape.CreateLines(color, flags, pts, 4);
498 shp.SetMatrix(scaledMat);
499 if (output)
500 output.Insert(shp);
501
502 break;
503 }
504 case "O":
505 {
506 pts[0][0] = start + 0.6; pts[0][1] = caseScale * 0.2;
507 pts[1][0] = start + 0.4; pts[1][1] = 0;
508 pts[2][0] = start + 0.2; pts[2][1] = 0;
509 pts[3][0] = start; pts[3][1] = caseScale * 0.2;
510 pts[4][0] = start; pts[4][1] = caseScale * 0.7;
511 pts[5][0] = start + 0.2; pts[5][1] = caseScale * 0.9;
512 pts[6][0] = start + 0.4; pts[6][1] = caseScale * 0.9;
513 pts[7][0] = start + 0.6; pts[7][1] = caseScale * 0.7;
514 pts[8] = pts[0];
515 shp = Shape.CreateLines(color, flags, pts, 9);
516 shp.SetMatrix(scaledMat);
517 if (output)
518 output.Insert(shp);
519
520 break;
521 }
522 case "P":
523 {
524 pts[0] = Vector(start, 0, 0);
525 pts[1] = Vector(start, caseScale * 0.5, 0);
526 pts[2] = Vector(start, caseScale * 0.9, 0);
527 pts[3] = Vector(start + 0.4, caseScale * 0.9, 0);
528 pts[4] = Vector(start + 0.5, caseScale * 0.8, 0);
529 pts[5] = Vector(start + 0.5, caseScale * 0.6, 0);
530 pts[6] = Vector(start + 0.4, caseScale * 0.5, 0);
531 pts[7] = Vector(start, caseScale * 0.5, 0);
532 shp = Shape.CreateLines(color, flags, pts, 8);
533 shp.SetMatrix(scaledMat);
534 if (output)
535 output.Insert(shp);
536
537 break;
538 }
539 case "Q":
540 {
541 pts[0] = Vector(start + 0.6, caseScale * 0.2, 0);
542 pts[1] = Vector(start + 0.4, 0, 0);
543 pts[2] = Vector(start + 0.2, 0, 0);
544 pts[3] = Vector(start, caseScale * 0.2, 0);
545 pts[4] = Vector(start, caseScale * 0.7, 0);
546 pts[5] = Vector(start + 0.2, caseScale * 0.9, 0);
547 pts[6] = Vector(start + 0.4, caseScale * 0.9, 0);
548 pts[7] = Vector(start + 0.6, caseScale * 0.7, 0);
549 pts[8] = pts[0];
550 shp = Shape.CreateLines(color, flags, pts, 9);
551 shp.SetMatrix(scaledMat);
552 if (output)
553 output.Insert(shp);
554
555 pts[0] = Vector(start + 0.4, caseScale * 0.2, 0);
556 pts[1] = Vector(start + 0.6, 0, 0);
557 shp = Shape.CreateLines(color, flags, pts, 2);
558 shp.SetMatrix(scaledMat);
559 if (output)
560 output.Insert(shp);
561
562 break;
563 }
564 case "R":
565 {
566 pts[0] = Vector(start, 0, 0);
567 pts[1] = Vector(start, caseScale * 0.5, 0);
568 pts[2] = Vector(start, caseScale * 0.9, 0);
569 pts[3] = Vector(start + 0.4, caseScale * 0.9, 0);
570 pts[4] = Vector(start + 0.5, caseScale * 0.8, 0);
571 pts[5] = Vector(start + 0.5, caseScale * 0.6, 0);
572 pts[6] = Vector(start + 0.4, caseScale * 0.5, 0);
573 pts[7] = Vector(start + 0.2, caseScale * 0.5, 0);
574 pts[8] = pts[1];
575 shp = Shape.CreateLines(color, flags, pts, 9);
576 shp.SetMatrix(scaledMat);
577 if (output)
578 output.Insert(shp);
579
580 pts[0] = Vector(start + 0.2, caseScale * 0.5, 0);
581 pts[1] = Vector(start + 0.5, 0, 0);
582 shp = Shape.CreateLines(color, flags, pts, 2);
583 shp.SetMatrix(scaledMat);
584 if (output)
585 output.Insert(shp);
586
587 break;
588 }
589 case "S":
590 {
591 pts[0] = Vector(start + 0.5, caseScale * 0.8, 0);
592 pts[1] = Vector(start + 0.4, caseScale * 0.9, 0);
593 pts[2] = Vector(start + 0.1, caseScale * 0.9, 0);
594 pts[3] = Vector(start, caseScale * 0.8, 0);
595 pts[4] = Vector(start, caseScale * 0.6, 0);
596 pts[5] = Vector(start + 0.1, caseScale * 0.5, 0);
597 pts[6] = Vector(start + 0.4, caseScale * 0.4, 0);
598 pts[7] = Vector(start + 0.5, caseScale * 0.3, 0);
599 pts[8] = Vector(start + 0.5, caseScale * 0.1, 0);
600 pts[9] = Vector(start + 0.4, 0, 0);
601 pts[10] = Vector(start + 0.1, 0, 0);
602 pts[11] = Vector(start, caseScale * 0.1, 0);
603 shp = Shape.CreateLines(color, flags, pts, 12);
604 shp.SetMatrix(scaledMat);
605 if (output)
606 output.Insert(shp);
607
608 break;
609 }
610 case "T":
611 {
612 pts[0] = Vector(start, caseScale * 0.9, 0);
613 pts[1] = Vector(start + 0.6, caseScale * 0.9, 0);
614 pts[2] = Vector(start + 0.3, caseScale * 0.9, 0);
615 pts[3] = Vector(start + 0.3, 0, 0);
616 shp = Shape.CreateLines(color, flags, pts, 4);
617 shp.SetMatrix(scaledMat);
618 if (output)
619 output.Insert(shp);
620 break;
621 }
622 case "U":
623 {
624 pts[0] = Vector(start, caseScale * 0.9, 0);
625 pts[1] = Vector(start, caseScale * 0.2, 0);
626 pts[2] = Vector(start + 0.2, 0, 0);
627 pts[3] = Vector(start + 0.4, 0, 0);
628 pts[4] = Vector(start + 0.6, caseScale * 0.2, 0);
629 pts[5] = Vector(start + 0.6, caseScale * 0.9, 0);
630 shp = Shape.CreateLines(color, flags, pts, 6);
631 shp.SetMatrix(scaledMat);
632 if (output)
633 output.Insert(shp);
634
635 break;
636 }
637 case "V":
638 {
639 pts[0] = Vector(start, caseScale * 0.9, 0);
640 pts[1] = Vector(start + 0.3, 0, 0);
641 pts[2] = Vector(start + 0.6, caseScale * 0.9, 0);
642 shp = Shape.CreateLines(color, flags, pts, 3);
643 shp.SetMatrix(scaledMat);
644 if (output)
645 output.Insert(shp);
646
647 break;
648 }
649 case "W":
650 {
651 pts[0] = Vector(start, caseScale * 0.9, 0);
652 pts[1] = Vector(start + 0.1, 0, 0);
653 pts[2] = Vector(start + 0.3, caseScale * 0.4, 0);
654 pts[3] = Vector(start + 0.5, 0, 0);
655 pts[4] = Vector(start + 0.6, caseScale * 0.9, 0);
656 shp = Shape.CreateLines(color, flags, pts, 5);
657 shp.SetMatrix(scaledMat);
658 if (output)
659 output.Insert(shp);
660
661 break;
662 }
663 case "X":
664 {
665 pts[0] = Vector(start, caseScale * 0.9, 0);
666 pts[1] = Vector(start + 0.3, caseScale * 0.45, 0);
667 pts[2] = Vector(start + 0.6, caseScale * 0.9, 0);
668 pts[3] = pts[1];
669 pts[4] = Vector(start, 0, 0);
670 pts[5] = pts[3];
671 pts[6] = Vector(start + 0.6, 0, 0);
672 shp = Shape.CreateLines(color, flags, pts, 7);
673 shp.SetMatrix(scaledMat);
674 if (output)
675 output.Insert(shp);
676 break;
677 }
678 case "Y":
679 {
680 pts[0] = Vector(start, caseScale * 0.9, 0);
681 pts[1] = Vector(start + 0.3, caseScale * 0.5, 0);
682 pts[2] = Vector(start + 0.6, caseScale * 0.9, 0);
683 pts[3] = pts[1];
684 pts[4] = Vector(start + 0.3, 0, 0);
685 shp = Shape.CreateLines(color, flags, pts, 5);
686 shp.SetMatrix(scaledMat);
687 if (output)
688 output.Insert(shp);
689 break;
690 }
691 case "Z":
692 {
693 pts[0] = Vector(start, caseScale * 0.9, 0);
694 pts[1] = Vector(start + 0.6, caseScale * 0.9, 0);
695 pts[2] = Vector(start, 0, 0);
696 pts[3] = Vector(start + 0.6, 0, 0);
697 shp = Shape.CreateLines(color, flags, pts, 4);
698 shp.SetMatrix(scaledMat);
699 if (output)
700 output.Insert(shp);
701
702 break;
703 }
704
705 // Numbers --------------------------------------------
706 case "0":
707 {
708 pts[0][0] = start + 0.5; pts[0][1] = 0.7;
709 pts[1][0] = start + 0.4; pts[1][1] = 0.9;
710 pts[2][0] = start + 0.2; pts[2][1] = 0.9;
711 pts[3][0] = start + 0.1; pts[3][1] = 0.7;
712 pts[4][0] = start + 0.1; pts[4][1] = 0.2;
713 pts[5][0] = start + 0.2; pts[5][1] = 0;
714 pts[6][0] = start + 0.4; pts[6][1] = 0;
715 pts[7][0] = start + 0.5; pts[7][1] = 0.2;
716 pts[8][0] = start + 0.5; pts[8][1] = 0.7;
717 pts[9] = pts[4];
718 shp = Shape.CreateLines(color, flags, pts, 10);
719 shp.SetMatrix(scaledMat);
720 if (output)
721 output.Insert(shp);
722
723 break;
724 }
725 case "1":
726 {
727 pts[0] = Vector(start + 0.1, 0.7, 0);
728 pts[1] = Vector(start + 0.3, 0.9, 0);
729 pts[2] = Vector(start + 0.3, 0, 0);
730 pts[3] = Vector(start + 0.1, 0, 0);
731 pts[4] = Vector(start + 0.5, 0, 0);
732 shp = Shape.CreateLines(color, flags, pts, 5);
733 shp.SetMatrix(scaledMat);
734 if (output)
735 output.Insert(shp);
736 break;
737 }
738 case "2":
739 {
740 pts[0] = Vector(start + 0.1, 0.7, 0);
741 pts[1] = Vector(start + 0.2, 0.9, 0);
742 pts[2] = Vector(start + 0.4, 0.9, 0);
743 pts[3] = Vector(start + 0.5, 0.7, 0);
744 pts[4] = Vector(start + 0.1, 0, 0);
745 pts[5] = Vector(start + 0.5, 0, 0);
746 shp = Shape.CreateLines(color, flags, pts, 6);
747 shp.SetMatrix(scaledMat);
748 if (output)
749 output.Insert(shp);
750
751 break;
752 }
753 case "3":
754 {
755 pts[0] = Vector(start + 0.1, 0.7, 0);
756 pts[1] = Vector(start + 0.2, 0.9, 0);
757 pts[2] = Vector(start + 0.4, 0.9, 0);
758 pts[3] = Vector(start + 0.5, 0.7, 0);
759 pts[4] = Vector(start + 0.4, 0.45, 0);
760 pts[5] = Vector(start + 0.3, 0.45, 0);
761 shp = Shape.CreateLines(color, flags, pts, 6);
762 shp.SetMatrix(scaledMat);
763 if (output)
764 output.Insert(shp);
765
766 pts[0] = Vector(start + 0.4, 0.45, 0);
767 pts[1] = Vector(start + 0.5, 0.2, 0);
768 pts[2] = Vector(start + 0.4, 0, 0);
769 pts[3] = Vector(start + 0.2, 0, 0);
770 pts[4] = Vector(start + 0.1, 0.2, 0);
771 shp = Shape.CreateLines(color, flags, pts, 5);
772 shp.SetMatrix(scaledMat);
773 if (output)
774 output.Insert(shp);
775
776 break;
777 }
778 case "4":
779 {
780 pts[0] = Vector(start + 0.4, 0, 0);
781 pts[1] = Vector(start + 0.4, 0.4, 0);
782 pts[2] = Vector(start + 0.4, 0.9, 0);
783 pts[3] = Vector(start + 0.1, 0.4, 0);
784 pts[4] = Vector(start + 0.4, 0.4, 0);
785 pts[5] = Vector(start + 0.5, 0.4, 0);
786 shp = Shape.CreateLines(color, flags, pts, 6);
787 shp.SetMatrix(scaledMat);
788 if (output)
789 output.Insert(shp);
790
791 break;
792 }
793 case "5":
794 {
795 pts[0] = Vector(start + 0.5, 0.9, 0);
796 pts[1] = Vector(start + 0.1, 0.9, 0);
797 pts[2] = Vector(start + 0.1, 0.5, 0);
798 pts[3] = Vector(start + 0.4, 0.5, 0);
799 pts[4] = Vector(start + 0.5, 0.3, 0);
800 pts[5] = Vector(start + 0.5, 0.2, 0);
801 pts[6] = Vector(start + 0.4, 0, 0);
802 pts[7] = Vector(start + 0.2, 0, 0);
803 pts[8] = Vector(start + 0.1, 0.2, 0);
804 shp = Shape.CreateLines(color, flags, pts, 9);
805 shp.SetMatrix(scaledMat);
806 if (output)
807 output.Insert(shp);
808
809 break;
810 }
811 case "6":
812 {
813 pts[0] = Vector(start + 0.4, 0.9, 0);
814 pts[1] = Vector(start + 0.2, 0.9, 0);
815 pts[2] = Vector(start + 0.1, 0.7, 0);
816 pts[3] = Vector(start + 0.1, 0.3, 0);
817 pts[4] = Vector(start + 0.1, 0.2, 0);
818 pts[5] = Vector(start + 0.2, 0, 0);
819 pts[6] = Vector(start + 0.4, 0, 0);
820 pts[7] = Vector(start + 0.5, 0.2, 0);
821 pts[8] = Vector(start + 0.5, 0.3, 0);
822 pts[9] = Vector(start + 0.4, 0.5, 0);
823 pts[10] = Vector(start + 0.2, 0.5, 0);
824 pts[11] = pts[3];
825 shp = Shape.CreateLines(color, flags, pts, 12);
826 shp.SetMatrix(scaledMat);
827 if (output)
828 output.Insert(shp);
829
830 break;
831 }
832 case "7":
833 {
834 pts[0] = Vector(start + 0.1, 0.9, 0);
835 pts[1] = Vector(start + 0.5, 0.9, 0);
836 pts[2] = Vector(start + 0.3, 0, 0);
837 shp = Shape.CreateLines(color, flags, pts, 3);
838 shp.SetMatrix(scaledMat);
839 if (output)
840 output.Insert(shp);
841
842 break;
843 }
844 case "8":
845 {
846 pts[0] = Vector(start + 0.4, 0.9, 0);
847 pts[1] = Vector(start + 0.2, 0.9, 0);
848 pts[2] = Vector(start + 0.1, 0.7, 0);
849 pts[3] = Vector(start + 0.2, 0.5, 0);
850 pts[4] = Vector(start + 0.4, 0.5, 0);
851 pts[5] = Vector(start + 0.5, 0.7, 0);
852 pts[6] = pts[0];
853 shp = Shape.CreateLines(color, flags, pts, 7);
854 shp.SetMatrix(scaledMat);
855 if (output)
856 output.Insert(shp);
857
858 pts[0] = Vector(start + 0.2, 0.5, 0);
859 pts[1] = Vector(start + 0.1, 0.3, 0);
860 pts[2] = Vector(start + 0.1, 0.2, 0);
861 pts[3] = Vector(start + 0.2, 0, 0);
862 pts[4] = Vector(start + 0.4, 0, 0);
863 pts[5] = Vector(start + 0.5, 0.2, 0);
864 pts[6] = Vector(start + 0.5, 0.3, 0);
865 pts[7] = Vector(start + 0.4, 0.5, 0);
866 shp = Shape.CreateLines(color, flags, pts, 8);
867 shp.SetMatrix(scaledMat);
868 if (output)
869 output.Insert(shp);
870
871 break;
872 }
873 case "9":
874 {
875 pts[0] = Vector(start + 0.5, 0.6, 0);
876 pts[1] = Vector(start + 0.4, 0.4, 0);
877 pts[2] = Vector(start + 0.2, 0.4, 0);
878 pts[3] = Vector(start + 0.1, 0.6, 0);
879 pts[4] = Vector(start + 0.1, 0.7, 0);
880 pts[5] = Vector(start + 0.2, 0.9, 0);
881 pts[6] = Vector(start + 0.4, 0.9, 0);
882 pts[7] = Vector(start + 0.5, 0.7, 0);
883 pts[8] = Vector(start + 0.5, 0.6, 0);
884 pts[9] = Vector(start + 0.5, 0.4, 0);
885 pts[10] = Vector(start + 0.5, 0.2, 0);
886 pts[11] = Vector(start + 0.4, 0, 0);
887 pts[12] = Vector(start + 0.2, 0, 0);
888 pts[13] = Vector(start + 0.1, 0.2, 0);
889 shp = Shape.CreateLines(color, flags, pts, 14);
890 shp.SetMatrix(scaledMat);
891 if (output)
892 output.Insert(shp);
893
894 break;
895 }
896
897 // Special --------------------------------------------
898 case "_":
899 {
900 pts[0] = Vector(start, 0.1, 0);
901 pts[1] = Vector(start + 0.6, 0.1, 0);
902 shp = Shape.CreateLines(color, flags, pts, 2);
903 shp.SetMatrix(scaledMat);
904 if (output)
905 output.Insert(shp);
906
907 break;
908 }
909 case "-":
910 {
911 pts[0] = Vector(start + 0.1, 0.45, 0);
912 pts[1] = Vector(start + 0.5, 0.45, 0);
913 shp = Shape.CreateLines(color, flags, pts, 2);
914 shp.SetMatrix(scaledMat);
915 if (output)
916 output.Insert(shp);
917
918 break;
919 }
920 case "+":
921 {
922 pts[0] = Vector(start + 0.1, 0.45, 0);
923 pts[1] = Vector(start + 0.5, 0.45, 0);
924 pts[2] = Vector(start + 0.3, 0.45, 0);
925 pts[3] = Vector(start + 0.3, 0.25, 0);
926 pts[4] = Vector(start + 0.3, 0.65, 0);
927 shp = Shape.CreateLines(color, flags, pts, 5);
928 shp.SetMatrix(scaledMat);
929 if (output)
930 output.Insert(shp);
931 break;
932 }
933 case ".":
934 {
935 pts[0] = Vector(start + 0.3, 0, 0);
936 pts[1] = Vector(start + 0.3, 0.05, 0);
937 pts[2] = Vector(start + 0.25, 0.05, 0);
938 pts[3] = Vector(start + 0.25, 0, 0);
939 pts[4] = pts[0];
940 shp = Shape.CreateLines(color, flags, pts, 5);
941 shp.SetMatrix(scaledMat);
942 if (output)
943 output.Insert(shp);
944
945 break;
946 }
947 case ":":
948 {
949 pts[0] = Vector(start + 0.3, 0.1, 0);
950 pts[1] = Vector(start + 0.3, 0.15, 0);
951 pts[2] = Vector(start + 0.25, 0.15, 0);
952 pts[3] = Vector(start + 0.25, 0.1, 0);
953 pts[4] = pts[0];
954 shp = Shape.CreateLines(color, flags, pts, 5);
955 shp.SetMatrix(scaledMat);
956 if (output)
957 output.Insert(shp);
958
959 pts[0] = Vector(start + 0.3, 0.6, 0);
960 pts[1] = Vector(start + 0.3, 0.65, 0);
961 pts[2] = Vector(start + 0.25, 0.65, 0);
962 pts[3] = Vector(start + 0.25, 0.6, 0);
963 pts[4] = pts[0];
964 shp = Shape.CreateLines(color, flags, pts, 5);
965 shp.SetMatrix(scaledMat);
966 if (output)
967 output.Insert(shp);
968
969 break;
970 }
971 case "!":
972 {
973 pts[0] = Vector(start + 0.3, 0.3, 0);
974 pts[1] = Vector(start + 0.3, 0.9, 0);
975 pts[2] = Vector(start + 0.25, 0.9, 0);
976 pts[3] = Vector(start + 0.25, 0.3, 0);
977 pts[4] = pts[0];
978 shp = Shape.CreateLines(color, flags, pts, 5);
979 shp.SetMatrix(scaledMat);
980 if (output)
981 output.Insert(shp);
982
983 pts[0] = Vector(start + 0.3, 0, 0);
984 pts[1] = Vector(start + 0.3, 0.05, 0);
985 pts[2] = Vector(start + 0.25, 0.05, 0);
986 pts[3] = Vector(start + 0.25, 0, 0);
987 pts[4] = pts[0];
988 shp = Shape.CreateLines(color, flags, pts, 5);
989 shp.SetMatrix(scaledMat);
990 if (output)
991 output.Insert(shp);
992
993 break;
994 }
995 case ",":
996 {
997 pts[0] = Vector(start + 0.3, 0, 0);
998 pts[1] = Vector(start + 0.2, 0, 0);
999 pts[2] = Vector(start + 0.1, -0.2, 0);
1000 pts[3] = Vector(start + 0.2, -0.2, 0);
1001 pts[4] = pts[0];
1002 shp = Shape.CreateLines(color, flags, pts, 5);
1003 shp.SetMatrix(scaledMat);
1004 if (output)
1005 output.Insert(shp);
1006
1007 break;
1008 }
1009 case "'":
1010 {
1011 pts[0] = Vector(start + 0.4, 0.9, 0);
1012 pts[1] = Vector(start + 0.25, 0.9, 0);
1013 pts[2] = Vector(start + 0.3, 0.6, 0);
1014 pts[3] = Vector(start + 0.35, 0.6, 0);
1015 pts[4] = pts[0];
1016 shp = Shape.CreateLines(color, flags, pts, 5);
1017 shp.SetMatrix(scaledMat);
1018 if (output)
1019 output.Insert(shp);
1020
1021 break;
1022 }
1023 case "/":
1024 {
1025 pts[0] = Vector(start + 0.54, 0.9, 0);
1026 pts[1] = Vector(start + 0.25, 0, 0);
1027 shp = Shape.CreateLines(color, flags, pts, 2);
1028 shp.SetMatrix(scaledMat);
1029 if (output)
1030 output.Insert(shp);
1031
1032 break;
1033 }
1034 case "%":
1035 {
1036 pts[0] = Vector(start + 0.55, 0.9, 0);
1037 pts[1] = Vector(start + 0.25, 0, 0);
1038 shp = Shape.CreateLines(color, flags, pts, 2);
1039 shp.SetMatrix(scaledMat);
1040 if (output)
1041 output.Insert(shp);
1042
1043 pts[0] = Vector(start + 0.2, 0.5, 0);
1044 pts[1] = Vector(start + 0.05, 0.7, 0);
1045 pts[2] = Vector(start + 0.2, 0.9, 0);
1046 pts[3] = Vector(start + 0.35, 0.7, 0);
1047 pts[4] = pts[0];
1048 shp = Shape.CreateLines(color, flags, pts, 5);
1049 shp.SetMatrix(scaledMat);
1050 if (output)
1051 output.Insert(shp);
1052
1053 pts[0] = Vector(start + 0.6, 0.1, 0);
1054 pts[1] = Vector(start + 0.45, 0.3, 0);
1055 pts[2] = Vector(start + 0.6, 0.5, 0);
1056 pts[3] = Vector(start + 0.75, 0.3, 0);
1057 pts[4] = pts[0];
1058 shp = Shape.CreateLines(color, flags, pts, 5);
1059 shp.SetMatrix(scaledMat);
1060 if (output)
1061 output.Insert(shp);
1062
1063 break;
1064 }
1065 }
1066 }
1067
1068 /*
1069 vector pts[53];
1070 for (int i = 0; i < subdivisions; i++)
1071 {
1072 int ptIndex = i + 1;
1073 vector pt = vector.YawToVector(sectionDeg * i + angMin) * radius;
1074 pt = Vector(-pt[0], 0, pt[1]); // Convert from Enforce to Enfusion format
1075 pt = pt.Multiply3(mat);
1076 pts[ptIndex] = pt + pos;
1077 }
1078 subdivisions += 2;
1079 pts[0] = pos;
1080 pts[subdivisions - 1] = pos;
1081
1082 return Shape.CreateLines(color, flags, pts, subdivisions); */
1083}
SCR_EAIThreatSectorFlags flags
vector scale
void CreateArrowLinkLines(vector from, vector to, vector faceDir, float size, int numArrows, int color, ShapeFlags flags)
void CreateSimpleText(string text, vector mat[4], float size, int color, ShapeFlags flags, array< ref Shape > output=null, float scaleWidth=1, bool doBackground=false, int backgroundColor=0x80000000)
Shape CreateCone(vector pos, vector aroundDir, float coneAngX, float coneAngY, float coneLength, int color, int subdivisions, ShapeFlags flags)
Definition DebugShapes.c:38
void ShowBoneDebug(IEntity ent, int bone, float scale)
Definition DebugShapes.c:7
Shape CreateCircleSlice(vector pos, vector aroundDir, vector forwardDir, float angMin, float angMax, float radius, int color, int subdivisions, ShapeFlags flags)
Shape CreateCircle(vector pos, vector aroundDir, float radius, int color, int subdivisions, ShapeFlags flags)
Definition DebugShapes.c:91
Shape CreateCircleArc(vector pos, vector aroundDir, vector forwardDir, float angMin, float angMax, float radius, int color, int subdivisions, ShapeFlags flags)
int size
proto external Animation GetAnimation()
proto external void GetTransform(out vector mat[])
Definition Math.c:13
Instance of created debug visualizer.
Definition Shape.c:14
ShapeType
Definition ShapeType.c:13
ShapeFlags
Definition ShapeFlags.c:13
proto native vector Vector(float x, float y, float z)
proto int ARGB(int a, int r, int g, int b)