Revision 8aceea06
Added by Leszek Koltunski about 2 years ago
src/main/java/org/distorted/objectlib/helpers/FactoryCubit.java | ||
---|---|---|
847 | 847 |
} |
848 | 848 |
|
849 | 849 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
850 |
// even if this is a multigon, then FaceTransform.vertices is the outer edge! |
|
851 |
// (see fitInSquare multigon variant) |
|
850 | 852 |
|
851 | 853 |
private boolean successfullyCollapsedStickers(final FaceTransform newInfo, final FaceTransform oldInfo) |
852 | 854 |
{ |
... | ... | |
1409 | 1411 |
|
1410 | 1412 |
bandsComputed = computeBands(height,alpha,dist,K,N); |
1411 | 1413 |
|
1412 |
if( !multigonMode ) |
|
1413 |
{ |
|
1414 |
sInfo = mStickerCoords.get(fInfo.sticker); |
|
1415 |
float[] verts = sInfo.vertices; |
|
1416 |
int lenVerts = verts.length; |
|
1417 |
float[] copiedVerts = new float[lenVerts]; |
|
1418 |
System.arraycopy(verts, 0, copiedVerts, 0, lenVerts); |
|
1419 |
meshes[face] = new MeshPolygon(copiedVerts,bandsComputed,exIndex,exVertices, convexXY[0], convexXY[1]); |
|
1420 |
} |
|
1421 |
else |
|
1414 |
sInfo = mStickerCoords.get(fInfo.sticker); |
|
1415 |
float[][] vertsF = sInfo.fullVertices; |
|
1416 |
|
|
1417 |
// i.e. multigon which hasn't been 'successfully collapsed' |
|
1418 |
// with a previously computed polygon sticker! |
|
1419 |
if( vertsF!=null ) |
|
1422 | 1420 |
{ |
1423 |
sInfo = mStickerCoords.get(fInfo.sticker); |
|
1424 |
float[][] verts = sInfo.fullVertices; |
|
1425 |
int lenVerts = verts.length; |
|
1421 |
int lenVerts = vertsF.length; |
|
1426 | 1422 |
float[][] copiedVerts = new float[lenVerts][]; |
1427 | 1423 |
|
1428 | 1424 |
for(int i=0; i<lenVerts; i++) |
1429 | 1425 |
{ |
1430 |
float[] v = verts[i]; |
|
1426 |
float[] v = vertsF[i];
|
|
1431 | 1427 |
int len = v.length; |
1432 | 1428 |
copiedVerts[i] = new float[len]; |
1433 | 1429 |
System.arraycopy(v, 0, copiedVerts[i], 0, len); |
... | ... | |
1435 | 1431 |
|
1436 | 1432 |
meshes[face] = new MeshMultigon(copiedVerts,bandsComputed,exIndex,exVertices); |
1437 | 1433 |
} |
1434 |
else |
|
1435 |
{ |
|
1436 |
float[] verts = sInfo.vertices; |
|
1437 |
int lenVerts = verts.length; |
|
1438 |
float[] copiedVerts = new float[lenVerts]; |
|
1439 |
System.arraycopy(verts, 0, copiedVerts, 0, lenVerts); |
|
1440 |
meshes[face] = new MeshPolygon(copiedVerts,bandsComputed,exIndex,exVertices, convexXY[0], convexXY[1]); |
|
1441 |
} |
|
1438 | 1442 |
|
1439 | 1443 |
meshes[face].setEffectAssociation(0,0,face); |
1440 | 1444 |
} |
Also available in: Unified diff
next bugfix