Revision ad38d800
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/objects/RubikDino.java | ||
---|---|---|
51 | 51 |
private static final float ANGLE_FACES = (float)((180/Math.PI)*(2*Math.asin(SQ3/3))); // angle between two faces of a tetrahedron |
52 | 52 |
|
53 | 53 |
// the four rotation axis of a RubikDino. Must be normalized. |
54 |
static final Static3D[] AXIS = new Static3D[] |
|
54 |
static final Static3D[] ROT_AXIS = new Static3D[]
|
|
55 | 55 |
{ |
56 | 56 |
new Static3D(+SQ3/3,+SQ3/3,+SQ3/3), |
57 | 57 |
new Static3D(+SQ3/3,+SQ3/3,-SQ3/3), |
... | ... | |
59 | 59 |
new Static3D(+SQ3/3,-SQ3/3,-SQ3/3) |
60 | 60 |
}; |
61 | 61 |
|
62 |
// the six axis that determine the faces |
|
63 |
static final Static3D[] FACE_AXIS = new Static3D[] |
|
64 |
{ |
|
65 |
new Static3D(1,0,0), new Static3D(-1,0,0), |
|
66 |
new Static3D(0,1,0), new Static3D(0,-1,0), |
|
67 |
new Static3D(0,0,1), new Static3D(0,0,-1) |
|
68 |
}; |
|
69 |
|
|
62 | 70 |
private static final int[] FACE_COLORS = new int[] |
63 | 71 |
{ |
64 |
0xffffff00, 0xffffffff, // (right-YELLOW) (left -WHITE)
|
|
65 |
0xff0000ff, 0xff00ff00, // (top -BLUE ) (bottom-GREEN)
|
|
66 |
0xffff0000, 0xffb5651d // (front-RED ) (back -BROWN)
|
|
72 |
0xffffff00, 0xffffffff, // FACE_AXIS[0] (right-YELLOW) FACE_AXIS[1] (left -WHITE)
|
|
73 |
0xff0000ff, 0xff00ff00, // FACE_AXIS[2] (top -BLUE ) FACE_AXIS[3] (bottom-GREEN)
|
|
74 |
0xffff0000, 0xffb5651d // FACE_AXIS[4] (front-RED ) FACE_AXIS[5] (back -BROWN)
|
|
67 | 75 |
}; |
68 | 76 |
|
69 | 77 |
// All legal rotation quats of a RubikDino |
... | ... | |
328 | 336 |
|
329 | 337 |
public Static3D[] getRotationAxis() |
330 | 338 |
{ |
331 |
return AXIS; |
|
339 |
return ROT_AXIS;
|
|
332 | 340 |
} |
333 | 341 |
|
334 | 342 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Introduce separate ROT_AXIS and FACE_AXIS ( step 1 )