Project

General

Profile

« Previous | Next » 

Revision d0e6cf7f

Added by Leszek Koltunski over 2 years ago

Simplification.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyRedi.java
236 236
    return mCenters;
237 237
    }
238 238

  
239
///////////////////////////////////////////////////////////////////////////////////////////////////
240

  
241
  public Static4D getCubitQuats(int cubit, int[] numLayers)
242
    {
243
    if( mQuats==null ) initializeQuats();
244

  
245
    switch(cubit)
246
      {
247
      case  0: return mQuats[0];                         //  unit quat
248
      case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
249
      case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
250
      case  3: return mQuats[1];                         // 180 along X
251
      case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
252
      case  5: return mQuats[2];                         // 180 along Y
253
      case  6: return mQuats[3];                         // 180 along Z
254
      case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
255

  
256
      case  8: return mQuats[0];
257
      case  9: return mQuats[5];
258
      case 10: return mQuats[3];
259
      case 11: return mQuats[11];
260
      case 12: return mQuats[4];
261
      case 13: return mQuats[7];
262
      case 14: return mQuats[9];
263
      case 15: return mQuats[10];
264
      case 16: return mQuats[2];
265
      case 17: return mQuats[8];
266
      case 18: return mQuats[1];
267
      case 19: return mQuats[6];
268
      }
269

  
270
    return null;
271
    }
272

  
239 273
///////////////////////////////////////////////////////////////////////////////////////////////////
240 274

  
241 275
  public ObjectShape getObjectShape(int variant)
......
324 358
      }
325 359
    }
326 360

  
327
///////////////////////////////////////////////////////////////////////////////////////////////////
328

  
329
  public Static4D getQuat(int cubit, int[] numLayers)
330
    {
331
    if( mQuats==null ) initializeQuats();
332

  
333
    switch(cubit)
334
      {
335
      case  0: return mQuats[0];                         //  unit quat
336
      case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
337
      case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
338
      case  3: return mQuats[1];                         // 180 along X
339
      case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
340
      case  5: return mQuats[2];                         // 180 along Y
341
      case  6: return mQuats[3];                         // 180 along Z
342
      case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
343

  
344
      case  8: return mQuats[0];
345
      case  9: return mQuats[5];
346
      case 10: return mQuats[3];
347
      case 11: return mQuats[11];
348
      case 12: return mQuats[4];
349
      case 13: return mQuats[7];
350
      case 14: return mQuats[9];
351
      case 15: return mQuats[10];
352
      case 16: return mQuats[2];
353
      case 17: return mQuats[8];
354
      case 18: return mQuats[1];
355
      case 19: return mQuats[6];
356
      }
357

  
358
    return null;
359
    }
360

  
361 361
///////////////////////////////////////////////////////////////////////////////////////////////////
362 362

  
363 363
  public int getNumCubitVariants(int[] numLayers)

Also available in: Unified diff