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

Method RemoveBone

trinity/Tr2GrannyAnimationLayer.cpp:994–1034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

992}
993
994void Tr2GrannyAnimationLayer::RemoveBone( const Tr2GrannyAnimation* grannyAnimation, const char* name )
995{
996 CCP_ASSERT( grannyAnimation->IsUsingCMF() == m_useCMF );
997
998 if( IsUsingCMF() )
999 {
1000 m_bones.erase( std::remove( m_bones.begin(), m_bones.end(), name ), m_bones.end() );
1001
1002 if( !m_boneMask.skeleton )
1003 {
1004 return;
1005 }
1006
1007 unsigned int boneIndex = 0;
1008 if( !grannyAnimation->FindBoneByName( name, boneIndex ) )
1009 {
1010 return;
1011 }
1012
1013 m_boneMask.boneWeights[boneIndex] = 0.f;
1014 }
1015#if WITH_GRANNY
1016 else
1017 {
1018 m_bones.erase( std::remove( m_bones.begin(), m_bones.end(), name ), m_bones.end() );
1019
1020 if( !m_trackMask )
1021 {
1022 return;
1023 }
1024
1025 unsigned int boneIndex = 0;
1026 if( !grannyAnimation->FindBoneByName( name, boneIndex ) )
1027 {
1028 return;
1029 }
1030
1031 GrannySetTrackMaskBoneWeight( m_trackMask, boneIndex, 0.0 );
1032 }
1033#endif
1034}
1035
1036float Tr2GrannyAnimationLayer::GetLayerWeight() const
1037{

Callers 1

Calls 5

IsUsingCMFFunction · 0.85
IsUsingCMFMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
FindBoneByNameMethod · 0.45

Tested by

no test coverage detected