Project

General

Profile

Download (21 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objects / RubikObject.java @ 10585385

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19

    
20
package org.distorted.objects;
21

    
22
import android.content.SharedPreferences;
23
import android.graphics.Bitmap;
24
import android.graphics.Canvas;
25
import android.graphics.Paint;
26

    
27
import com.google.firebase.crashlytics.FirebaseCrashlytics;
28

    
29
import org.distorted.library.effect.Effect;
30
import org.distorted.library.effect.MatrixEffectMove;
31
import org.distorted.library.effect.MatrixEffectQuaternion;
32
import org.distorted.library.effect.MatrixEffectScale;
33
import org.distorted.library.effect.VertexEffectQuaternion;
34
import org.distorted.library.effect.VertexEffectRotate;
35
import org.distorted.library.main.DistortedEffects;
36
import org.distorted.library.main.DistortedNode;
37
import org.distorted.library.main.DistortedTexture;
38
import org.distorted.library.mesh.MeshBase;
39
import org.distorted.library.mesh.MeshJoined;
40
import org.distorted.library.mesh.MeshRectangles;
41
import org.distorted.library.message.EffectListener;
42
import org.distorted.library.type.Dynamic1D;
43
import org.distorted.library.type.Static1D;
44
import org.distorted.library.type.Static3D;
45
import org.distorted.library.type.Static4D;
46

    
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48

    
49
public abstract class RubikObject extends DistortedNode
50
  {
51
  private static final Static3D CENTER = new Static3D(0,0,0);
52
  static final int INTERIOR_COLOR = 0xff000000;
53
  public static final int NODE_FBO_SIZE = 600;
54
  private static final int POST_ROTATION_MILLISEC = 500;
55
  private static final int TEXTURE_HEIGHT = 128;
56

    
57
  final Static3D[] ROTATION_AXIS;
58
  final int NUM_FACES;
59

    
60
  static float OBJECT_SCREEN_RATIO;
61

    
62
  private final int NUM_CUBITS;
63
  private int mRotRowBitmap;
64
  private int mRotAxis;
65
  private Static3D[] mOrigPos;
66
  private Static3D mNodeScale;
67
  private Static4D mQuatAccumulated;
68
  private Cubit[] mCubits;
69
  private int mSize;
70
  private RubikObjectList mList;
71
  private MeshBase mMesh;
72
  private DistortedEffects mEffects;
73
  private VertexEffectRotate mRotateEffect;
74
  private Dynamic1D mRotationAngle;
75
  private Static3D mRotationAxis;
76

    
77
  float mStart, mStep;
78

    
79
  Static1D mRotationAngleStatic, mRotationAngleMiddle, mRotationAngleFinal;
80
  DistortedTexture mTexture;
81

    
82
  MatrixEffectScale mScaleEffect;
83
  MatrixEffectQuaternion mQuatCEffect;
84
  MatrixEffectQuaternion mQuatAEffect;
85

    
86
///////////////////////////////////////////////////////////////////////////////////////////////////
87

    
88
  RubikObject(int size, int fov, Static4D quatCur, Static4D quatAcc, DistortedTexture nodeTexture,
89
              MeshRectangles nodeMesh, DistortedEffects nodeEffects, int[][] moves, RubikObjectList list)
90
    {
91
    super(nodeTexture,nodeEffects,nodeMesh);
92

    
93
    resizeFBO(NODE_FBO_SIZE, NODE_FBO_SIZE);
94

    
95
    mList = list;
96
    mOrigPos = getCubitPositions(size);
97

    
98
    Static4D[] quats = getQuats();
99
    NUM_CUBITS  = mOrigPos.length;
100
    ROTATION_AXIS = getRotationAxis();
101
    OBJECT_SCREEN_RATIO = getScreenRatio();
102
    NUM_FACES = getNumFaces();
103

    
104
    mSize = size;
105
    computeStartAndStep(mOrigPos);
106
    mNodeScale= new Static3D(1,1,1);
107
    mQuatAccumulated = quatAcc;
108

    
109
    mRotationAngle= new Dynamic1D();
110
    mRotationAxis = new Static3D(1,0,0);
111
    mRotateEffect = new VertexEffectRotate(mRotationAngle, mRotationAxis, CENTER);
112

    
113
    mRotationAngleStatic = new Static1D(0);
114
    mRotationAngleMiddle = new Static1D(0);
115
    mRotationAngleFinal  = new Static1D(0);
116

    
117
    float scale = OBJECT_SCREEN_RATIO*NODE_FBO_SIZE/mSize;
118
    mScaleEffect = new MatrixEffectScale(new Static3D(scale,scale,scale));
119
    mQuatCEffect = new MatrixEffectQuaternion(quatCur, CENTER);
120
    mQuatAEffect = new MatrixEffectQuaternion(quatAcc, CENTER);
121

    
122
    MatrixEffectScale nodeScaleEffect = new MatrixEffectScale(mNodeScale);
123
    nodeEffects.apply(nodeScaleEffect);
124

    
125
    mCubits = new Cubit[NUM_CUBITS];
126
    mTexture = new DistortedTexture();
127
    MeshBase[] cubitMesh = new MeshBase[NUM_CUBITS];
128

    
129
    for(int i=0; i<NUM_CUBITS; i++)
130
      {
131
      mCubits[i] = new Cubit(this,mOrigPos[i]);
132
      cubitMesh[i] = createCubitMesh(i);
133
      cubitMesh[i].apply(new MatrixEffectMove(mOrigPos[i]),1,0);
134
      cubitMesh[i].setEffectAssociation(0, mCubits[i].computeAssociation(), 0);
135
      }
136

    
137
    mMesh = new MeshJoined(cubitMesh);
138

    
139
    resetAllTextureMaps();
140

    
141
    mEffects = new DistortedEffects();
142

    
143
    int num_quats = quats.length;
144
    for(int q=0; q<num_quats; q++)
145
      {
146
      VertexEffectQuaternion vq = new VertexEffectQuaternion(quats[q],CENTER);
147
      vq.setMeshAssociation(0,q);
148
      mEffects.apply(vq);
149
      }
150

    
151
    mEffects.apply(mRotateEffect);
152
    mEffects.apply(mQuatAEffect);
153
    mEffects.apply(mQuatCEffect);
154
    mEffects.apply(mScaleEffect);
155

    
156
    attach( new DistortedNode(mTexture,mEffects,mMesh) );
157

    
158
    setupPosition(moves);
159

    
160
    setProjection(fov, 0.1f);
161
    }
162

    
163
///////////////////////////////////////////////////////////////////////////////////////////////////
164

    
165
  private void textureCubitMesh(MeshBase mesh, int cubit)
166
    {
167
    boolean belongs;
168
    final Static4D[] maps = new Static4D[NUM_FACES];
169
    final float ratio = 1.0f/(NUM_FACES+1);
170

    
171
    if( 2*ROTATION_AXIS.length == NUM_FACES )  // i.e. there are faces on both ends of the axis (cube)
172
      {
173
      for(int i=0; i<NUM_FACES; i++)
174
        {
175
        belongs = isOnFace(cubit, i/2, i%2==0 ? mSize-1:0 );
176
        maps[i] = new Static4D( (belongs?i:NUM_FACES)*ratio, 0.0f, ratio, 1.0f);
177
        }
178
      }
179
    else if( ROTATION_AXIS.length == NUM_FACES )  // just a single face on the right end of an axis (pyraminx)
180
      {
181
      for(int i=0; i<NUM_FACES; i++)
182
        {
183
        belongs = isOnFace(cubit, i, 0 );
184
        maps[i] = new Static4D( (belongs?i:NUM_FACES)*ratio, 0.0f, ratio, 1.0f);
185
        }
186
      }
187

    
188
    mesh.setTextureMap(maps,NUM_FACES*cubit);
189
    }
190

    
191
///////////////////////////////////////////////////////////////////////////////////////////////////
192
// Cast centers of all Cubits on the first rotation Axis and compute the leftmost and rightmost
193
// one. From there compute the 'start' (i.e. the leftmost) and 'step' (i.e. distance between two
194
// consecutive).
195
// it is assumed that other rotation axis have the same 'start' and 'step' - this is the case with
196
// the Cube and the Pyraminx.
197
// Start and Step are then needed to compute which rotation row (with respect to a given axis) a
198
// given Cubit belongs to.
199

    
200
  private void computeStartAndStep(Static3D[] pos)
201
    {
202
    float min = Float.MAX_VALUE;
203
    float max = Float.MIN_VALUE;
204
    float axisX = ROTATION_AXIS[0].get0();
205
    float axisY = ROTATION_AXIS[0].get1();
206
    float axisZ = ROTATION_AXIS[0].get2();
207
    float tmp;
208

    
209
    for(int i=0; i<NUM_CUBITS; i++)
210
      {
211
      tmp = pos[i].get0()*axisX + pos[i].get1()*axisY + pos[i].get2()*axisZ;
212
      if( tmp<min ) min=tmp;
213
      if( tmp>max ) max=tmp;
214
      }
215

    
216
    mStart = min;
217
    mStep  = (max-min+1.0f)/mSize;
218
    }
219

    
220
///////////////////////////////////////////////////////////////////////////////////////////////////
221

    
222
  private boolean belongsToRotation( int cubit, int axis, int rowBitmap)
223
    {
224
    int cubitRow = (int)(mCubits[cubit].mRotationRow[axis]+0.5f);
225
    return ((1<<cubitRow)&rowBitmap)!=0;
226
    }
227

    
228
///////////////////////////////////////////////////////////////////////////////////////////////////
229
// we cannot use belongsToRotation for deciding if to texture a face. Counterexample: the 'rotated'
230
// tetrahedrons of Pyraminx nearby the edge: they belong to rotation but their face which is rotated
231
// away from the face of the Pyraminx shouldn't be textured.
232

    
233
  private boolean isOnFace( int cubit, int axis, int row)
234
    {
235
    final float MAX_ERROR = 0.0001f;
236
    float diff = mCubits[cubit].mRotationRow[axis] - row;
237
    return diff*diff < MAX_ERROR;
238
    }
239

    
240
///////////////////////////////////////////////////////////////////////////////////////////////////
241
// note the minus in front of the sin() - we rotate counterclockwise
242
// when looking towards the direction where the axis increases in values.
243

    
244
  private Static4D makeQuaternion(int axisIndex, int angleInDegrees)
245
    {
246
    Static3D axis = ROTATION_AXIS[axisIndex];
247

    
248
    while( angleInDegrees<0 ) angleInDegrees += 360;
249
    angleInDegrees %= 360;
250
    
251
    float cosA = (float)Math.cos(Math.PI*angleInDegrees/360);
252
    float sinA =-(float)Math.sqrt(1-cosA*cosA);
253

    
254
    return new Static4D(axis.get0()*sinA, axis.get1()*sinA, axis.get2()*sinA, cosA);
255
    }
256

    
257
///////////////////////////////////////////////////////////////////////////////////////////////////
258

    
259
  private void setupPosition(int[][] moves)
260
    {
261
    if( moves!=null )
262
      {
263
      Static4D quat;
264
      int axis, rowBitmap, angle;
265
      int corr = (360/getBasicAngle());
266

    
267
      for(int[] move: moves)
268
        {
269
        axis     = move[0];
270
        rowBitmap= move[1];
271
        angle    = move[2]*corr;
272
        quat     = makeQuaternion(axis,angle);
273

    
274
        for(int j=0; j<NUM_CUBITS; j++)
275
          if( belongsToRotation(j,axis,rowBitmap) )
276
            {
277
            mCubits[j].removeRotationNow(quat);
278
            }
279
        }
280
      }
281
    }
282

    
283
///////////////////////////////////////////////////////////////////////////////////////////////////
284

    
285
  int getCubitFaceColorIndex(int cubit, int face)
286
    {
287
    Static4D texMap = mMesh.getTextureMap(NUM_FACES*cubit + face);
288
    return (int)(texMap.get0() / texMap.get2());
289
    }
290

    
291
///////////////////////////////////////////////////////////////////////////////////////////////////
292
// Clamp all rotated positions to one of those original ones to avoid accumulating errors.
293

    
294
  void clampPos(Static3D pos)
295
    {
296
    float currError, minError = Float.MAX_VALUE;
297
    int minErrorIndex= -1;
298
    float x = pos.get0();
299
    float y = pos.get1();
300
    float z = pos.get2();
301
    float xo,yo,zo;
302

    
303
    for(int i=0; i<NUM_CUBITS; i++)
304
      {
305
      xo = mOrigPos[i].get0();
306
      yo = mOrigPos[i].get1();
307
      zo = mOrigPos[i].get2();
308

    
309
      currError = (xo-x)*(xo-x) + (yo-y)*(yo-y) + (zo-z)*(zo-z);
310

    
311
      if( currError<minError )
312
        {
313
        minError = currError;
314
        minErrorIndex = i;
315
        }
316
      }
317

    
318
    pos.set( mOrigPos[minErrorIndex] );
319
    }
320

    
321
///////////////////////////////////////////////////////////////////////////////////////////////////
322
// the getFaceColors + final black in a horizontal strip.
323

    
324
  public void createTexture()
325
    {
326
    Bitmap bitmap;
327

    
328
    Paint paint = new Paint();
329
    bitmap = Bitmap.createBitmap( (NUM_FACES+1)*TEXTURE_HEIGHT, TEXTURE_HEIGHT, Bitmap.Config.ARGB_8888);
330
    Canvas canvas = new Canvas(bitmap);
331

    
332
    paint.setAntiAlias(true);
333
    paint.setTextAlign(Paint.Align.CENTER);
334
    paint.setStyle(Paint.Style.FILL);
335

    
336
    paint.setColor(INTERIOR_COLOR);
337
    canvas.drawRect(0, 0, (NUM_FACES+1)*TEXTURE_HEIGHT, TEXTURE_HEIGHT, paint);
338

    
339
    for(int i=0; i<NUM_FACES; i++)
340
      {
341
      createFaceTexture(canvas, paint, i, i*TEXTURE_HEIGHT, 0, TEXTURE_HEIGHT);
342
      }
343

    
344
    mTexture.setTexture(bitmap);
345
    }
346

    
347
///////////////////////////////////////////////////////////////////////////////////////////////////
348

    
349
  public int getSize()
350
    {
351
    return mSize;
352
    }
353

    
354
///////////////////////////////////////////////////////////////////////////////////////////////////
355

    
356
  public void continueRotation(float angleInDegrees)
357
    {
358
    mRotationAngleStatic.set0(angleInDegrees);
359
    }
360

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

    
363
  public Static4D getRotationQuat()
364
      {
365
      return mQuatAccumulated;
366
      }
367

    
368
///////////////////////////////////////////////////////////////////////////////////////////////////
369

    
370
  public void recomputeScaleFactor(int scrWidth, int scrHeight)
371
    {
372
    float factor = Math.min(scrWidth,scrHeight);
373
    mNodeScale.set(factor,factor,factor);
374
    }
375

    
376
///////////////////////////////////////////////////////////////////////////////////////////////////
377

    
378
  public void savePreferences(SharedPreferences.Editor editor)
379
    {
380
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].savePreferences(editor);
381
    }
382

    
383
///////////////////////////////////////////////////////////////////////////////////////////////////
384

    
385
  public void restorePreferences(SharedPreferences preferences)
386
    {
387
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].restorePreferences(preferences);
388
    }
389

    
390
///////////////////////////////////////////////////////////////////////////////////////////////////
391

    
392
  public void releaseResources()
393
    {
394
    mTexture.markForDeletion();
395
    }
396

    
397
///////////////////////////////////////////////////////////////////////////////////////////////////
398

    
399
  public void apply(Effect effect, int position)
400
    {
401
    mEffects.apply(effect, position);
402
    }
403

    
404
///////////////////////////////////////////////////////////////////////////////////////////////////
405

    
406
  public void remove(long effectID)
407
    {
408
    mEffects.abortById(effectID);
409
    }
410

    
411
///////////////////////////////////////////////////////////////////////////////////////////////////
412

    
413
  public void solve()
414
    {
415
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].solve();
416
    }
417

    
418
///////////////////////////////////////////////////////////////////////////////////////////////////
419

    
420
  public boolean isSolved()
421
    {
422
    Static4D q = mCubits[0].mQuatScramble;
423

    
424
    for(int i=1; i<NUM_CUBITS; i++)
425
      {
426
      if( !mCubits[i].thereIsNoVisibleDifference(q) ) return false;
427
      }
428

    
429
    return true;
430
    }
431

    
432
///////////////////////////////////////////////////////////////////////////////////////////////////
433

    
434
  public void resetAllTextureMaps()
435
    {
436
    for(int i=0; i<NUM_CUBITS; i++)
437
      {
438
      textureCubitMesh( mMesh , i );
439
      }
440
    }
441

    
442
///////////////////////////////////////////////////////////////////////////////////////////////////
443

    
444
  public void setTextureMap(int cubit, int face, int newColor)
445
    {
446
    final float ratio = 1.0f/(NUM_FACES+1);
447
    final Static4D[] maps = new Static4D[NUM_FACES];
448

    
449
    try
450
      {
451
      maps[face] = new Static4D( newColor*ratio, 0.0f, ratio, 1.0f);
452
      mMesh.setTextureMap(maps,NUM_FACES*cubit);
453
      }
454
    catch(ArrayIndexOutOfBoundsException ignored)
455
      {
456
      // the object must have changed in between of us touching the screen and getting here
457
      // (which happens after the next render, i.e. about 30 miliseconds later)
458
      // ignore.
459
      }
460
    }
461

    
462
///////////////////////////////////////////////////////////////////////////////////////////////////
463

    
464
  public void beginNewRotation(int axis, int row )
465
    {
466
    if( axis<0 || axis>=ROTATION_AXIS.length )
467
      {
468
      android.util.Log.e("object", "invalid rotation axis: "+axis);
469
      return;
470
      }
471
    if( row<0 || row>=mSize )
472
      {
473
      android.util.Log.e("object", "invalid rotation row: "+row);
474
      return;
475
      }
476

    
477
    mRotAxis     = axis;
478
    mRotRowBitmap= (1<<row);
479
    mRotationAngleStatic.set0(0.0f);
480
    mRotationAxis.set( ROTATION_AXIS[axis] );
481
    mRotationAngle.add(mRotationAngleStatic);
482
    mRotateEffect.setMeshAssociation( mRotRowBitmap<<(axis*RubikObjectList.MAX_OBJECT_SIZE) , -1);
483
    }
484

    
485
///////////////////////////////////////////////////////////////////////////////////////////////////
486

    
487
  public long addNewRotation( int axis, int rowBitmap, int angle, long durationMillis, EffectListener listener )
488
    {
489
    mRotAxis     = axis;
490
    mRotRowBitmap= rowBitmap;
491

    
492
    mRotationAngleStatic.set0(0.0f);
493
    mRotationAxis.set( ROTATION_AXIS[axis] );
494
    mRotationAngle.setDuration(durationMillis);
495
    mRotationAngle.resetToBeginning();
496
    mRotationAngle.add(new Static1D(0));
497
    mRotationAngle.add(new Static1D(angle));
498
    mRotateEffect.setMeshAssociation( mRotRowBitmap<<(axis*RubikObjectList.MAX_OBJECT_SIZE) , -1);
499
    mRotateEffect.notifyWhenFinished(listener);
500

    
501
    return mRotateEffect.getID();
502
    }
503

    
504
///////////////////////////////////////////////////////////////////////////////////////////////////
505

    
506
  public long finishRotationNow(EffectListener listener)
507
    {
508
    float angle = getAngle();
509
    int nearestAngleInDegrees = computeNearestAngle(angle);
510
    mRotationAngleStatic.set0(angle);
511
    mRotationAngleFinal.set0(nearestAngleInDegrees);
512
    mRotationAngleMiddle.set0( nearestAngleInDegrees + (nearestAngleInDegrees-angle)*0.2f );
513

    
514
    mRotationAngle.setDuration(POST_ROTATION_MILLISEC);
515
    mRotationAngle.resetToBeginning();
516
    mRotationAngle.removeAll();
517
    mRotationAngle.add(mRotationAngleStatic);
518
    mRotationAngle.add(mRotationAngleMiddle);
519
    mRotationAngle.add(mRotationAngleFinal);
520
    mRotateEffect.notifyWhenFinished(listener);
521

    
522
    return mRotateEffect.getID();
523
    }
524

    
525

    
526
///////////////////////////////////////////////////////////////////////////////////////////////////
527

    
528
  private float getAngle()
529
    {
530
    int pointNum = mRotationAngle.getNumPoints();
531

    
532
    if( pointNum>=1 )
533
      {
534
      return mRotationAngle.getPoint(pointNum-1).get0();
535
      }
536
    else
537
      {
538
      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
539
      crashlytics.log("points in RotationAngle: "+pointNum);
540
      return 0;
541
      }
542
    }
543

    
544
///////////////////////////////////////////////////////////////////////////////////////////////////
545

    
546
  public void removeRotationNow()
547
     {
548
     float angle = getAngle();
549
     int nearestAngleInDegrees = computeNearestAngle(angle);
550
     double nearestAngleInRadians = nearestAngleInDegrees*Math.PI/180;
551
     float sinA =-(float)Math.sin(nearestAngleInRadians*0.5);
552
     float cosA = (float)Math.cos(nearestAngleInRadians*0.5);
553
     float axisX = ROTATION_AXIS[mRotAxis].get0();
554
     float axisY = ROTATION_AXIS[mRotAxis].get1();
555
     float axisZ = ROTATION_AXIS[mRotAxis].get2();
556
     Static4D quat = new Static4D( axisX*sinA, axisY*sinA, axisZ*sinA, cosA);
557

    
558
     mRotationAngle.removeAll();
559
     mRotationAngleStatic.set0(0);
560

    
561
     for(int i=0; i<NUM_CUBITS; i++)
562
       if( belongsToRotation(i,mRotAxis,mRotRowBitmap) )
563
         {
564
         mCubits[i].removeRotationNow(quat);
565
         }
566
     }
567

    
568
///////////////////////////////////////////////////////////////////////////////////////////////////
569

    
570
  public void initializeObject(int[][] moves)
571
    {
572
    solve();
573
    setupPosition(moves);
574
    }
575

    
576
///////////////////////////////////////////////////////////////////////////////////////////////////
577

    
578
  public int getCubit(float[] point3D)
579
    {
580
    float dist, minDist = Float. MAX_VALUE;
581
    int currentBest=-1;
582
    float multiplier = returnMultiplier();
583

    
584
    point3D[0] *= multiplier;
585
    point3D[1] *= multiplier;
586
    point3D[2] *= multiplier;
587

    
588
    for(int i=0; i<NUM_CUBITS; i++)
589
      {
590
      dist = mCubits[i].getDistSquared(point3D);
591
      if( dist<minDist )
592
        {
593
        minDist = dist;
594
        currentBest = i;
595
        }
596
      }
597

    
598
    return currentBest;
599
    }
600

    
601
///////////////////////////////////////////////////////////////////////////////////////////////////
602

    
603
  public int computeNearestAngle(float angle)
604
    {
605
    final int NEAREST = 360/getBasicAngle();
606

    
607
    int tmp = (int)((angle+NEAREST/2)/NEAREST);
608
    if( angle< -(NEAREST*0.5) ) tmp-=1;
609

    
610
    return NEAREST*tmp;
611
    }
612

    
613
///////////////////////////////////////////////////////////////////////////////////////////////////
614

    
615
  public RubikObjectList getObjectList()
616
    {
617
    return mList;
618
    }
619

    
620
///////////////////////////////////////////////////////////////////////////////////////////////////
621

    
622
  abstract float getScreenRatio();
623
  abstract Static3D[] getCubitPositions(int size);
624
  abstract Static4D[] getQuats();
625
  abstract int getNumFaces();
626
  abstract MeshBase createCubitMesh(int cubit);
627
  abstract void createFaceTexture(Canvas canvas, Paint paint, int face, int left, int top, int side);
628
  public abstract Static3D[] getRotationAxis();
629
  public abstract int getBasicAngle();
630
  public abstract float returnMultiplier();
631
  public abstract float returnRotationFactor(float offset);
632
  public abstract String retObjectString();
633
  public abstract float[] getRowChances();
634
  }
(4-4/8)