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/TwistyUltimate.java
116 116
    return status<0 ? null : buildSolvedQuats(TouchControlDodecahedron.FACE_AXIS[status],mQuats);
117 117
    }
118 118

  
119
///////////////////////////////////////////////////////////////////////////////////////////////////
120

  
121
  public float[][] getCubitPositions(int[] numLayers)
122
    {
123
    if( mCenters==null )
124
      {
125
      mCenters = new float[][]
126
         {
127
           {   0,  -1, 2*G },
128
           { 2*E,-2*E,-2*E },
129
           {-2*G,   0,  -1 },
130
           {   1, 2*G,   0 },
131

  
132
           {-2*E,  2*E, 2*E },
133
           { 2*G,    0,   1 },
134
           {  -1, -2*G,   0 },
135
           {   0,    1,-2*G },
136

  
137
           {        E, (E+0.5f),    (E+G) },
138
           {   -(E+G),       -E, (E+0.5f) },
139
           { (E+0.5f),   -(E+G),        E },
140
           {       -E,-(E+0.5f),   -(E+G) },
141
           {    (E+G),        E,-(E+0.5f) },
142
           {-(E+0.5f),    (E+G),       -E }
143
         };
144
      }
145

  
146
    return mCenters;
147
    }
148

  
149
///////////////////////////////////////////////////////////////////////////////////////////////////
150

  
151
  public Static4D getCubitQuats(int cubit, int[] numLayers)
152
    {
153
    if( mQuats     ==null ) initializeQuats();
154
    if( mQuatIndex ==null ) mQuatIndex = new int[] { 0,6,1,2,0,4,6,5,0,1,4,9,5,2 };
155
    return mQuats[mQuatIndex[cubit]];
156
    }
157

  
119 158
///////////////////////////////////////////////////////////////////////////////////////////////////
120 159

  
121 160
  public ObjectShape getObjectShape(int variant)
......
238 277
      }
239 278
    }
240 279

  
241
///////////////////////////////////////////////////////////////////////////////////////////////////
242

  
243
  public Static4D getQuat(int cubit, int[] numLayers)
244
    {
245
    if( mQuats     ==null ) initializeQuats();
246
    if( mQuatIndex ==null ) mQuatIndex = new int[] { 0,6,1,2,0,4,6,5,0,1,4,9,5,2 };
247
    return mQuats[mQuatIndex[cubit]];
248
    }
249

  
250 280
///////////////////////////////////////////////////////////////////////////////////////////////////
251 281

  
252 282
  public int getNumCubitVariants(int[] numLayers)
......
261 291
    return cubit<4 ? 0 : (cubit<8 ? 1:2);
262 292
    }
263 293

  
264
///////////////////////////////////////////////////////////////////////////////////////////////////
265

  
266
  public float[][] getCubitPositions(int[] numLayers)
267
    {
268
    if( mCenters==null )
269
      {
270
      mCenters = new float[][]
271
         {
272
           {   0,  -1, 2*G },
273
           { 2*E,-2*E,-2*E },
274
           {-2*G,   0,  -1 },
275
           {   1, 2*G,   0 },
276

  
277
           {-2*E,  2*E, 2*E },
278
           { 2*G,    0,   1 },
279
           {  -1, -2*G,   0 },
280
           {   0,    1,-2*G },
281

  
282
           {        E, (E+0.5f),    (E+G) },
283
           {   -(E+G),       -E, (E+0.5f) },
284
           { (E+0.5f),   -(E+G),        E },
285
           {       -E,-(E+0.5f),   -(E+G) },
286
           {    (E+G),        E,-(E+0.5f) },
287
           {-(E+0.5f),    (E+G),       -E }
288
         };
289
      }
290

  
291
    return mCenters;
292
    }
293

  
294 294
///////////////////////////////////////////////////////////////////////////////////////////////////
295 295

  
296 296
  public Static4D[] getQuats()

Also available in: Unified diff