Revision 97d2f701
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/object/RubikObject.java | ||
---|---|---|
131 | 131 |
final Static4D[] maps = new Static4D[numFaces]; |
132 | 132 |
final float ratio = 1.0f/(numFaces+1); |
133 | 133 |
|
134 |
if( 2*ROTATION_AXIS.length == numFaces ) |
|
134 |
if( 2*ROTATION_AXIS.length == numFaces ) // i.e. there are faces on both ends of the axis (cube)
|
|
135 | 135 |
{ |
136 | 136 |
for(int i=0; i<numFaces; i++) |
137 | 137 |
{ |
... | ... | |
139 | 139 |
maps[i] = new Static4D( (belongs?i:6)*ratio, 0.0f, ratio, 1.0f); |
140 | 140 |
} |
141 | 141 |
} |
142 |
else if( ROTATION_AXIS.length == numFaces ) |
|
142 |
else if( ROTATION_AXIS.length == numFaces ) // just a single face on the right end of an axis (pyraminx)
|
|
143 | 143 |
{ |
144 | 144 |
for(int i=0; i<numFaces; i++) |
145 | 145 |
{ |
... | ... | |
152 | 152 |
} |
153 | 153 |
|
154 | 154 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
155 |
// Cast centers of all Cubits on the first rotation Axis and compute the leftmost and rightmost |
|
156 |
// one. From there compute the 'start' (i.e. the leftmost) and 'step' (i.e. distance between two |
|
157 |
// consecutive). |
|
158 |
// it is assumed that other rotation axis have the same 'start' and 'step' - this is the case with |
|
159 |
// the Cube and the Pyraminx. |
|
160 |
// Start and Step are then needed to compute which rotation row (with respect to a given axis) a |
|
161 |
// given Cubit belongs to. |
|
155 | 162 |
|
156 | 163 |
private void computeStartAndStep(Static3D[] pos) |
157 | 164 |
{ |
Also available in: Unified diff
Minor.