Project

General

Profile

« Previous | Next » 

Revision 92ec91b9

Added by Leszek Koltunski over 3 years ago

Progress with bandaged objects.

View differences:

src/main/java/org/distorted/objects/TwistyBandaged2Bar.java
57 57
    {
58 58
    switch(cubit)
59 59
      {
60
      case  0: return new float[] { 0.0f, +1.0f,  0.0f};
61
      case  1: return new float[] { 0.0f, -1.0f,  0.0f};
60
      case  0: return new float[] { 0.0f, +1.0f,  1.0f,
61
                                    0.0f, +1.0f,  0.0f,
62
                                    0.0f, +1.0f, -1.0f};
63
      case  1: return new float[] {-1.0f, -1.0f,  0.0f,
64
                                    0.0f, -1.0f,  0.0f,
65
                                    1.0f, -1.0f,  0.0f};
62 66
      case  2: return new float[] {-1.0f, +1.0f, +1.0f};
63 67
      case  3: return new float[] {-1.0f, +1.0f,  0.0f};
64 68
      case  4: return new float[] {-1.0f, +1.0f, -1.0f};
src/main/java/org/distorted/objects/TwistyBandaged3Plate.java
57 57
    {
58 58
    switch(cubit)
59 59
      {
60
      case  0: return new float[] {-0.5f,  0.5f,  1.0f};
61
      case  1: return new float[] { 1.0f,  0.5f, -0.5f};
62
      case  2: return new float[] {-0.5f, -1.0f, -0.5f};
63

  
60
      case  0: return new float[] {-1.0f,  1.0f,  1.0f,
61
                                   -1.0f,  0.0f,  1.0f,
62
                                    0.0f,  1.0f,  1.0f,
63
                                    0.0f,  0.0f,  1.0f};
64
      case  1: return new float[] { 1.0f,  0.0f, -1.0f,
65
                                    1.0f,  0.0f,  0.0f,
66
                                    1.0f,  1.0f, -1.0f,
67
                                    1.0f,  1.0f,  0.0f};
68
      case  2: return new float[] {-1.0f, -1.0f, -1.0f,
69
                                   -1.0f, -1.0f,  0.0f,
70
                                    0.0f, -1.0f, -1.0f,
71
                                    0.0f, -1.0f,  0.0f};
64 72
      case  3: return new float[] { 1.0f,  1.0f,  1.0f};
65 73
      case  4: return new float[] { 1.0f,  0.0f,  1.0f};
66 74
      case  5: return new float[] { 1.0f, -1.0f,  1.0f};
......
68 76
      case  7: return new float[] { 0.0f, -1.0f,  1.0f};
69 77
      case  8: return new float[] { 1.0f, -1.0f,  0.0f};
70 78
      case  9: return new float[] { 1.0f, -1.0f, -1.0f};
71

  
72 79
      case 10: return new float[] {-1.0f,  1.0f, -1.0f};
73 80
      case 11: return new float[] {-1.0f,  1.0f,  0.0f};
74 81
      case 12: return new float[] { 0.0f,  1.0f, -1.0f};
src/main/java/org/distorted/objects/TwistyBandagedAbstract.java
303 303
    int multiplier   = (face%2)==0 ? 1:-1;
304 304
    int posIndex     = face/2;
305 305
    int dimIndex     = mAxisMap[posIndex][quatIndex];
306
    boolean reaches  = multiplier*pos[posIndex] + dim[dimIndex]*0.5f > (numLayers-1)*0.5f;
306

  
307
    float position = 0.0f;
308
    int len = pos.length/3;
309
    for(int i=0; i<len; i++) position += pos[3*i+posIndex];
310
    position /= len;
311

  
312
    boolean reaches  = multiplier*position + dim[dimIndex]*0.5f > (numLayers-1)*0.5f;
307 313

  
308 314
    return reaches ? stickerIndex*NUM_FACES + face : NUM_STICKERS*NUM_FACES;
309 315
    }
src/main/java/org/distorted/objects/TwistyBandagedEvil.java
64 64
    switch(cubit)
65 65
      {
66 66
      case  0: return new float[] { 1.0f,  1.0f, -1.0f};
67
      case  1: return new float[] {-0.5f, -0.5f,  0.0f};
68
      case  2: return new float[] {-0.5f,  1.0f, -1.0f};
69
      case  3: return new float[] {-0.5f,  0.0f, -1.0f};
70
      case  4: return new float[] {-0.5f, -1.0f, -1.0f};
71
      case  5: return new float[] {-1.0f,  1.0f,  0.5f};
72
      case  6: return new float[] { 0.0f,  1.0f,  0.5f};
73
      case  7: return new float[] { 1.0f,  1.0f,  0.5f};
74
      case  8: return new float[] {-1.0f, -0.5f,  1.0f};
75
      case  9: return new float[] { 0.0f, -0.5f,  1.0f};
76
      case 10: return new float[] { 1.0f, -0.5f,  1.0f};
77
      case 11: return new float[] { 1.0f, -0.5f,  0.0f};
78
      case 12: return new float[] { 1.0f, -0.5f, -1.0f};
67
      case  1: return new float[] {-1.0f, -1.0f,  0.0f,
68
                                   -1.0f,  0.0f,  0.0f,
69
                                    0.0f, -1.0f,  0.0f,
70
                                    0.0f,  0.0f,  0.0f};
71
      case  2: return new float[] {-1.0f,  1.0f, -1.0f,
72
                                    0.0f,  1.0f, -1.0f};
73
      case  3: return new float[] {-1.0f,  0.0f, -1.0f,
74
                                    0.0f,  0.0f, -1.0f};
75
      case  4: return new float[] {-1.0f, -1.0f, -1.0f,
76
                                    0.0f, -1.0f, -1.0f};
77
      case  5: return new float[] {-1.0f,  1.0f,  0.0f,
78
                                   -1.0f,  1.0f,  1.0f};
79
      case  6: return new float[] { 0.0f,  1.0f,  0.0f,
80
                                    0.0f,  1.0f,  1.0f};
81
      case  7: return new float[] { 1.0f,  1.0f,  0.0f,
82
                                    1.0f,  1.0f,  1.0f};
83
      case  8: return new float[] {-1.0f, -1.0f,  1.0f,
84
                                   -1.0f,  0.0f,  1.0f};
85
      case  9: return new float[] { 0.0f, -1.0f,  1.0f,
86
                                    0.0f,  0.0f,  1.0f};
87
      case 10: return new float[] { 1.0f, -1.0f,  1.0f,
88
                                    1.0f,  0.0f,  1.0f};
89
      case 11: return new float[] { 1.0f, -1.0f,  0.0f,
90
                                    1.0f,  0.0f,  0.0f};
91
      case 12: return new float[] { 1.0f, -1.0f, -1.0f,
92
                                    1.0f,  0.0f, -1.0f};
79 93
      }
80 94

  
81 95
    return null;
src/main/java/org/distorted/objects/TwistyBandagedFused.java
57 57
    {
58 58
    switch(cubit)
59 59
      {
60
      case  0: return new float[] {-0.5f, -0.5f, +0.5f};
60
      case  0: return new float[] {-1.0f, -1.0f, +0.0f,
61
                                   -1.0f, -1.0f, +1.0f,
62
                                   -1.0f,  0.0f, +0.0f,
63
                                   -1.0f,  0.0f, +1.0f,
64
                                    0.0f, -1.0f, +0.0f,
65
                                    0.0f, -1.0f, +1.0f,
66
                                    0.0f,  0.0f, +0.0f,
67
                                    0.0f,  0.0f, +1.0f};
61 68
      case  1: return new float[] {-1.0f, +1.0f, +1.0f};
62 69
      case  2: return new float[] {-1.0f, +1.0f, +0.0f};
63 70
      case  3: return new float[] {-1.0f, +1.0f, -1.0f};

Also available in: Unified diff