Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / RubikObject.java @ 27e6c301

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.VertexEffectRotate;
34
import org.distorted.library.main.DistortedEffects;
35
import org.distorted.library.main.DistortedNode;
36
import org.distorted.library.main.DistortedTexture;
37
import org.distorted.library.mesh.MeshBase;
38
import org.distorted.library.mesh.MeshJoined;
39
import org.distorted.library.mesh.MeshRectangles;
40
import org.distorted.library.message.EffectListener;
41
import org.distorted.library.type.Dynamic1D;
42
import org.distorted.library.type.Static1D;
43
import org.distorted.library.type.Static3D;
44
import org.distorted.library.type.Static4D;
45

    
46
///////////////////////////////////////////////////////////////////////////////////////////////////
47

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

    
56
  final float[] LEGAL_QUATS;
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
    LEGAL_QUATS = getLegalQuats();
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, VERTEX_CENTER);
112

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

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

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

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

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

    
138
    mMesh = new MeshJoined(cubitMesh);
139

    
140
    resetAllTextureMaps();
141

    
142
    mEffects = new DistortedEffects();
143
    mEffects.apply(mRotateEffect);
144
    mEffects.apply(mQuatAEffect);
145
    mEffects.apply(mQuatCEffect);
146
    mEffects.apply(mScaleEffect);
147

    
148
    attach( new DistortedNode(mTexture,mEffects,mMesh) );
149

    
150
    setupPosition(moves);
151

    
152
    setProjection(fov, 0.1f);
153
    }
154

    
155
///////////////////////////////////////////////////////////////////////////////////////////////////
156

    
157
  private void textureCubitMesh(MeshBase mesh, int cubit)
158
    {
159
    boolean belongs;
160
    final Static4D[] maps = new Static4D[NUM_FACES];
161
    final float ratio = 1.0f/(NUM_FACES+1);
162

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

    
180
    mesh.setTextureMap(maps,NUM_FACES*cubit);
181
    }
182

    
183
///////////////////////////////////////////////////////////////////////////////////////////////////
184
// Cast centers of all Cubits on the first rotation Axis and compute the leftmost and rightmost
185
// one. From there compute the 'start' (i.e. the leftmost) and 'step' (i.e. distance between two
186
// consecutive).
187
// it is assumed that other rotation axis have the same 'start' and 'step' - this is the case with
188
// the Cube and the Pyraminx.
189
// Start and Step are then needed to compute which rotation row (with respect to a given axis) a
190
// given Cubit belongs to.
191

    
192
  private void computeStartAndStep(Static3D[] pos)
193
    {
194
    float min = Float.MAX_VALUE;
195
    float max = Float.MIN_VALUE;
196
    float axisX = ROTATION_AXIS[0].get0();
197
    float axisY = ROTATION_AXIS[0].get1();
198
    float axisZ = ROTATION_AXIS[0].get2();
199
    float tmp;
200

    
201
    for(int i=0; i<NUM_CUBITS; i++)
202
      {
203
      tmp = pos[i].get0()*axisX + pos[i].get1()*axisY + pos[i].get2()*axisZ;
204
      if( tmp<min ) min=tmp;
205
      if( tmp>max ) max=tmp;
206
      }
207

    
208
    mStart = min;
209
    mStep  = (max-min+1.0f)/mSize;
210
    }
211

    
212
///////////////////////////////////////////////////////////////////////////////////////////////////
213

    
214
  private boolean belongsToRotation( int cubit, int axis, int rowBitmap)
215
    {
216
    int cubitRow = (int)(mCubits[cubit].mRotationRow[axis]+0.5f);
217
    return ((1<<cubitRow)&rowBitmap)!=0;
218
    }
219

    
220
///////////////////////////////////////////////////////////////////////////////////////////////////
221
// we cannot use belongsToRotation for deciding if to texture a face. Counterexample: the 'rotated'
222
// tetrahedrons of Pyraminx nearby the edge: they belong to rotation but their face which is rotated
223
// away from the face of the Pyraminx shouldn't be textured.
224

    
225
  private boolean isOnFace( int cubit, int axis, int row)
226
    {
227
    final float MAX_ERROR = 0.0001f;
228
    float diff = mCubits[cubit].mRotationRow[axis] - row;
229
    return diff*diff < MAX_ERROR;
230
    }
231

    
232
///////////////////////////////////////////////////////////////////////////////////////////////////
233
// note the minus in front of the sin() - we rotate counterclockwise
234
// when looking towards the direction where the axis increases in values.
235

    
236
  private Static4D makeQuaternion(int axisIndex, int angleInDegrees)
237
    {
238
    Static3D axis = ROTATION_AXIS[axisIndex];
239

    
240
    while( angleInDegrees<0 ) angleInDegrees += 360;
241
    angleInDegrees %= 360;
242
    
243
    float cosA = (float)Math.cos(Math.PI*angleInDegrees/360);
244
    float sinA =-(float)Math.sqrt(1-cosA*cosA);
245

    
246
    return new Static4D(axis.get0()*sinA, axis.get1()*sinA, axis.get2()*sinA, cosA);
247
    }
248

    
249
///////////////////////////////////////////////////////////////////////////////////////////////////
250

    
251
  private void setupPosition(int[][] moves)
252
    {
253
    if( moves!=null )
254
      {
255
      Static4D quat;
256
      int axis, rowBitmap, angle;
257
      int corr = (360/getBasicAngle());
258

    
259
      for(int[] move: moves)
260
        {
261
        axis     = move[0];
262
        rowBitmap= move[1];
263
        angle    = move[2]*corr;
264
        quat     = makeQuaternion(axis,angle);
265

    
266
        for(int j=0; j<NUM_CUBITS; j++)
267
          if( belongsToRotation(j,axis,rowBitmap) )
268
            {
269
            mCubits[j].removeRotationNow(quat);
270
            }
271
        }
272
      }
273
    }
274

    
275
///////////////////////////////////////////////////////////////////////////////////////////////////
276

    
277
  int getCubitFaceColorIndex(int cubit, int face)
278
    {
279
    Static4D texMap = mMesh.getTextureMap(NUM_FACES*cubit + face);
280
    return (int)(texMap.get0() / texMap.get2());
281
    }
282

    
283
///////////////////////////////////////////////////////////////////////////////////////////////////
284
// Clamp all rotated positions to one of those original ones to avoid accumulating errors.
285

    
286
  void clampPos(Static3D pos)
287
    {
288
    float currError, minError = Float.MAX_VALUE;
289
    int minErrorIndex= -1;
290
    float x = pos.get0();
291
    float y = pos.get1();
292
    float z = pos.get2();
293
    float xo,yo,zo;
294

    
295
    for(int i=0; i<NUM_CUBITS; i++)
296
      {
297
      xo = mOrigPos[i].get0();
298
      yo = mOrigPos[i].get1();
299
      zo = mOrigPos[i].get2();
300

    
301
      currError = (xo-x)*(xo-x) + (yo-y)*(yo-y) + (zo-z)*(zo-z);
302

    
303
      if( currError<minError )
304
        {
305
        minError = currError;
306
        minErrorIndex = i;
307
        }
308
      }
309

    
310
    pos.set( mOrigPos[minErrorIndex] );
311
    }
312

    
313
///////////////////////////////////////////////////////////////////////////////////////////////////
314
// the getFaceColors + final black in a horizontal strip.
315

    
316
  public void createTexture()
317
    {
318
    Bitmap bitmap;
319

    
320
    Paint paint = new Paint();
321
    bitmap = Bitmap.createBitmap( (NUM_FACES+1)*TEXTURE_HEIGHT, TEXTURE_HEIGHT, Bitmap.Config.ARGB_8888);
322
    Canvas canvas = new Canvas(bitmap);
323

    
324
    paint.setAntiAlias(true);
325
    paint.setTextAlign(Paint.Align.CENTER);
326
    paint.setStyle(Paint.Style.FILL);
327

    
328
    paint.setColor(INTERIOR_COLOR);
329
    canvas.drawRect(0, 0, (NUM_FACES+1)*TEXTURE_HEIGHT, TEXTURE_HEIGHT, paint);
330

    
331
    for(int i=0; i<NUM_FACES; i++)
332
      {
333
      createFaceTexture(canvas, paint, i, i*TEXTURE_HEIGHT, 0, TEXTURE_HEIGHT);
334
      }
335

    
336
    mTexture.setTexture(bitmap);
337
    }
338

    
339
///////////////////////////////////////////////////////////////////////////////////////////////////
340

    
341
  public int getSize()
342
    {
343
    return mSize;
344
    }
345

    
346
///////////////////////////////////////////////////////////////////////////////////////////////////
347

    
348
  public void continueRotation(float angleInDegrees)
349
    {
350
    mRotationAngleStatic.set0(angleInDegrees);
351
    }
352

    
353
///////////////////////////////////////////////////////////////////////////////////////////////////
354

    
355
  public Static4D getRotationQuat()
356
      {
357
      return mQuatAccumulated;
358
      }
359

    
360
///////////////////////////////////////////////////////////////////////////////////////////////////
361

    
362
  public void recomputeScaleFactor(int scrWidth, int scrHeight)
363
    {
364
    float factor = Math.min(scrWidth,scrHeight);
365
    mNodeScale.set(factor,factor,factor);
366
    }
367

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

    
370
  public void savePreferences(SharedPreferences.Editor editor)
371
    {
372
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].savePreferences(editor);
373
    }
374

    
375
///////////////////////////////////////////////////////////////////////////////////////////////////
376

    
377
  public void restorePreferences(SharedPreferences preferences)
378
    {
379
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].restorePreferences(preferences);
380
    }
381

    
382
///////////////////////////////////////////////////////////////////////////////////////////////////
383

    
384
  public void releaseResources()
385
    {
386
    mTexture.markForDeletion();
387

    
388
    // TODO ?
389
    }
390

    
391
///////////////////////////////////////////////////////////////////////////////////////////////////
392

    
393
  public void apply(Effect effect, int position)
394
    {
395
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].mEffect.apply(effect, position);
396
    }
397

    
398
///////////////////////////////////////////////////////////////////////////////////////////////////
399

    
400
  public void remove(long effectID)
401
    {
402
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].mEffect.abortById(effectID);
403
    }
404

    
405
///////////////////////////////////////////////////////////////////////////////////////////////////
406

    
407
  public void solve()
408
    {
409
    for(int i=0; i<NUM_CUBITS; i++) mCubits[i].solve();
410
    }
411

    
412
///////////////////////////////////////////////////////////////////////////////////////////////////
413

    
414
  public boolean isSolved()
415
    {
416
    Static4D q = mCubits[0].mQuatScramble;
417

    
418
    for(int i=1; i<NUM_CUBITS; i++)
419
      {
420
      if( !mCubits[i].thereIsNoVisibleDifference(q) ) return false;
421
      }
422

    
423
    return true;
424
    }
425

    
426
///////////////////////////////////////////////////////////////////////////////////////////////////
427

    
428
  public void resetAllTextureMaps()
429
    {
430
    for(int i=0; i<NUM_CUBITS; i++)
431
      {
432
      textureCubitMesh( mMesh , i );
433
      }
434
    }
435

    
436
///////////////////////////////////////////////////////////////////////////////////////////////////
437

    
438
  public void setTextureMap(int cubit, int face, int newColor)
439
    {
440
    final float ratio = 1.0f/(NUM_FACES+1);
441
    final Static4D[] maps = new Static4D[NUM_FACES];
442

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

    
456
///////////////////////////////////////////////////////////////////////////////////////////////////
457

    
458
  public void beginNewRotation(int axis, int row )
459
    {
460
    if( axis<0 || axis>=ROTATION_AXIS.length )
461
      {
462
      android.util.Log.e("object", "invalid rotation axis: "+axis);
463
      return;
464
      }
465
    if( row<0 || row>=mSize )
466
      {
467
      android.util.Log.e("object", "invalid rotation row: "+row);
468
      return;
469
      }
470

    
471
    mRotAxis     = axis;
472
    mRotRowBitmap= (1<<row);
473
    mRotationAngleStatic.set0(0.0f);
474
    mRotationAxis.set( ROTATION_AXIS[axis] );
475
    mRotationAngle.add(mRotationAngleStatic);
476
    mRotateEffect.setMeshAssociation( mRotRowBitmap<<(axis*RubikObjectList.MAX_SIZE) , -1);
477
    }
478

    
479
///////////////////////////////////////////////////////////////////////////////////////////////////
480

    
481
  public long addNewRotation( int axis, int rowBitmap, int angle, long durationMillis, EffectListener listener )
482
    {
483
    mRotAxis     = axis;
484
    mRotRowBitmap= rowBitmap;
485

    
486
    mRotationAngleStatic.set0(0.0f);
487
    mRotationAxis.set( ROTATION_AXIS[axis] );
488
    mRotationAngle.setDuration(durationMillis);
489
    mRotationAngle.resetToBeginning();
490
    mRotationAngle.add(new Static1D(0));
491
    mRotationAngle.add(new Static1D(angle));
492
    mRotateEffect.setMeshAssociation( mRotRowBitmap<<(axis*RubikObjectList.MAX_SIZE) , -1);
493
    mRotateEffect.notifyWhenFinished(listener);
494

    
495
    return mRotateEffect.getID();
496
    }
497

    
498
///////////////////////////////////////////////////////////////////////////////////////////////////
499

    
500
  public long finishRotationNow(EffectListener listener)
501
    {
502
    float angle = getAngle();
503
    int nearestAngleInDegrees = computeNearestAngle(angle);
504
    mRotationAngleStatic.set0(angle);
505
    mRotationAngleFinal.set0(nearestAngleInDegrees);
506
    mRotationAngleMiddle.set0( nearestAngleInDegrees + (nearestAngleInDegrees-angle)*0.2f );
507

    
508
    mRotationAngle.setDuration(POST_ROTATION_MILLISEC);
509
    mRotationAngle.resetToBeginning();
510
    mRotationAngle.removeAll();
511
    mRotationAngle.add(mRotationAngleStatic);
512
    mRotationAngle.add(mRotationAngleMiddle);
513
    mRotationAngle.add(mRotationAngleFinal);
514
    mRotateEffect.notifyWhenFinished(listener);
515

    
516
    return mRotateEffect.getID();
517
    }
518

    
519

    
520
///////////////////////////////////////////////////////////////////////////////////////////////////
521

    
522
  private float getAngle()
523
    {
524
    int pointNum = mRotationAngle.getNumPoints();
525

    
526
    if( pointNum>=1 )
527
      {
528
      return mRotationAngle.getPoint(pointNum-1).get0();
529
      }
530
    else
531
      {
532
      FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
533
      crashlytics.log("points in RotationAngle: "+pointNum);
534
      return 0;
535
      }
536
    }
537

    
538
///////////////////////////////////////////////////////////////////////////////////////////////////
539

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

    
552
     mRotationAngle.removeAll();
553
     mRotationAngleStatic.set0(0);
554

    
555
     for(int i=0; i<NUM_CUBITS; i++)
556
       if( belongsToRotation(i,mRotAxis,mRotRowBitmap) )
557
         {
558
         mCubits[i].removeRotationNow(quat);
559
         }
560
     }
561

    
562
///////////////////////////////////////////////////////////////////////////////////////////////////
563

    
564
  public void initializeObject(int[][] moves)
565
    {
566
    solve();
567
    setupPosition(moves);
568
    }
569

    
570
///////////////////////////////////////////////////////////////////////////////////////////////////
571

    
572
  public int getCubit(float[] point3D)
573
    {
574
    float dist, minDist = Float. MAX_VALUE;
575
    int currentBest=-1;
576
    float multiplier = returnMultiplier();
577

    
578
    point3D[0] *= multiplier;
579
    point3D[1] *= multiplier;
580
    point3D[2] *= multiplier;
581

    
582
    for(int i=0; i<NUM_CUBITS; i++)
583
      {
584
      dist = mCubits[i].getDistSquared(point3D);
585
      if( dist<minDist )
586
        {
587
        minDist = dist;
588
        currentBest = i;
589
        }
590
      }
591

    
592
    return currentBest;
593
    }
594

    
595
///////////////////////////////////////////////////////////////////////////////////////////////////
596

    
597
  public int computeNearestAngle(float angle)
598
    {
599
    final int NEAREST = 360/getBasicAngle();
600

    
601
    int tmp = (int)((angle+NEAREST/2)/NEAREST);
602
    if( angle< -(NEAREST*0.5) ) tmp-=1;
603

    
604
    return NEAREST*tmp;
605
    }
606

    
607
///////////////////////////////////////////////////////////////////////////////////////////////////
608

    
609
  public RubikObjectList getObjectList()
610
    {
611
    return mList;
612
    }
613

    
614
///////////////////////////////////////////////////////////////////////////////////////////////////
615

    
616
  abstract float getScreenRatio();
617
  abstract Static3D[] getCubitPositions(int size);
618
  abstract float[] getLegalQuats();
619
  abstract int getNumFaces();
620
  abstract MeshBase createCubitMesh(int cubit);
621
  abstract void createFaceTexture(Canvas canvas, Paint paint, int face, int left, int top, int side);
622
  public abstract Static3D[] getRotationAxis();
623
  public abstract int getBasicAngle();
624
  public abstract float returnMultiplier();
625
  public abstract float returnRotationFactor(float offset);
626
  public abstract String retObjectString();
627
  public abstract float[] getRowChances();
628
  }
(4-4/8)