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

Method FindBoneByName

trinity/Tr2GrannyAnimation.cpp:1895–1929  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1893}
1894
1895bool Tr2GrannyAnimation::FindBoneByName( const char* name, unsigned int& ix ) const
1896{
1897 if( IsUsingCMF() )
1898 {
1899 auto cmfData = GetCMFData();
1900 if( cmfData && m_modelIndex != -1 )
1901 {
1902 auto& skeleton = cmfData->skeletons[m_modelIndex];
1903 for( int32_t i = 0; i < skeleton.bones.size(); i++ )
1904 {
1905 if( cmf::ToStdStringView( skeleton.bones[i] ) == name )
1906 {
1907 ix = i;
1908 return true;
1909 }
1910 }
1911 }
1912 }
1913#if WITH_GRANNY
1914 else
1915 {
1916 if( m_skeleton )
1917 {
1918 granny_int32x boneIx;
1919 if( GrannyFindBoneByName( m_skeleton, name, &boneIx ) )
1920 {
1921 ix = boneIx;
1922 return true;
1923 }
1924 }
1925 }
1926#endif
1927
1928 return false;
1929}
1930
1931// --------------------------------------------------------------------------------------
1932// Description:

Callers 4

AddBoneMethod · 0.45
RemoveBoneMethod · 0.45

Calls 3

IsUsingCMFFunction · 0.85
sizeMethod · 0.80
ifFunction · 0.50

Tested by

no test coverage detected