Revision f5eeab30
Added by Leszek Koltunski about 1 year ago
src/main/java/org/distorted/objectlib/tablebases/TBCuboid323.java | ||
---|---|---|
40 | 40 |
}; |
41 | 41 |
|
42 | 42 |
private static boolean mUpper; |
43 |
private static boolean mFixedEdgeIsDown; |
|
43 | 44 |
private int[][] mAngles; |
44 | 45 |
|
45 | 46 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
46 | 47 |
|
47 |
public static void setUpper(boolean upper) |
|
48 |
public static void setUpper(boolean upper, boolean isDown )
|
|
48 | 49 |
{ |
49 | 50 |
mUpper = upper; |
51 |
mFixedEdgeIsDown = isDown; |
|
50 | 52 |
} |
51 | 53 |
|
52 | 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
53 |
// if mUpper==true, then the edge3 is the 'half-fixed' front edge. Remove it from the permutation.
|
|
55 |
// if upper==true, then the edge3 is the 'half-fixed' front edge. Remove it from the permutation.
|
|
54 | 56 |
// Otherwise edge1 is the one; remove it. |
55 | 57 |
|
56 | 58 |
public static int[] edgePermTo7(int[] perm, boolean upper) |
... | ... | |
211 | 213 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
212 | 214 |
// we can never really move the fixed front edge, because if we do so, we would also rotate the |
213 | 215 |
// rotation axis themselves! (see getIndex() where the cubit quats are normalized) |
214 |
// Fixed front edge is either edge1 or edge3, depending on value of mUpper |
|
215 |
// (mUpper==true --> fixed==3, else fixed==1) |
|
216 |
// |
|
216 |
// Fixed front edge is always iin the front, up or down (depending on value of mFixedEdgeIsDown) |
|
217 |
// If the edge is up and we are moving along Y axis, invert! |
|
217 | 218 |
|
218 | 219 |
@Override |
219 | 220 |
int[] newMove(int axis, int layer, int angle) |
220 | 221 |
{ |
221 |
//if( axis==0 && layer==2 ) return new int[] { axis, 3, angle==1 ? 1:-1}; |
|
222 |
//if( axis==3 && layer==0 ) return new int[] { axis, 6, angle==1 ? 1:-1}; |
|
223 |
|
|
224 |
if( axis==1 ) |
|
225 |
{ |
|
226 |
|
|
227 |
} |
|
222 |
if( axis==2 && layer==2 ) mFixedEdgeIsDown = !mFixedEdgeIsDown; |
|
223 |
if( axis==1 && layer==1 && !mFixedEdgeIsDown ) return new int[] { axis, 1, -angle }; |
|
228 | 224 |
|
229 | 225 |
int maxAngle = mAngles[axis][layer]; |
230 | 226 |
angle = maxAngle-angle; |
Also available in: Unified diff
CU_323 solver: corrections.