MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / DrawSphere

Method DrawSphere

Source/Engine/Debug/DebugDraw.cpp:1458–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1456}
1457
1458void DebugDraw::DrawSphere(const BoundingSphere& sphere, const Color& color, float duration, bool depthTest)
1459{
1460 DebugTriangle t;
1461 t.Color = Color32(color);
1462 t.TimeLeft = duration;
1463
1464 Array<DebugTriangle>* list;
1465 if (depthTest)
1466 list = duration > 0 ? &Context->DebugDrawDepthTest.DefaultTriangles : &Context->DebugDrawDepthTest.OneFrameTriangles;
1467 else
1468 list = duration > 0 ? &Context->DebugDrawDefault.DefaultTriangles : &Context->DebugDrawDefault.OneFrameTriangles;
1469 PROFILE_MEM(EngineDebug);
1470 list->EnsureCapacity(list->Count() + SphereTriangleCache.Count());
1471
1472 const Float3 centerF = sphere.Center - Context->Origin;
1473 const float radiusF = (float)sphere.Radius;
1474 for (int32 i = 0; i < SphereTriangleCache.Count();)
1475 {
1476 t.V0 = centerF + SphereTriangleCache[i++] * radiusF;
1477 t.V1 = centerF + SphereTriangleCache[i++] * radiusF;
1478 t.V2 = centerF + SphereTriangleCache[i++] * radiusF;
1479 list->Add(t);
1480 }
1481}
1482
1483void DebugDraw::DrawCircle(const Vector3& position, const Float3& normal, float radius, const Color& color, float duration, bool depthTest)
1484{

Callers 4

OnDebugDrawMethod · 0.45
OnDebugDrawMethod · 0.45
EditSplineWithSnapMethod · 0.45
UpdateMethod · 0.45

Calls 4

Color32Class · 0.50
EnsureCapacityMethod · 0.45
CountMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected