void TSRGeometryContainer::ProcessPolyListsArrayDOM( const domMeshRef& _mesh ) { // there will be multiple triangles to process domPolylist_Array& polylists_array = _mesh->getPolylist_array(); unsigned int PolyListsCount = ( unsigned int ) polylists_array.getCount(); // loop on each group of triangles groups... // same should be done when there are polygons.. for ( unsigned int i = 0; i < PolyListsCount; i++ ) { TSRModelGeometryTriangleSet newSet; newSet.m_uiStartIndex = ( int ) m_pTwisterGeometry->GetIndexCount(); newSet.m_uiMaterialIndex = 0; domPolylistRef currPolyList = polylists_array[ i ]; xsNCName materialName = currPolyList->getMaterial(); int materialIndex = m_pExporter->FindMaterialIndexByName( materialName ); // material 0 is the default if no material was found... if ( materialIndex > -1 ) { newSet.m_uiMaterialIndex = materialIndex + 1; } ProcessPolyListDOM( currPolyList ); newSet.m_uiIndexCount = ( int ) m_pTwisterGeometry->GetIndexCount() - newSet.m_uiStartIndex; m_pTwisterGeometry->m_TriangleSets.push_back( newSet ); } }