| 488 | } |
| 489 | |
| 490 | void duAppendCircle(struct duDebugDraw* dd, const float x, const float y, const float z, |
| 491 | const float r, unsigned int col) |
| 492 | { |
| 493 | if (!dd) return; |
| 494 | static const int NUM_SEG = 40; |
| 495 | static float dir[40*2]; |
| 496 | static bool init = false; |
| 497 | if (!init) |
| 498 | { |
| 499 | init = true; |
| 500 | for (int i = 0; i < NUM_SEG; ++i) |
| 501 | { |
| 502 | const float a = (float)i/(float)NUM_SEG*DU_PI*2; |
| 503 | dir[i*2] = cosf(a); |
| 504 | dir[i*2+1] = sinf(a); |
| 505 | } |
| 506 | } |
| 507 | |
| 508 | for (int i = 0, j = NUM_SEG-1; i < NUM_SEG; j = i++) |
| 509 | { |
| 510 | dd->vertex(x+dir[j*2+0]*r, y, z+dir[j*2+1]*r, col); |
| 511 | dd->vertex(x+dir[i*2+0]*r, y, z+dir[i*2+1]*r, col); |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | void duAppendCross(struct duDebugDraw* dd, const float x, const float y, const float z, |
| 516 | const float s, unsigned int col) |
no test coverage detected