Revision 10585385
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/objects/RubikPyraminx.java | ||
---|---|---|
43 | 43 |
{ |
44 | 44 |
private static final float SQ2 = (float)Math.sqrt(2); |
45 | 45 |
private static final float SQ3 = (float)Math.sqrt(3); |
46 |
private static final float SQ6 = (float)Math.sqrt(6); |
|
46 | 47 |
|
47 | 48 |
static final Static3D[] AXIS = new Static3D[] |
48 | 49 |
{ |
... | ... | |
59 | 60 |
}; |
60 | 61 |
|
61 | 62 |
// computed with res/raw/compute_quats.c |
62 |
private static final float[] LEGALQUATS = new float[]
|
|
63 |
private static final Static4D[] QUATS = new Static4D[]
|
|
63 | 64 |
{ |
64 |
0.0f, 1.0f, -1.0f, 0.5f, -0.5f, SQ2/2, -SQ2/2, SQ3/2, -SQ3/2, |
|
65 |
SQ3/3, -SQ3/3, SQ3/6, -SQ3/6, SQ2*SQ3/3, -SQ2*SQ3/3, SQ2*SQ3/6, -SQ2*SQ3/6 |
|
65 |
new Static4D( 0.0f, 0.0f, 0.0f, 1.0f), |
|
66 |
new Static4D( 0.0f, SQ3/2, 0.0f, 0.5f), |
|
67 |
new Static4D( SQ2/2, -SQ3/6, -SQ6/6, 0.5f), |
|
68 |
new Static4D(-SQ2/2, -SQ3/6, -SQ6/6, 0.5f), |
|
69 |
new Static4D( 0.0f, -SQ3/6, SQ6/3, 0.5f), |
|
70 |
new Static4D( 0.0f, SQ3/2, 0.0f, -0.5f), |
|
71 |
new Static4D( SQ2/2, -SQ3/6, -SQ6/6, -0.5f), |
|
72 |
new Static4D(-SQ2/2, -SQ3/6, -SQ6/6, -0.5f), |
|
73 |
new Static4D( 0.0f, -SQ3/6, SQ6/3, -0.5f), |
|
74 |
new Static4D( SQ2/2, -SQ3/3, SQ6/6, 0.0f), |
|
75 |
new Static4D( 0.0f, -SQ3/3, -SQ6/3, 0.0f), |
|
76 |
new Static4D(-SQ2/2, -SQ3/3, SQ6/6, 0.0f) |
|
66 | 77 |
}; |
67 | 78 |
|
68 | 79 |
private int[] mRotArray; |
... | ... | |
184 | 195 |
|
185 | 196 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
186 | 197 |
|
187 |
float[] getLegalQuats()
|
|
198 |
Static4D[] getQuats()
|
|
188 | 199 |
{ |
189 |
return LEGALQUATS;
|
|
200 |
return QUATS; |
|
190 | 201 |
} |
191 | 202 |
|
192 | 203 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
More progreess porting RubikCube.