Project

General

Profile

« Previous | Next » 

Revision ad38d800

Added by Leszek Koltunski over 3 years ago

Introduce separate ROT_AXIS and FACE_AXIS ( step 1 )

View differences:

src/main/java/org/distorted/objects/RubikCube.java
43 43
  static final float SQ2 = (float)Math.sqrt(2);
44 44

  
45 45
  // the three rotation axis of a RubikCube. Must be normalized.
46
  static final Static3D[] AXIS = new Static3D[]
46
  static final Static3D[] ROT_AXIS = new Static3D[]
47 47
         {
48 48
           new Static3D(1,0,0),
49 49
           new Static3D(0,1,0),
50 50
           new Static3D(0,0,1)
51 51
         };
52 52

  
53
  // the six axis that determine the faces
54
  static final Static3D[] FACE_AXIS = new Static3D[]
55
         {
56
           new Static3D(1,0,0), new Static3D(-1,0,0),
57
           new Static3D(0,1,0), new Static3D(0,-1,0),
58
           new Static3D(0,0,1), new Static3D(0,0,-1)
59
         };
60

  
53 61
  private static final int[] FACE_COLORS = new int[]
54 62
         {
55
           0xffffff00, 0xffffffff,   // AXIS[0]right (right-YELLOW) AXIS[0]left (left  -WHITE)
56
           0xff0000ff, 0xff00ff00,   // AXIS[1]right (top  -BLUE  ) AXIS[1]left (bottom-GREEN)
57
           0xffff0000, 0xffb5651d    // AXIS[2]right (front-RED   ) AXIS[2]left (back  -BROWN)
63
           0xffffff00, 0xffffffff,   // FACE_AXIS[0] (right-YELLOW) FACE_AXIS[1] (left  -WHITE)
64
           0xff0000ff, 0xff00ff00,   // FACE_AXIS[2] (top  -BLUE  ) FACE_AXIS[3] (bottom-GREEN)
65
           0xffff0000, 0xffb5651d    // FACE_AXIS[4] (front-RED   ) FACE_AXIS[5] (back  -BROWN)
58 66
         };
59 67

  
60 68
  // All legal rotation quats of a RubikCube of any size.
......
304 312

  
305 313
  public Static3D[] getRotationAxis()
306 314
    {
307
    return AXIS;
315
    return ROT_AXIS;
308 316
    }
309 317

  
310 318
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff