-void AtlasManager::StitchMesh( MeshData& first,
- const MeshData& second,
- bool optimize )
-{
-
- // Would be much quicker to be able to get a non-const reference to these containers and update in situ
- MeshData::VertexContainer v1 = first.GetVertices();
- MeshData::VertexContainer v2 = second.GetVertices();
- MeshData::FaceIndices f1 = first.GetFaces();
- MeshData::FaceIndices f2 = second.GetFaces();
-
- uint32_t vc1 = first.GetVertexCount();
- uint32_t vc2 = second.GetVertexCount();
-
- for ( uint32_t v = 0; v < vc2; ++v )
- {
- v1.push_back( v2[ v ] );
- }
-
- for ( uint32_t f = 0; f < f2.size(); ++f )
- {
- f1.push_back( f2[ f ] + vc1 );
- }
-
- if ( optimize )
- {
- MeshData::VertexContainer optimizedVertices;
- OptimizeVertices( v1, f1, optimizedVertices );
- first.SetVertices( optimizedVertices );
- }
- else
- {
- first.SetVertices( v1 );
- }
-
- first.SetFaceIndices( f1 );
-
- // TODO rather than set the material to the second, check to see if there's a match and return if not
- first.SetMaterial( second.GetMaterial() );
-}
-
-void AtlasManager::StitchMesh( const MeshData& first,
- const MeshData& second,
- MeshData& out,