@@ -11889,6 +11889,7 @@ protected class TessellatorCallback implements PGL.TessellatorCallback {
11889
11889
int cacheIndex ;
11890
11890
int vertFirst ;
11891
11891
int vertCount ;
11892
+ int vertOffset ;
11892
11893
int primitive ;
11893
11894
11894
11895
public void init (boolean addCache , boolean strokeTess , boolean calcNorm ,
@@ -11913,7 +11914,9 @@ public void begin(int type) {
11913
11914
}
11914
11915
11915
11916
vertFirst = cache .vertexCount [cacheIndex ];
11917
+ vertOffset = cache .vertexOffset [cacheIndex ];
11916
11918
vertCount = 0 ;
11919
+ System .out .println (vertFirst + " " + vertOffset );
11917
11920
11918
11921
if (type == PGL .TRIANGLE_FAN ) primitive = TRIANGLE_FAN ;
11919
11922
else if (type == PGL .TRIANGLE_STRIP ) primitive = TRIANGLE_STRIP ;
@@ -11929,7 +11932,8 @@ public void end() {
11929
11932
// every time a new vertex was emitted (see vertex() below).
11930
11933
//tessBlock = tess.addFillIndexBlock(tessBlock);
11931
11934
cacheIndex = cache .addNew ();
11932
- vertFirst = 0 ;
11935
+ vertFirst = cache .vertexCount [cacheIndex ];
11936
+ vertOffset = cache .vertexOffset [cacheIndex ];
11933
11937
}
11934
11938
11935
11939
int indCount = 0 ;
@@ -11989,8 +11993,9 @@ protected void addIndex(int tessIdx) {
11989
11993
}
11990
11994
11991
11995
protected void calcTriNormal (int tessIdx0 , int tessIdx1 , int tessIdx2 ) {
11992
- tess .calcPolyNormal (vertFirst + tessIdx0 , vertFirst + tessIdx1 ,
11993
- vertFirst + tessIdx2 );
11996
+ tess .calcPolyNormal (vertFirst + vertOffset + tessIdx0 ,
11997
+ vertFirst + vertOffset + tessIdx1 ,
11998
+ vertFirst + vertOffset + tessIdx2 );
11994
11999
}
11995
12000
11996
12001
public void vertex (Object data ) {
0 commit comments