MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / AddDebugTarget

Method AddDebugTarget

TombEngine/Renderer/RendererDraw.cpp:1248–1269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1246 }
1247
1248 void Renderer::AddDebugTarget(const Vector3& center, const Quaternion& orient, float radius, const Color& color, RendererDebugPage page)
1249 {
1250 if (_isLocked)
1251 return;
1252
1253 if (!DebugMode || (_debugPage != page && page != RendererDebugPage::None))
1254 return;
1255
1256 auto rotMatrix = Matrix::CreateFromQuaternion(orient);
1257
1258 auto origin0 = center + Vector3::Transform(Vector3(radius, 0.0f, 0.0f), rotMatrix);
1259 auto target0 = center + Vector3::Transform(Vector3(-radius, 0.0f, 0.0f), rotMatrix);
1260 AddDebugLine(origin0, target0, color);
1261
1262 auto origin1 = center + Vector3::Transform(Vector3(0.0f, radius, 0.0f), rotMatrix);
1263 auto target1 = center + Vector3::Transform(Vector3(0.0f, -radius, 0.0f), rotMatrix);
1264 AddDebugLine(origin1, target1, color);
1265
1266 auto origin2 = center + Vector3::Transform(Vector3(0.0f, 0.0f, radius), rotMatrix);
1267 auto target2 = center + Vector3::Transform(Vector3(0.0f, 0.0f, -radius), rotMatrix);
1268 AddDebugLine(origin2, target2, color);
1269 }
1270
1271 void Renderer::AddDebugBox(const std::array<Vector3, BOX_VERTEX_COUNT>& corners, const Color& color, RendererDebugPage page, bool isWireframe)
1272 {

Callers 1

DrawDebugTargetFunction · 0.80

Calls 1

Vector3Function · 0.50

Tested by

no test coverage detected