Project

General

Profile

« Previous | Next » 

Revision d0eb4ae9

Added by Leszek Koltunski about 1 year ago

CU_323 solver: corrections.

View differences:

src/main/java/org/distorted/objectlib/tablebases/TBCuboid323.java
45 45

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

  
48
  public static void setDown(boolean isDown )
48
  public static void initialize()
49 49
    {
50
    mFixedEdgeIsDown = isDown;
50
    mFixedEdgeIsDown = true;
51 51
    }
52 52

  
53 53
///////////////////////////////////////////////////////////////////////////////////////////////////
......
179 179
///////////////////////////////////////////////////////////////////////////////////////////////////
180 180
// specifically for the tablebase
181 181
///////////////////////////////////////////////////////////////////////////////////////////////////
182
// we can never really move the fixed front edge, because if we do so, we would also rotate the
183
// rotation axis themselves! (see getIndex() where the cubit quats are normalized)
184
// Fixed front edge is always in the front, up or down (depending on value of mFixedEdgeIsDown)
185
// If the edge is up and we are moving along Y axis, invert!
182
// edge1 (i.e. the edge which is initially in the lower front) needs to stay in front.
186 183

  
187 184
  @Override
188 185
  int[] newMove(int axis, int layer, int angle)
189 186
    {
190 187
    if( axis==2 && layer==2 ) mFixedEdgeIsDown = !mFixedEdgeIsDown;
191
    if( axis==1 && layer==1 && !mFixedEdgeIsDown ) return new int[] { axis, 1, -angle };
188
    if( axis==1 )
189
      {
190
      if( layer==0 &&  mFixedEdgeIsDown ) return new int[] { axis, 2, angle };
191
      if( layer==1 && !mFixedEdgeIsDown ) return new int[] { axis, 1, angle };
192
      }
192 193

  
193 194
    int maxAngle = mAngles[axis][layer];
194 195
    angle = maxAngle-angle;

Also available in: Unified diff