Project

General

Profile

« Previous | Next » 

Revision bcbd5b45

Added by Leszek Koltunski about 4 years ago

Adjustment to Static's API.

View differences:

src/main/java/org/distorted/examples/dynamic/DynamicSurfaceView.java
482 482
      for(int curr=0; curr<len; curr++)
483 483
        {
484 484
        p1D = di1D.getPoint(curr);
485
        drawRedPoint(c,curr+"", p1D.get1(), halfScreenHeight);
485
        drawRedPoint(c,curr+"", p1D.get0(), halfScreenHeight);
486 486
        }
487 487
      }
488 488

  
......
495 495
      for(int curr=0; curr<len; curr++)
496 496
        {
497 497
        p2D = di2D.getPoint(curr);
498
        drawRedPoint(c,curr+"", p2D.get1(), p2D.get2());
498
        drawRedPoint(c,curr+"", p2D.get0(), p2D.get1());
499 499
        }
500 500
      }
501 501

  
......
508 508
      for(int curr=0; curr<len; curr++)
509 509
        {
510 510
        p3D = di3D.getPoint(curr);
511
        drawRedPoint(c,curr+"", p3D.get1(), currentDim==DIM_3DXY ? p3D.get2():p3D.get3());
511
        drawRedPoint(c,curr+"", p3D.get0(), currentDim==DIM_3DXY ? p3D.get1():p3D.get2());
512 512
        }
513 513
      }
514 514

  
......
522 522
        {
523 523
        p4D = di4D.getPoint(curr);
524 524

  
525
        if( currentDim==DIM_4DXY ) drawRedPoint(c,curr+"", p4D.get1(), p4D.get2());
526
        else                       drawRedPoint(c,curr+"", p4D.get3(), p4D.get4());
525
        if( currentDim==DIM_4DXY ) drawRedPoint(c,curr+"", p4D.get0(), p4D.get1());
526
        else                       drawRedPoint(c,curr+"", p4D.get2(), p4D.get3());
527 527
        }
528 528
      }
529 529

  
......
540 540

  
541 541
        if( currentDim==DIM_Q_XY )
542 542
          {
543
          x = pQD.get1()*min + halfScreenWidth;
544
          y = pQD.get2()*min + halfScreenHeight;
543
          x = pQD.get0()*min + halfScreenWidth;
544
          y = pQD.get1()*min + halfScreenHeight;
545 545
          }
546 546
        else
547 547
          {
548
          x = pQD.get3()*min + halfScreenWidth;
549
          y = pQD.get4()*min + halfScreenHeight;
548
          x = pQD.get2()*min + halfScreenWidth;
549
          y = pQD.get3()*min + halfScreenHeight;
550 550
          }
551 551

  
552 552
        drawRedPoint(c,curr+"", x,y);
......
578 578
                      for(int g=0; g<len; g++)
579 579
                        {
580 580
                        p1D = di1D.getPoint(g);
581
                        gx = p1D.get1();
581
                        gx = p1D.get0();
582 582
                                    
583 583
                        if( (x-gx)*(x-gx) < minDist )
584 584
                          {
......
600 600
                      for(int g=0; g<len; g++)
601 601
                        {
602 602
                        p2D = di2D.getPoint(g);
603
                        gx = p2D.get1();
604
                        gy = p2D.get2();
603
                        gx = p2D.get0();
604
                        gy = p2D.get1();
605 605
                                    
606 606
                        if( (x-gx)*(x-gx) + (y-gy)*(y-gy) < minDist )
607 607
                          {
......
624 624
                      for(int g=0; g<len; g++)
625 625
                        {
626 626
                        p3D = di3D.getPoint(g);
627
                        gx = p3D.get1();
628
                        gy = p3D.get2();
629
                        gz = p3D.get3();
627
                        gx = p3D.get0();
628
                        gy = p3D.get1();
629
                        gz = p3D.get2();
630 630
                               
631 631
                        if( currentDim==DIM_3DXY )
632 632
                          {
......
662 662
                      for(int g=0; g<len; g++)
663 663
                        {
664 664
                        p4D = di4D.getPoint(g);
665
                        gx = p4D.get1();
666
                        gy = p4D.get2();
667
                        gz = p4D.get3();
668
                        gw = p4D.get4();
665
                        gx = p4D.get0();
666
                        gy = p4D.get1();
667
                        gz = p4D.get2();
668
                        gw = p4D.get3();
669 669

  
670 670
                        if( currentDim==DIM_4DXY )
671 671
                          {
......
705 705

  
706 706
                        if( currentDim==DIM_Q_XY )
707 707
                          {
708
                          gx = pQD.get1()*min + halfScreenWidth;
709
                          gy = pQD.get2()*min + halfScreenHeight;
708
                          gx = pQD.get0()*min + halfScreenWidth;
709
                          gy = pQD.get1()*min + halfScreenHeight;
710 710

  
711 711
                          if( (x-gx)*(x-gx) + (y-gy)*(y-gy) < minDist )
712 712
                            {
......
716 716
                          }
717 717
                        if( currentDim==DIM_Q_ZW )
718 718
                          {
719
                          gz = pQD.get3()*min + halfScreenWidth;
720
                          gw = pQD.get4()*min + halfScreenHeight;
719
                          gz = pQD.get2()*min + halfScreenWidth;
720
                          gw = pQD.get3()*min + halfScreenHeight;
721 721

  
722 722
                          if( (x-gz)*(x-gz) + (y-gw)*(y-gw) < minDist )
723 723
                            {
......
808 808
                                                         break;
809 809
                                          case DIM_2D  : di2D.setPoint(mMoving, xDown, yDown);
810 810
                                                         break;
811
                                          case DIM_3DXY: di3D.setPoint(mMoving, xDown, yDown, (int)di3D.getPoint(mMoving).get3());
811
                                          case DIM_3DXY: di3D.setPoint(mMoving, xDown, yDown, (int)di3D.getPoint(mMoving).get2());
812 812
                                                         break;
813
                                          case DIM_3DXZ: di3D.setPoint(mMoving, xDown, (int)di3D.getPoint(mMoving).get2(), yDown);
813
                                          case DIM_3DXZ: di3D.setPoint(mMoving, xDown, (int)di3D.getPoint(mMoving).get1(), yDown);
814 814
                                                         break;
815
                                          case DIM_4DXY: di4D.setPoint(mMoving, xDown, yDown, (int)di4D.getPoint(mMoving).get3(), (int)di4D.getPoint(mMoving).get4());
815
                                          case DIM_4DXY: di4D.setPoint(mMoving, xDown, yDown, (int)di4D.getPoint(mMoving).get2(), (int)di4D.getPoint(mMoving).get3());
816 816
                                                         break;
817
                                          case DIM_4DZW: di4D.setPoint(mMoving, (int)di4D.getPoint(mMoving).get1(), (int)di4D.getPoint(mMoving).get2(), xDown, yDown);
817
                                          case DIM_4DZW: di4D.setPoint(mMoving, (int)di4D.getPoint(mMoving).get0(), (int)di4D.getPoint(mMoving).get1(), xDown, yDown);
818 818
                                                         break;
819 819
                                          case DIM_Q_XY: float min1 = QUAT_QUOT* (halfScreenWidth<halfScreenHeight ? halfScreenWidth:halfScreenHeight );
820 820
                                                         float x1 = (xDown - halfScreenWidth ) / min1;
821 821
                                                         float y1 = (yDown - halfScreenHeight) / min1;
822
                                                         float z1 = diQu.getPoint(mMoving).get3();
823
                                                         float w1 = diQu.getPoint(mMoving).get4();
822
                                                         float z1 = diQu.getPoint(mMoving).get2();
823
                                                         float w1 = diQu.getPoint(mMoving).get3();
824 824
                                                         float len1 = x1*x1 + y1*y1;
825 825

  
826 826
                                                         if( len1 <= 1.0f )
......
858 858
                                                         diQu.setPoint(mMoving, x1,y1,z1,w1);
859 859
                                                         break;
860 860
                                          case DIM_Q_ZW: float min2 = QUAT_QUOT* (halfScreenWidth<halfScreenHeight ? halfScreenWidth:halfScreenHeight );
861
                                                         float x2 = diQu.getPoint(mMoving).get1();
862
                                                         float y2 = diQu.getPoint(mMoving).get2();
861
                                                         float x2 = diQu.getPoint(mMoving).get0();
862
                                                         float y2 = diQu.getPoint(mMoving).get1();
863 863
                                                         float z2 = (xDown - halfScreenWidth ) / min2;
864 864
                                                         float w2 = (yDown - halfScreenHeight) / min2;
865 865
                                                         float len3 = z2*z2 + w2*w2;

Also available in: Unified diff