MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / duAppendArc

Function duAppendArc

Engine/lib/recast/DebugUtils/Source/DebugDraw.cpp:432–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 5

drawMeshTileFunction · 0.85
duDebugDrawNavMeshPolyFunction · 0.85
duDebugDrawArcFunction · 0.85
renderLinksMethod · 0.85

Calls 3

evalArcFunction · 0.85
appendArrowHeadFunction · 0.85
vertexMethod · 0.45

Tested by

no test coverage detected