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

Method ApplyBoneOffsets

trinity/Tr2GrannyAnimation.cpp:1502–1532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1500}
1501
1502void Tr2GrannyAnimation::ApplyBoneOffsets( unsigned i )
1503{
1504 if( IsUsingCMF() )
1505 {
1506 m_boneOffset.ApplyToLocal( i, m_pose.boneTransforms[i].rotation, m_pose.boneTransforms[i].position );
1507 }
1508#if WITH_GRANNY
1509 else
1510 {
1511 granny_real32 localMatrix[16];
1512 GrannyBuildCompositeTransform4x4( GrannyGetLocalPoseTransform( m_localPose, i ), localMatrix );
1513 granny_real32* worldMatrix = GrannyGetWorldPose4x4( m_worldPose, i );
1514
1515 const granny_int32 parentIndex = m_skeleton->Bones[i].ParentIndex;
1516 if( parentIndex != -1 )
1517 {
1518 const granny_real32* parentWorldMatrix = GrannyGetWorldPose4x4( m_worldPose, parentIndex );
1519
1520 if( !m_boneOffset.HaveTransforms() ||
1521 !m_boneOffset.Apply( worldMatrix, i, localMatrix, parentWorldMatrix ) )
1522 {
1523 GrannyColumnMatrixMultiply4x4( worldMatrix, localMatrix, parentWorldMatrix );
1524 }
1525 }
1526 else
1527 {
1528 memcpy( worldMatrix, localMatrix, sizeof( granny_real32 ) * 16 );
1529 }
1530 }
1531#endif
1532}
1533
1534#if WITH_GRANNY
1535void Tr2GrannyAnimation::UpdateAimingBone()

Callers

nothing calls this directly

Calls 4

IsUsingCMFFunction · 0.85
ApplyToLocalMethod · 0.80
HaveTransformsMethod · 0.80
ApplyMethod · 0.45

Tested by

no test coverage detected