Project

General

Profile

« Previous | Next » 

Revision 7a606778

Added by Leszek Koltunski over 3 years ago

Progress with any size Kilominx.

View differences:

src/main/java/org/distorted/objects/TwistyKilominx.java
341 341
        {
342 342
        float tmp   = (numLayers/3.0f)/(numLayers-1);
343 343
        float height= tmp*COS18;
344
        float width = tmp + type*height*SIN18/COS18;
344
        float width = tmp + (type/2)*height*SIN18/COS18;
345 345

  
346 346
        mEdgeMeshes[indexCornerEdge][type] = FactoryCubit.getInstance().createKilominxEdgeMesh(numLayers,width,height, (type%2)==0 );
347 347
        }
......
378 378
      return cubitface>=0 && cubitface<3 ? mCornerFaceMap[cubit][cubitface] : NUM_TEXTURES*NUM_FACES;
379 379
      }
380 380

  
381
    int numCubitsPerCorner = numCubitsPerCorner(numLayers);
382
    int numCubitsPerEdge   = numCubitsPerEdge(numLayers);
383

  
384
    cubit -= (NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge);
385

  
386
    if( cubit >= 0 )
387
      {
388
      return cubit/5;
389
      }
390

  
381 391
    return 0;
382 392
    }
383 393

  
src/main/java/org/distorted/objects/TwistyMinx.java
78 78
  // All 60 legal rotation quats of a Minx
79 79
  static final Static4D[] QUATS = new Static4D[]
80 80
         {
81
           new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),
81
           new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),  //0
82 82
           new Static4D(  1.0f,  0.0f,  0.0f,  0.0f ),
83 83
           new Static4D(  0.0f,  1.0f,  0.0f,  0.0f ),
84 84
           new Static4D(  0.0f,  0.0f,  1.0f,  0.0f ),
85 85

  
86
           new Static4D(  0.5f,  0.5f,  0.5f,  0.5f ),
86
           new Static4D(  0.5f,  0.5f,  0.5f,  0.5f ),  //4
87 87
           new Static4D(  0.5f,  0.5f, -0.5f,  0.5f ),
88 88
           new Static4D(  0.5f, -0.5f,  0.5f,  0.5f ),
89 89
           new Static4D(  0.5f, -0.5f, -0.5f,  0.5f ),
......
92 92
           new Static4D( -0.5f, -0.5f,  0.5f,  0.5f ),
93 93
           new Static4D( -0.5f, -0.5f, -0.5f,  0.5f ),
94 94

  
95
           new Static4D(  0.5f,    C1,    C0,  0.0f ),
95
           new Static4D(  0.5f,    C1,    C0,  0.0f ), // 12
96 96
           new Static4D(  0.5f,    C1,   -C0,  0.0f ),
97 97
           new Static4D(  0.5f,   -C1,    C0,  0.0f ),
98 98
           new Static4D(  0.5f,   -C1,   -C0,  0.0f ),
......
105 105
           new Static4D(   -C1,    C0,  0.5f,  0.0f ),
106 106
           new Static4D(   -C1,   -C0,  0.5f,  0.0f ),
107 107

  
108
           new Static4D(  0.0f,    C0,    C1,  0.5f ),
108
           new Static4D(  0.0f,    C0,    C1,  0.5f ), //24
109 109
           new Static4D(  0.0f,    C0,   -C1,  0.5f ),
110 110
           new Static4D(  0.0f,   -C0,    C1,  0.5f ),
111 111
           new Static4D(  0.0f,   -C0,   -C1,  0.5f ),
......
118 118
           new Static4D(   -C1,  0.0f,    C0,  0.5f ),
119 119
           new Static4D(   -C1,  0.0f,   -C0,  0.5f ),
120 120

  
121
           new Static4D(  0.0f,    C1,  0.5f,    C0 ),
121
           new Static4D(  0.0f,    C1,  0.5f,    C0 ), //36
122 122
           new Static4D(  0.0f,    C1, -0.5f,    C0 ),
123 123
           new Static4D(  0.0f,   -C1,  0.5f,    C0 ),
124 124
           new Static4D(  0.0f,   -C1, -0.5f,    C0 ),
......
131 131
           new Static4D(   -C1,  0.5f,  0.0f,    C0 ),
132 132
           new Static4D(   -C1, -0.5f,  0.0f,    C0 ),
133 133

  
134
           new Static4D(  0.0f,  0.5f,    C0,    C1 ),
134
           new Static4D(  0.0f,  0.5f,    C0,    C1 ), //48
135 135
           new Static4D(  0.0f,  0.5f,   -C0,    C1 ),
136 136
           new Static4D(  0.0f, -0.5f,    C0,    C1 ),
137 137
           new Static4D(  0.0f, -0.5f,   -C0,    C1 ),
......
196 196

  
197 197
  static final int[] QUAT_EDGE_INDICES =
198 198
      {
199
        56, 40, 43, 59,  0, 55, 10, 17, 25, 49,
200
        48, 57, 18,  7, 53, 32, 20, 11, 31, 38,
201
        37, 30,  8, 28, 36, 44,  1, 46, 12, 14
199
        56, 40, 43, 59,  0, 19,  9, 54, 58, 49,
200
        48, 24, 52,  4, 16, 32, 20, 11, 21, 35 ,
201
        37, 30,  8, 28, 36, 44,  1, 46, 12, 47
202 202
      };
203 203

  
204 204

  
......
224 224
  // the 'left' or right of vector corner1 --> corner2, according to Quat.
225 225
  static final int[][] mEdgeMap =
226 226
         {
227
           {  0, 12,  0,  8},
227
           {  0, 12,  0,  8}, //0
228 228
           { 12,  4,  0,  9},
229 229
           {  4, 14,  0,  4},
230 230
           { 14,  2,  0, 11},
231 231
           {  2,  0,  0,  1},
232
           { 14,  9,  4, 11},
233
           {  9, 11,  3, 11},
234
           { 11, 18,  2, 11},
235
           { 18,  2,  1, 11},
232
           { 14,  9, 11,  4}, //5
233
           {  9, 11, 11,  3},
234
           { 11, 18, 11,  2},
235
           { 18,  2, 11,  1},
236 236
           { 18,  6,  1,  2},
237
           {  6, 16,  1,  7},
238
           { 16,  0,  8,  1},
239
           { 16, 10,  7,  8},
240
           { 10,  8, 10,  8},
241
           {  8, 12,  9,  8},
242
           {  8, 13,  9, 10},
237
           {  6, 16,  1,  7}, //10
238
           { 16,  0,  1,  8},
239
           { 16, 10,  8,  7},
240
           { 10,  8,  8, 10},
241
           {  8, 12,  8,  9},
242
           {  8, 13,  9, 10}, //15
243 243
           { 13,  5,  9,  5},
244 244
           {  5,  4,  9,  4},
245
           {  5, 15,  5,  4},
246
           { 15,  9,  3,  4},
247
           { 11, 19,  2,  3},
245
           {  5, 15,  4,  5},
246
           { 15,  9,  4,  3},
247
           { 11, 19,  2,  3}, //20
248 248
           { 19,  7,  2,  6},
249 249
           {  7,  6,  2,  7},
250 250
           {  7, 17,  7,  6},
251 251
           { 17, 10,  7, 10},
252
           { 17,  1, 10,  6},
252
           { 17,  1, 10,  6}, //25
253 253
           {  1,  3,  5,  6},
254 254
           {  3, 19,  3,  6},
255 255
           {  1, 13, 10,  5},
256
           {  3, 15,  3,  5},
256
           {  3, 15,  5,  3},
257 257
         };
258 258

  
259 259
  // the five vertices that form a given face. Order: the same as colors

Also available in: Unified diff