Project

General

Profile

« Previous | Next » 

Revision b3c8eeda

Added by Leszek Koltunski 12 months ago

Improve Tins Cube.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyTins.java
179 179
             {-C3, C4,-C3},
180 180

  
181 181
             {-C5, C6, C3}, // F
182
             { C6,-C5, C3},
183 182
             { C5,-C6, C3},
184
             {-C6, C5, C3},
185 183
             { C5, C6,-C3}, // B
186
             {-C6,-C5,-C3},
187 184
             {-C5,-C6,-C3},
188
             { C6, C5,-C3},
189
             { C3, C6,-C5}, // R
190
             { C3, C5,-C6},
191
             { C3,-C6, C5},
185
             { C3, C5,-C6}, // R
192 186
             { C3,-C5, C6},
193
             {-C3, C6, C5}, // L
187
             {-C3,-C5,-C6}, // L
194 188
             {-C3, C5, C6},
195
             {-C3,-C6,-C5},
196
             {-C3,-C5,-C6},
197
             { C5, C3,-C6}, // T
189
             {-C6, C3, C5}, // T
198 190
             { C6, C3,-C5},
199
             {-C5, C3, C6},
200
             {-C6, C3, C5},
201
             { C5,-C3, C6}, // D
191
             {-C6,-C3,-C5}, // D
202 192
             { C6,-C3, C5},
193

  
194
             { C6,-C5, C3},
195
             {-C6, C5, C3},
196
             {-C6,-C5,-C3},
197
             { C6, C5,-C3},
198
             { C3,-C6, C5},
199
             { C3, C6,-C5},
200
             {-C3, C6, C5},
201
             {-C3,-C6,-C5},
202
             { C5, C3,-C6},
203
             {-C5, C3, C6},
204
             { C5,-C3, C6},
203 205
             {-C5,-C3,-C6},
204
             {-C6,-C3,-C5},
205 206
         };
206 207
      }
207 208

  
......
215 216
    if( mQuatIndex==null ) mQuatIndex = new int[] { 0, 3, 4, 6,
216 217
                                                    0, 8, 7,11, 5, 1,10, 2, 4, 9, 3, 6,
217 218
                                                    0, 2,10, 8, 1, 4, 6, 7,11, 5, 9, 3,
218
                                                    0, 0, 0, 0, 9, 9, 9, 9, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 4, 4, 4, 4
219
                                                    0,10,11, 9, 5, 2, 3, 8, 7, 1, 6, 4,
220
                                                    0,10,11, 9, 5, 2, 3, 8, 7, 1, 6, 4,
219 221
                                                  };
220 222
    return mObjectQuats[mQuatIndex[cubit]];
221 223
    }
......
262 264
             { 0.5f, 0.0f,-1.0f}
263 265
          };
264 266
      }
267
    else if( variant==3 )
268
      {
269
      return new float[][]
270
          {
271
             {-0.25f, 0.75f, 0.00f},
272
             { 0.75f,-0.25f, 0.00f},
273
             { 0.25f,-0.75f, 0.00f},
274
             {-0.75f, 0.25f, 0.00f},
275
             {-0.25f, 1.00f,-0.25f},
276
             { 0.75f, 0.50f,-0.75f},
277
             { 0.25f, 0.25f,-1.00f},
278
             {-0.75f, 0.75f,-0.50f}
279
          };
280
      }
265 281
    else
266 282
      {
267 283
      return new float[][]
268 284
          {
269
             {-0.25f, 0.75f, 0.0f},
270
             { 0.75f,-0.25f, 0.0f},
271
             { 0.25f,-0.75f, 0.0f},
272
             {-0.75f, 0.25f, 0.0f},
273
             { 0.00f, 0.00f,-1.0f},
285
             {-0.25f, 0.75f, 0.00f},
286
             { 0.75f,-0.25f, 0.00f},
287
             { 0.25f,-0.75f, 0.00f},
288
             {-0.75f, 0.25f, 0.00f},
289
             { 0.50f, 0.75f,-0.75f},
290
             { 1.00f,-0.25f,-0.25f},
291
             { 0.75f,-0.75f,-0.50f},
292
             { 0.25f, 0.25f,-1.00f}
274 293
          };
275 294
      }
276 295
    }
......
327 346
      int[][] indices =
328 347
          {
329 348
             {3,2,1,0},
330
             {4,1,2},
331
             {4,0,1},
332
             {4,3,0},
333
             {4,2,3}
349
             {6,5,1,2},
350
             {5,4,0,1},
351
             {4,7,3,0},
352
             {7,6,2,3},
353
             {4,5,6,7}
334 354
          };
335 355

  
336 356
      return new ObjectShape(getVertices(variant), indices);
......
368 388
    else
369 389
      {
370 390
      float h1 = isInIconMode() ? 0.001f : 0.040f;
371
      float h2 = isInIconMode() ? 0.001f : 0.010f;
391
      float h2 = isInIconMode() ? 0.001f : 0.002f;
372 392
      float[][] bands  = { {h1,30,0.3f,0.5f,5,0,0}, {h2,30,0.1f,0.2f,3,0,0} };
373
      int[] bandIndices= { 0,1,1,1,1 };
393
      int[] bandIndices= { 0,1,1,1,1,1,1,1 };
374 394
      return new ObjectFaceShape(bands,bandIndices,null);
375 395
      }
376 396
    }
......
412 432

  
413 433
  public int getNumCubitVariants(int[] numLayers)
414 434
    {
415
    return 4;
435
    return 5;
416 436
    }
417 437

  
418 438
///////////////////////////////////////////////////////////////////////////////////////////////////
419 439

  
420 440
  public int getCubitVariant(int cubit, int[] numLayers)
421 441
    {
422
    return cubit<4 ? 0: (cubit<16 ? 1: (cubit<28 ? 2:3));
442
    return cubit<4 ? 0: (cubit<16 ? 1: (cubit<28 ? 2: (cubit<40 ? 3:4)));
423 443
    }
424 444

  
425 445
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff