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

Method AddBone

trinity/Tr2GrannyAnimationLayer.cpp:894–934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892}
893
894void Tr2GrannyAnimationLayer::AddBone( const Tr2GrannyAnimation* grannyAnimation, const char* name )
895{
896 CCP_ASSERT( grannyAnimation->IsUsingCMF() == m_useCMF );
897
898 if( IsUsingCMF() )
899 {
900 m_bones.push_back( name );
901
902 if( !m_boneMask.skeleton )
903 {
904 return;
905 }
906
907 unsigned int boneIndex = 0;
908 if( !grannyAnimation->FindBoneByName( name, boneIndex ) )
909 {
910 return;
911 }
912
913 m_boneMask.boneWeights[boneIndex] = 1.f;
914 }
915#if WITH_GRANNY
916 else
917 {
918 m_bones.push_back( name );
919
920 if( !m_trackMask )
921 {
922 return;
923 }
924
925 unsigned int boneIndex = 0;
926 if( !grannyAnimation->FindBoneByName( name, boneIndex ) )
927 {
928 return;
929 }
930
931 GrannySetTrackMaskBoneWeight( m_trackMask, boneIndex, 1.0 );
932 }
933#endif
934}
935
936
937void Tr2GrannyAnimationLayer::AddAllBones( const Tr2GrannyAnimation* grannyAnimation )

Callers 1

AddAnimationLayerBoneMethod · 0.80

Calls 3

IsUsingCMFFunction · 0.85
IsUsingCMFMethod · 0.45
FindBoneByNameMethod · 0.45

Tested by

no test coverage detected