Added a missing ImportData in the polygon to tri converstion function in order to allow the copy of most of the data from the polygonal face to the splitted one.

This commit is contained in:
Paolo Cignoni 2014-06-24 08:50:32 +00:00
parent babd813674
commit 87e2599d27
1 changed files with 5 additions and 4 deletions

View File

@ -96,16 +96,17 @@ namespace tri {
TessellatePlanarPolygon3(points,faces);
tfib = tfi = Allocator<TriMeshType>::AddFaces(tm,faces.size()/3);
for(size_t i = 0; tfi != tm.face.end();++tfi){
(*tfi).V(0) = &tm.vert[ (*fi).V( faces[i] ) - &(*pm.vert.begin())];
(*tfi).V(1) = &tm.vert[ (*fi).V( faces[i+1]) - &(*pm.vert.begin())];
(*tfi).V(2) = &tm.vert[ (*fi).V( faces[i+2]) - &(*pm.vert.begin())];
tfi->ImportData(*fi);
(*tfi).V(0) = &tm.vert[ tri::Index(pm,(*fi).V( faces[i+0] )) ];
(*tfi).V(1) = &tm.vert[ tri::Index(pm,(*fi).V( faces[i+1] )) ];
(*tfi).V(2) = &tm.vert[ tri::Index(pm,(*fi).V( faces[i+2] )) ];
// set the F flags
if( (faces[i ]+1)%points.size() != size_t(faces[i+1])) (*tfi).SetF(0);
if( (faces[i+1]+1)%points.size() != size_t(faces[i+2])) (*tfi).SetF(1);
if( (faces[i+2]+1)%points.size() != size_t(faces[i ])) (*tfi).SetF(2);
i+=3;
}
}
}