Sources/CcgDump/CrySkinMorphBuilder.cpp
//////////////////////////////////////////////////////////////////////////
// calculates the vertex list of each bone, taking only those vertices 
// present in the morph vertex array

calculates the vertex list of each bone, taking only those vertices
present in the morph vertex array
calculates the vertex list of each bone taking only those vertices present in the morph vertex array
void CrySkinMorphBuilder::makeMorphBoneVertexArray()
{
	m_arrBoneVerts.clear();
	m_arrBoneVerts.resize (m_numAffectingBones);
	for (unsigned nMorphVert = 0; nMorphVert < m_numMorphVerts; ++nMorphVert)
	{
		unsigned nGeomVert = m_pMorphVerts[nMorphVert].nVertexId;
		const CryVertexBinding* pLinks = &m_pGeometry->getLink(nGeomVert);
		Vec3d ptMorphOffset = m_pMorphVerts[nMorphVert].ptVertex - m_pGeometry->getVertex(nGeomVert);
		if (pLinks->size() == 1)
		{
			unsigned nBone = (*pLinks)[0].BoneID;
			CrySkinRigidVertex v;
			v.nDest = nGeomVert;
			v.pt = m_pMatInvDef[nBone].TransformVectorOLD (ptMorphOffset);
			m_arrBoneVerts[nBone].arrRigid.push_back(v);
		}
		else
		{
			for (unsigned nLink = 0; nLink < pLinks->size(); ++nLink)
			{
				unsigned nBone = (*pLinks)[nLink].BoneID;
				CrySkinSmoothVertex v;
				v.fWeight = (*pLinks)[nLink].Blending;
				v.nDest = nGeomVert;
				v.pt = m_pMatInvDef[nBone].TransformVectorOLD (ptMorphOffset);
				m_arrBoneVerts[nBone].arrSmooth.push_back(v);
			}
		}
	}
}
void CrySkinMorphBuilder :: makeMorphBoneVertexArray ( ) { m_arrBoneVerts . clear ( ) ; m_arrBoneVerts . resize ( m_numAffectingBones ) ; for ( unsigned nMorphVert = 0 ; nMorphVert < m_numMorphVerts ; ++ nMorphVert ) { unsigned nGeomVert = m_pMorphVerts [ nMorphVert ] . nVertexId ; const CryVertexBinding * pLinks = & m_pGeometry -> getLink ( nGeomVert ) ; Vec3d ptMorphOffset = m_pMorphVerts [ nMorphVert ] . ptVertex - m_pGeometry -> getVertex ( nGeomVert ) ; if ( pLinks -> size ( ) == 1 ) { unsigned nBone = ( * pLinks ) [ 0 ] . BoneID ; CrySkinRigidVertex v ; v . nDest = nGeomVert ; v . pt = m_pMatInvDef [ nBone ] . TransformVectorOLD ( ptMorphOffset ) ; m_arrBoneVerts [ nBone ] . arrRigid . push_back ( v ) ; } else { for ( unsigned nLink = 0 ; nLink < pLinks -> size ( ) ; ++ nLink ) { unsigned nBone = ( * pLinks ) [ nLink ] . BoneID ; CrySkinSmoothVertex v ; v . fWeight = ( * pLinks ) [ nLink ] . Blending ; v . nDest = nGeomVert ; v . pt = m_pMatInvDef [ nBone ] . TransformVectorOLD ( ptMorphOffset ) ; m_arrBoneVerts [ nBone ] . arrSmooth . push_back ( v ) ; } } } }
calculates the vertex list of each bone, taking only those vertices
present in the morph vertex array
calculates the vertex list of each bone taking only those vertices present in the morph vertex array
// the morph vertex target in the object coordinates
 // transform the point into the bone coordinates
 //CHANGED_BY_IVO - INVALID CHANGE, PLEASE REVISE
 //v.pt = GetTransposed44(m_pMatInvDef[nBone])*(ptMorphOffset);
