Revision e6cf7283
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/objects/TwistySkewb.java | ||
---|---|---|
213 | 213 |
|
214 | 214 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
215 | 215 |
|
216 |
Static3D[] getCubitPositions(int numLayers)
|
|
216 |
float[][] getCubitPositions(int numLayers)
|
|
217 | 217 |
{ |
218 | 218 |
final float DIST_CORNER = (numLayers-1)*0.50f; |
219 | 219 |
final float DIST_EDGE = (numLayers-1)*0.50f; |
... | ... | |
223 | 223 |
final int numEdges = getNumEdges(numLayers); |
224 | 224 |
final int numCenters = 6*getNumCentersPerFace(numLayers); |
225 | 225 |
|
226 |
final Static3D[] CENTERS = new Static3D[numCorners+numEdges+numCenters];
|
|
226 |
final float[][] CENTERS = new float[numCorners+numEdges+numCenters][];
|
|
227 | 227 |
|
228 | 228 |
/// CORNERS ////////////////////////////////////////////// |
229 | 229 |
|
230 |
CENTERS[0] = new Static3D( DIST_CORNER, DIST_CORNER, DIST_CORNER );
|
|
231 |
CENTERS[1] = new Static3D( DIST_CORNER, DIST_CORNER,-DIST_CORNER );
|
|
232 |
CENTERS[2] = new Static3D( DIST_CORNER,-DIST_CORNER, DIST_CORNER );
|
|
233 |
CENTERS[3] = new Static3D( DIST_CORNER,-DIST_CORNER,-DIST_CORNER );
|
|
234 |
CENTERS[4] = new Static3D(-DIST_CORNER, DIST_CORNER, DIST_CORNER );
|
|
235 |
CENTERS[5] = new Static3D(-DIST_CORNER, DIST_CORNER,-DIST_CORNER );
|
|
236 |
CENTERS[6] = new Static3D(-DIST_CORNER,-DIST_CORNER, DIST_CORNER );
|
|
237 |
CENTERS[7] = new Static3D(-DIST_CORNER,-DIST_CORNER,-DIST_CORNER );
|
|
230 |
CENTERS[0] = new float[] { DIST_CORNER, DIST_CORNER, DIST_CORNER };
|
|
231 |
CENTERS[1] = new float[] { DIST_CORNER, DIST_CORNER,-DIST_CORNER };
|
|
232 |
CENTERS[2] = new float[] { DIST_CORNER,-DIST_CORNER, DIST_CORNER };
|
|
233 |
CENTERS[3] = new float[] { DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
|
|
234 |
CENTERS[4] = new float[] {-DIST_CORNER, DIST_CORNER, DIST_CORNER };
|
|
235 |
CENTERS[5] = new float[] {-DIST_CORNER, DIST_CORNER,-DIST_CORNER };
|
|
236 |
CENTERS[6] = new float[] {-DIST_CORNER,-DIST_CORNER, DIST_CORNER };
|
|
237 |
CENTERS[7] = new float[] {-DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
|
|
238 | 238 |
|
239 | 239 |
/// EDGES /////////////////////////////////////////////// |
240 | 240 |
|
... | ... | |
262 | 262 |
|
263 | 263 |
for (int j=0; j<numLayers-2; j++, c+=1.0f, index++) |
264 | 264 |
{ |
265 |
CENTERS[index] = new Static3D( edges[0]==0 ? c : edges[0] ,
|
|
265 |
CENTERS[index] = new float[] { edges[0]==0 ? c : edges[0] ,
|
|
266 | 266 |
edges[1]==0 ? c : edges[1] , |
267 |
edges[2]==0 ? c : edges[2] );
|
|
267 |
edges[2]==0 ? c : edges[2] };
|
|
268 | 268 |
} |
269 | 269 |
} |
270 | 270 |
|
... | ... | |
307 | 307 |
else if( centers[2]==X ) cen2 = x; |
308 | 308 |
else cen2 = centers[2]; |
309 | 309 |
|
310 |
CENTERS[index] = new Static3D(cen0,cen1,cen2);
|
|
310 |
CENTERS[index] = new float[] {cen0,cen1,cen2};
|
|
311 | 311 |
} |
312 | 312 |
} |
313 | 313 |
|
... | ... | |
331 | 331 |
else if( centers[2]==X ) cen2 = x; |
332 | 332 |
else cen2 = centers[2]; |
333 | 333 |
|
334 |
CENTERS[index] = new Static3D(cen0,cen1,cen2);
|
|
334 |
CENTERS[index] = new float[] {cen0,cen1,cen2};
|
|
335 | 335 |
} |
336 | 336 |
} |
337 | 337 |
} |
Also available in: Unified diff
Change the Cubit center from a Static3D to a float[].
The point: now we can have more than one center, and bandaged objects need more than one, because in this way they are going to fill up their RotationRow bitmaps.