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

Function duAppendArc

3rdparty/recast/DebugDraw.cpp:431–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void duAppendArc(struct duDebugDraw* dd, const float x0, const float y0, const float z0,
432 const float x1, const float y1, const float z1, const float h,
433 const float as0, const float as1, unsigned int col)
434{
435 if (!dd) return;
436 static const int NUM_ARC_PTS = 8;
437 static const float PAD = 0.05f;
438 static const float ARC_PTS_SCALE = (1.0f-PAD*2) / (float)NUM_ARC_PTS;
439 const float dx = x1 - x0;
440 const float dy = y1 - y0;
441 const float dz = z1 - z0;
442 const float len = sqrtf(dx*dx + dy*dy + dz*dz);
443 float prev[3];
444 evalArc(x0,y0,z0, dx,dy,dz, len*h, PAD, prev);
445 for (int i = 1; i <= NUM_ARC_PTS; ++i)
446 {
447 const float u = PAD + i * ARC_PTS_SCALE;
448 float pt[3];
449 evalArc(x0,y0,z0, dx,dy,dz, len*h, u, pt);
450 dd->vertex(prev[0],prev[1],prev[2], col);
451 dd->vertex(pt[0],pt[1],pt[2], col);
452 prev[0] = pt[0]; prev[1] = pt[1]; prev[2] = pt[2];
453 }
454
455 // End arrows
456 if (as0 > 0.001f)
457 {
458 float p[3], q[3];
459 evalArc(x0,y0,z0, dx,dy,dz, len*h, PAD, p);
460 evalArc(x0,y0,z0, dx,dy,dz, len*h, PAD+0.05f, q);
461 appendArrowHead(dd, p, q, as0, col);
462 }
463
464 if (as1 > 0.001f)
465 {
466 float p[3], q[3];
467 evalArc(x0,y0,z0, dx,dy,dz, len*h, 1-PAD, p);
468 evalArc(x0,y0,z0, dx,dy,dz, len*h, 1-(PAD+0.05f), q);
469 appendArrowHead(dd, p, q, as1, col);
470 }
471}
472
473void duAppendArrow(struct duDebugDraw* dd, const float x0, const float y0, const float z0,
474 const float x1, const float y1, const float z1,

Callers 4

drawMeshTileFunction · 0.85
duDebugDrawNavMeshPolyFunction · 0.85
duDebugDrawArcFunction · 0.85

Calls 3

evalArcFunction · 0.85
appendArrowHeadFunction · 0.85
vertexMethod · 0.45

Tested by

no test coverage detected