MCPcopy Create free account
hub / github.com/axmolengine/axmol / duAppendCircle

Function duAppendCircle

3rdparty/recast/DebugDraw.cpp:490–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490void 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
515void duAppendCross(struct duDebugDraw* dd, const float x, const float y, const float z,
516 const float s, unsigned int col)

Callers 3

drawMeshTileFunction · 0.85
duDebugDrawCircleFunction · 0.85

Calls 1

vertexMethod · 0.45

Tested by

no test coverage detected