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/RubikPyraminx.java
46 46
  private static final float SQ3 = (float)Math.sqrt(3);
47 47
  private static final float SQ6 = (float)Math.sqrt(6);
48 48

  
49
  static final Static3D[] AXIS = new Static3D[]
49
  static final Static3D[] ROT_AXIS = new Static3D[]
50 50
         {
51 51
           new Static3D(         0,        1,       0 ),
52 52
           new Static3D(         0,  -1.0f/3, 2*SQ2/3 ),
......
54 54
           new Static3D( SQ2*SQ3/3,  -1.0f/3,  -SQ2/3 )
55 55
         };
56 56

  
57
  static final Static3D[] FACE_AXIS = new Static3D[]
58
         {
59
           new Static3D(         0,      -1,       0 ),
60
           new Static3D(         0,  1.0f/3,-2*SQ2/3 ),
61
           new Static3D( SQ2*SQ3/3,  1.0f/3,   SQ2/3 ),
62
           new Static3D(-SQ2*SQ3/3,  1.0f/3,   SQ2/3 )
63
         };
64

  
57 65
  private static final int[] FACE_COLORS = new int[]
58 66
         {
59
           0xff00ff00, 0xffffff00,  // AXIS[0]right (GREEN ) AXIS[1]right (YELLOW )
60
           0xff0000ff, 0xffff0000   // AXIS[2]right (BLUE  ) AXIS[3]right (RED    )
67
           0xff00ff00, 0xffffff00,  // FACE_AXIS[0] (GREEN ) FACE_AXIS[1] (YELLOW )
68
           0xff0000ff, 0xffff0000   // FACE_AXIS[2] (BLUE  ) FACE_AXIS[3] (RED    )
61 69
         };
62 70

  
63 71
  // computed with res/raw/compute_quats.c
......
81 89
  private static VertexEffectRotate[] ROTATION;
82 90

  
83 91
  private static MeshBase mMesh =null;
84
  private static MeshBase[] mMeshRotated = new MeshBase[AXIS.length];
92
  private static MeshBase[] mMeshRotated = new MeshBase[ROT_AXIS.length];
85 93

  
86 94
  static
87 95
    {
88 96
    Static3D center = new Static3D(0,0,0);
89 97
    Static1D angle  = new Static1D(180.0f);
90 98

  
91
    ROTATION = new VertexEffectRotate[AXIS.length];
99
    ROTATION = new VertexEffectRotate[ROT_AXIS.length];
92 100

  
93
    for(int i=0; i<AXIS.length; i++)
101
    for(int i = 0; i< ROT_AXIS.length; i++)
94 102
      {
95
      ROTATION[i] = new VertexEffectRotate( angle, AXIS[i], center);
103
      ROTATION[i] = new VertexEffectRotate( angle, ROT_AXIS[i], center);
96 104
      mMeshRotated[i] = null;
97 105
      }
98 106
    }
......
388 396

  
389 397
  public Static3D[] getRotationAxis()
390 398
    {
391
    return AXIS;
399
    return ROT_AXIS;
392 400
    }
393 401

  
394 402
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff