Project

General

Profile

« Previous | Next » 

Revision 4cd6a69c

Added by Leszek Koltunski about 2 months ago

Important bugfix for the shape of concave cubit walls!

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyCoinTetrahedron.java
67 67
    return new float[][] { f,f,f,f };
68 68
    }
69 69

  
70
///////////////////////////////////////////////////////////////////////////////////////////////////
71

  
72
  @Override
73
  public void adjustStickerCoords()
74
    {
75
    float Y = 0.02f;
76
    float Z = 0.06422593f - 0.25f*Y;
77
    float X = 0.5f - Y;
78

  
79
    float K = 1.00f;
80
    float A = K*0.50f;
81
    float B = K*0.25f;
82
    float C = K*0.43301257f;
83

  
84
    float D = 0.3580885f;
85
    float E = 0.12022744f;
86
    float F = 0.32227963f - 0.015f;
87
    float G = 0.14090173f + 0.01f;
88

  
89
    float H = 0.5f;
90
    float I = 0.0f;
91

  
92
    mStickerCoords = new float[][][][]
93
          {
94
                  { { {-D, E}, { I,-H}, {D, E}, {F, G}, {-F, G} } },
95
                  { { {-C,-B}, { C,-B}, {I, A} } },
96
                  { { {-X, Z}, { X, Z} } }
97
          };
98
    }
99

  
70 100
///////////////////////////////////////////////////////////////////////////////////////////////////
71 101

  
72 102
  @Override
......
75 105
    boolean icon = isInIconMode();
76 106

  
77 107
    float S1 = icon ? 0.15f : 0.13f;
78
    float S2 = icon ? 0.15f : 0.20f;
108
    float S2 = icon ? 0.15f : 0.07f;
79 109
    float S3 = icon ? 0.15f : 0.20f;
80 110

  
81 111
    return new float[][][] { {{ S1,S1,S1,S1,S1 }} , {{S2,S2,S2}} , {{S3,S3}} };
......
591 621
      }
592 622
    else if( variant==1 )
593 623
      {
594
      float h = isInIconMode() ? 0.0001f : 0.001f;
595
      float[][] bands = { {h,15,0.05f,0.1f,5,0,0}, {h,15,0.05f,0.1f,2,0,0} };
624
      float h = isInIconMode() ? 0.0001f : 0.01f;
625
      float[][] bands = { {h,25,0.05f,0.1f,5,0,0}, {h,25,0.05f,0.1f,2,0,0} };
596 626
      int num = 3+3*(N-1)+1;
597 627
      int[] indices   = new int[num];
598 628
      for(int i=1; i<num; i++) indices[i] = 1;
......
600 630
      }
601 631
    else
602 632
      {
603
      float h1 = isInIconMode() ? 0.0001f : 0.001f;
604
      float h2 = isInIconMode() ? 0.0001f : 0.001f;
633
      float h1 = isInIconMode() ? 0.0001f : 0.01f;
634
      float h2 = isInIconMode() ? 0.0001f : 0.01f;
605 635
      float[][] bands = { {h1,35,0.30f,0.5f,5,0,0}, {h2,25,0.125f,0.2f,2,0,0} };
606 636
      int num = 2+2*(N-1)+1;
607 637
      int[] indices   = new int[num];
......
679 709
    return 0.0f;
680 710
    }
681 711

  
682
///////////////////////////////////////////////////////////////////////////////////////////////////
683

  
684
  @Override
685
  public void adjustStickerCoords()
686
    {
687
    float Y = 0.02f;
688
    float Z = 0.06422593f - 0.25f*Y;
689
    float X = 0.5f - Y;
690

  
691
    float K = 1.45f;
692
    float A = K*0.50f;
693
    float B = K*0.25f;
694
    float C = K*0.43301257f;
695

  
696
    float D = 0.3580885f;
697
    float E = 0.12022744f;
698
    float F = 0.32227963f - 0.015f;
699
    float G = 0.14090173f + 0.01f;
700

  
701
    float H = 0.5f;
702
    float I = 0.0f;
703

  
704
    mStickerCoords = new float[][][][]
705
          {
706
                  { { {-D, E}, { I,-H}, {D, E}, {F, G}, {-F, G} } },
707
                  { { {-C, B}, { C, B}, {I,-A} } },
708
                  { { {-X, Z}, { X, Z} } }
709
          };
710
    }
711

  
712 712
///////////////////////////////////////////////////////////////////////////////////////////////////
713 713

  
714 714
  public float[][][] getStickerAngles()
715 715
    {
716 716
    float D1 = (float)(2*Math.PI/3);
717 717
    float D2 = (float)(Math.PI/3);
718
    return new float[][][] { {{ 0,0,0,-D1,0 }} , {{D2,D2,D2}} , {{D1,D2}} };
718
    return new float[][][] { {{ 0,0,0,-D1,0 }} , {{-D2,-D2,-D2}} , {{D1,D2}} };
719 719
    }
720 720

  
721 721
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff