Sources/CcgDump/CrySkinBasisBuilder.cpp
//////////////////////////////////////////////////////////////////////////
// calculate the number of used bones and the skip-bone

calculate the number of used bones and the skip-bone
calculate the number of used bones and the skip - bone
void CrySkinBasisBuilder::preprocess()
{
	unsigned numTangents = m_pGeometry->numExtTangents();
	const unsigned* pExtToInt = m_pGeometry->getExtToIntMapEntries();
	m_numBones = 0;
	m_nFirstBone = 0;
	bool bNotInited = true;
	for (unsigned i = m_nDestIntervalBegin; i < min(m_nDestIntervalEnd,numTangents); ++i)
	{
		unsigned nGeomVert = pExtToInt[i];
		const CryVertexBinding& rLink = m_pGeometry->getLink(nGeomVert);
		unsigned nBone = rLink[0].BoneID;
		if (bNotInited)
		{
			m_nFirstBone = nBone;
			m_numBones = nBone+1;
			bNotInited = false;
		}
		else
		{
			m_nFirstBone = min (m_nFirstBone, nBone);
			m_numBones = max (nBone+1, m_numBones);
		}
	}
}
void CrySkinBasisBuilder :: preprocess ( ) { unsigned numTangents = m_pGeometry -> numExtTangents ( ) ; const unsigned * pExtToInt = m_pGeometry -> getExtToIntMapEntries ( ) ; m_numBones = 0 ; m_nFirstBone = 0 ; bool bNotInited = true ; for ( unsigned i = m_nDestIntervalBegin ; i < min ( m_nDestIntervalEnd , numTangents ) ; ++ i ) { unsigned nGeomVert = pExtToInt [ i ] ; const CryVertexBinding & rLink = m_pGeometry -> getLink ( nGeomVert ) ; unsigned nBone = rLink [ 0 ] . BoneID ; if ( bNotInited ) { m_nFirstBone = nBone ; m_numBones = nBone + 1 ; bNotInited = false ; } else { m_nFirstBone = min ( m_nFirstBone , nBone ) ; m_numBones = max ( nBone + 1 , m_numBones ) ; } } }
calculate the number of used bones and the skip-bone
calculate the number of used bones and the skip - bone