MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / debugDrawSkeleton

Method debugDrawSkeleton

src/components/AnimHandler.cpp:379–405  ·  view source on GitHub ↗

* @brief Draws the skeleton of the animation */

Source from the content-addressed store, hash-verified

377 * @brief Draws the skeleton of the animation
378 */
379void AnimHandler::debugDrawSkeleton(const Math::Matrix& transform)
380{
381 ddPush();
382 for (size_t i = 0; i < m_MeshLib.getNodes().size(); i++)
383 {
384 const ZenLoad::ModelNode& n = m_MeshLib.getNodes()[i];
385 const auto& t2 = m_ObjectSpaceNodeTransforms[i].Translation();
386
387 Math::float3 p2 = transform * t2;
388
389 ddSetTransform((transform * m_ObjectSpaceNodeTransforms[i]).v);
390 ddDrawAxis(0, 0, 0, 0.04f);
391 ddDrawAxis(0, 0, 0, -0.04f);
392
393 if (n.parentValid())
394 {
395 const auto& t1 = m_ObjectSpaceNodeTransforms[n.parentIndex].Translation();
396 Math::float3 p1 = (transform * t1);
397
398 ddSetTransform(nullptr);
399 ddSetColor(0xFFFFFFFF);
400 ddMoveTo(p1.x, p1.y, p1.z);
401 ddLineTo(p2.x, p2.y, p2.z);
402 }
403 }
404 ddPop();
405}
406
407/**
408 * @brief Updates the given skeletalmesh-info

Callers

nothing calls this directly

Calls 2

TranslationMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected