MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpdateDebugRenderer

Method UpdateDebugRenderer

trinity/Tr2GrannyAnimation.cpp:1553–1590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1551}
1552
1553void Tr2GrannyAnimation::UpdateDebugRenderer( const Matrix& modelTransform )
1554{
1555 extern ITr2DebugRendererPtr g_debugRenderer;
1556 if( g_debugRenderer )
1557 {
1558 if( m_debugRenderSkeleton )
1559 {
1560 for( int i = 0; i < m_skeleton->BoneCount; ++i )
1561 {
1562 int parentIx = m_skeleton->Bones[i].ParentIndex;
1563 if( parentIx != -1 )
1564 {
1565 Matrix fromMat = *reinterpret_cast<Matrix*>( GrannyGetWorldPose4x4( m_worldPose, parentIx ) );
1566 Matrix toMat = *reinterpret_cast<Matrix*>( GrannyGetWorldPose4x4( m_worldPose, i ) );
1567
1568 // Transform to our world coordinates
1569 fromMat = fromMat * modelTransform;
1570 toMat = toMat * modelTransform;
1571
1572 g_debugRenderer->DrawLine( fromMat.GetTranslation(), toMat.GetTranslation() );
1573 }
1574 }
1575 }
1576 if( m_debugRenderJointNames )
1577 {
1578 for( int i = 0; i < m_skeleton->BoneCount; ++i )
1579 {
1580 const char* name = m_skeleton->Bones[i].Name;
1581 Matrix m = *reinterpret_cast<Matrix*>( GrannyGetWorldPose4x4( m_worldPose, i ) );
1582
1583 // Transform to our world coordinates
1584 m = m * modelTransform;
1585
1586 g_debugRenderer->Printf( m.GetTranslation(), 0xffffffff, name );
1587 }
1588 }
1589 }
1590}
1591#endif
1592
1593void Tr2GrannyAnimation::UpdateAimingBone( const cmf::Skeleton& skeleton )

Callers

nothing calls this directly

Calls 4

GetTranslationMethod · 0.80
sizeMethod · 0.80
DrawLineMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected