Sources/CcgDump/CrySkinBasisBuilder.cpp
// initializes the given rigid basis builder

initializes the given rigid basis builder
initializes the given rigid basis builder
void CrySkinBasisBuilder::initRigidBasisSkin (CrySkinRigidBasis* pSkin)
{
	assert (sizeof(SPipTangentsA16)==0x30);
	unsigned numAuxInts = 2 * (m_numBones-m_nFirstBone);
	unsigned numBases = m_nDestIntervalEnd-m_nDestIntervalBegin;
	pSkin->init (2 * numBases, numAuxInts, m_nFirstBone, m_numBones);
	CrySkinStreams stream, streamBegin, streamEnd;
	streamBegin.pAux  = pSkin->m_arrAux.begin();
	streamBegin.pVert = pSkin->m_arrVertices.begin();
	stream = streamBegin;
	streamEnd.pAux  = streamBegin.pAux  + numAuxInts;
	streamEnd.pVert = streamBegin.pVert	+ 2 * numBases;
	for (unsigned nBone = m_nFirstBone; nBone < m_numBones; ++nBone)
	{
		fillGroup (stream, m_arrBoneBases[nBone].arrRight);
		assert (stream.pAux <= streamEnd.pAux);
		assert (stream.pVert <= streamEnd.pVert);
		fillGroup (stream, m_arrBoneBases[nBone].arrLeft);
		assert (stream.pAux <= streamEnd.pAux);
		assert (stream.pVert <= streamEnd.pVert);
	}
}
void CrySkinBasisBuilder :: initRigidBasisSkin ( CrySkinRigidBasis * pSkin ) { assert ( sizeof ( SPipTangentsA16 ) == 0x30 ) ; unsigned numAuxInts = 2 * ( m_numBones - m_nFirstBone ) ; unsigned numBases = m_nDestIntervalEnd - m_nDestIntervalBegin ; pSkin -> init ( 2 * numBases , numAuxInts , m_nFirstBone , m_numBones ) ; CrySkinStreams stream , streamBegin , streamEnd ; streamBegin . pAux = pSkin -> m_arrAux . begin ( ) ; streamBegin . pVert = pSkin -> m_arrVertices . begin ( ) ; stream = streamBegin ; streamEnd . pAux = streamBegin . pAux + numAuxInts ; streamEnd . pVert = streamBegin . pVert + 2 * numBases ; for ( unsigned nBone = m_nFirstBone ; nBone < m_numBones ; ++ nBone ) { fillGroup ( stream , m_arrBoneBases [ nBone ] . arrRight ) ; assert ( stream . pAux <= streamEnd . pAux ) ; assert ( stream . pVert <= streamEnd . pVert ) ; fillGroup ( stream , m_arrBoneBases [ nBone ] . arrLeft ) ; assert ( stream . pAux <= streamEnd . pAux ) ; assert ( stream . pVert <= streamEnd . pVert ) ; } }
initializes the given rigid basis builder
initializes the given rigid basis builder
// for each bone, fill the three groups
 // we fill the left and right vertices
 // only when we processed the last bone, we should have the pAux pointing to the end
