1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2023 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.objectlib.tablebases;
|
11
|
|
12
|
import static org.distorted.objectlib.main.TwistyObject.SQ2;
|
13
|
import static org.distorted.objectlib.main.TwistyObject.SQ3;
|
14
|
import static org.distorted.objectlib.main.TwistyObject.SQ6;
|
15
|
|
16
|
import android.content.res.Resources;
|
17
|
|
18
|
import org.distorted.library.type.Static3D;
|
19
|
import org.distorted.objectlib.R;
|
20
|
|
21
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
22
|
|
23
|
public class TablebasesSkewbDiamond extends TablebasesAbstract
|
24
|
{
|
25
|
public TablebasesSkewbDiamond()
|
26
|
{
|
27
|
super();
|
28
|
}
|
29
|
|
30
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
31
|
|
32
|
public TablebasesSkewbDiamond(Resources res)
|
33
|
{
|
34
|
super(res, R.raw.pyra_3_tablebase);
|
35
|
}
|
36
|
|
37
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
38
|
|
39
|
int[][] getBasicAngles()
|
40
|
{
|
41
|
int[] tmp = {3,3};
|
42
|
return new int[][] { tmp,tmp,tmp,tmp };
|
43
|
}
|
44
|
|
45
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
46
|
|
47
|
Static3D[] getRotationAxis()
|
48
|
{
|
49
|
return new Static3D[]
|
50
|
{
|
51
|
new Static3D( SQ6/3, SQ3/3, 0),
|
52
|
new Static3D(-SQ6/3, SQ3/3, 0),
|
53
|
new Static3D( 0,-SQ3/3,-SQ6/3),
|
54
|
new Static3D( 0,-SQ3/3, SQ6/3)
|
55
|
};
|
56
|
}
|
57
|
|
58
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
59
|
|
60
|
float[][] getPosition()
|
61
|
{
|
62
|
return new float[][]
|
63
|
{
|
64
|
{ 0.5f, 0.0f, 0.5f},
|
65
|
{ 0.5f, 0.0f, -0.5f},
|
66
|
{-0.5f, 0.0f, -0.5f},
|
67
|
{-0.5f, 0.0f, 0.5f},
|
68
|
{ 0.0f, SQ2/2, 0.0f},
|
69
|
{ 0.0f,-SQ2/2, 0.0f},
|
70
|
|
71
|
{ 0.5f, SQ2/4, 0.0f},
|
72
|
{ 0.0f, SQ2/4,-0.5f},
|
73
|
{-0.5f, SQ2/4, 0.0f},
|
74
|
{ 0.0f, SQ2/4, 0.5f},
|
75
|
{ 0.5f,-SQ2/4, 0.0f},
|
76
|
{ 0.0f,-SQ2/4,-0.5f},
|
77
|
{-0.5f,-SQ2/4, 0.0f},
|
78
|
{ 0.0f,-SQ2/4, 0.5f}
|
79
|
};
|
80
|
}
|
81
|
|
82
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
83
|
|
84
|
float[][] getCuts()
|
85
|
{
|
86
|
float[] cut = { 0.0f };
|
87
|
return new float[][] { cut,cut,cut,cut };
|
88
|
}
|
89
|
|
90
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
91
|
|
92
|
boolean[][] getRotatable()
|
93
|
{
|
94
|
boolean[] tmp = new boolean[] {false,true};
|
95
|
return new boolean[][] { tmp,tmp,tmp,tmp };
|
96
|
}
|
97
|
|
98
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
99
|
// specifically for the tablebase
|
100
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
101
|
|
102
|
int getSize()
|
103
|
{
|
104
|
return 138240; // see https://www.jaapsch.net/puzzles/diamond.htm
|
105
|
}
|
106
|
|
107
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
108
|
|
109
|
public int[] getQuats(int index)
|
110
|
{
|
111
|
return new int[] {0,0,0,0,0,0, 0,0,0,0,0,0,0,0};
|
112
|
}
|
113
|
|
114
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
115
|
|
116
|
public int getIndex(int[] quats)
|
117
|
{
|
118
|
return 0;
|
119
|
}
|
120
|
}
|
121
|
|