| 1551 | } |
| 1552 | |
| 1553 | void 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 | |
| 1593 | void Tr2GrannyAnimation::UpdateAimingBone( const cmf::Skeleton& skeleton ) |
nothing calls this directly
no test coverage detected