Project

General

Profile

« Previous | Next » 

Revision e0343804

Added by Leszek Koltunski over 4 years ago

Bugfix and new debugging methods in MeshBase
DeferredJob app rewritten to show the (just fixed) bug

View differences:

src/main/java/org/distorted/library/mesh/MeshBase.java
377 377
       for(int j=0; j<numTexComponents; j++)
378 378
         {
379 379
         comp = new TexComponent(mesh.mTexComponent.get(j));
380
         comp.mEndIndex += (extraVerticesBefore+mNumVertices+extraVerticesAfter);
380
         comp.mEndIndex += (extraVerticesBefore+mNumVertices);
381
         if( j==numTexComponents-1) comp.mEndIndex += extraVerticesAfter;
381 382
         mTexComponent.add(comp);
382 383
         }
383 384

  
384 385
       for(int j=0; j<numEffComponents; j++)
385 386
         {
386 387
         int index = mesh.mEffComponent.get(j);
387
         index += (extraVerticesBefore+mNumVertices+extraVerticesAfter);
388
         index += (extraVerticesBefore+mNumVertices);
389
         if( j==numEffComponents-1 ) index += extraVerticesAfter;
388 390
         mEffComponent.add(index);
389 391

  
390 392
         if( origEffComponents<MAX_EFFECT_COMPONENTS )
......
597 599
 *
598 600
 * @y.exclude
599 601
 */
600
   public void print()
602
   public void printPos()
601 603
     {
602 604
     StringBuilder sb = new StringBuilder();
603 605

  
......
611 613
       sb.append(mVertAttribs1[VERT1_ATTRIBS*i+POS_ATTRIB+2]);
612 614
       sb.append(") ");
613 615
       }
616
     Log.d("mesh", sb.toString());
617
     }
614 618

  
615
     StringBuilder sb2 = new StringBuilder();
619
///////////////////////////////////////////////////////////////////////////////////////////////////
620
/**
621
 * Not part of public API, do not document (public only because has to be used from the main package)
622
 *
623
 * @y.exclude
624
 */
625
   public void printCom()
626
     {
627
     StringBuilder sb = new StringBuilder();
616 628

  
617 629
     for(int i=0; i<mNumVertices; i++)
618 630
       {
619
       sb2.append(mVertAttribs2[VERT2_ATTRIBS*i+COM_ATTRIB]);
620
       sb2.append(' ');
631
       sb.append(mVertAttribs2[VERT2_ATTRIBS*i+COM_ATTRIB]);
632
       sb.append(' ');
633
       }
634

  
635
     Log.d("mesh", sb.toString());
636
     }
637

  
638
///////////////////////////////////////////////////////////////////////////////////////////////////
639
/**
640
 * Not part of public API, do not document (public only because has to be used from the main package)
641
 *
642
 * @y.exclude
643
 */
644
   public void printTex()
645
     {
646
     int vert=0;
647
     int num = numTexComponents();
648
     StringBuilder sb = new StringBuilder();
649
     sb.append("tex components: ").append(num);
650

  
651
     for(int i=0; i<num; i++)
652
       {
653
       int end = mTexComponent.get(i).mEndIndex;
654
       sb.append("\n");
655

  
656
       for( ; vert<=end; vert++)
657
         {
658
         sb.append(' ');
659
         sb.append('(');
660
         sb.append(mVertAttribs2[VERT2_ATTRIBS*vert+TEX_ATTRIB]);
661
         sb.append(',');
662
         sb.append(mVertAttribs2[VERT2_ATTRIBS*vert+TEX_ATTRIB+1]);
663
         sb.append(')');
664
         }
621 665
       }
622 666

  
623
     Log.d("mesh", sb.toString()+"\n"+sb2.toString());
667
     Log.d("mesh", sb.toString());
624 668
     }
625 669

  
626 670
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff