Revision 3ee1d662
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import org.distorted.library.type.Static3D; |
23 | 23 |
import org.distorted.library.type.Static4D; |
24 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
|
24 | 25 |
import org.distorted.objectlib.helpers.ObjectShape; |
25 | 26 |
import org.distorted.objectlib.helpers.ScrambleState; |
26 | 27 |
import org.distorted.objectlib.main.ObjectControl; |
... | ... | |
309 | 310 |
{9,10,12,11} |
310 | 311 |
}; |
311 | 312 |
|
312 |
float[][] bands = new float[][] { {0.05f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,1,1} }; |
|
313 |
int[] bandIndices = new int[] { 0,0,0,0,1,1,1,1,1 }; |
|
314 |
float[][] corners = new float[][] { {0.03f,0.10f} }; |
|
315 |
int[] cornerIndices = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 }; |
|
316 |
float[][] centers = new float[][] { { LEN/2, 0.0f, -LEN/2} }; |
|
317 |
int[] centerIndices = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 }; |
|
318 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,4); |
|
313 |
return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),4); |
|
319 | 314 |
} |
320 | 315 |
if( variant==1 ) |
321 | 316 |
{ |
... | ... | |
345 | 340 |
{3,5,7,6,4} |
346 | 341 |
}; |
347 | 342 |
|
348 |
float[][] bands = new float[][] { {0.03f,35,0.15f,0.3f,3,1,1},{0.00f,35,0.15f,0.3f,3,1,1} }; |
|
349 |
int[] bandIndices = new int[] { 0,0,1,1,1,1 }; |
|
350 |
float[][] corners = new float[][] { {0.02f,0.10f} }; |
|
351 |
int[] cornerIndices = new int[] { 0,0,0,0,0,0,-1,-1 }; |
|
352 |
float[][] centers = new float[][] { { 0, 0, -B} }; |
|
353 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,-1,-1 }; |
|
354 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,2); |
|
343 |
return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),2); |
|
355 | 344 |
} |
356 | 345 |
else |
357 | 346 |
{ |
... | ... | |
373 | 362 |
{1,3,2}, |
374 | 363 |
}; |
375 | 364 |
|
376 |
float[][] bands = new float[][] { {0.03f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,0,0} }; |
|
377 |
int[] bandIndices = new int[] { 0,1,1,1 }; |
|
378 |
float[][] corners = new float[][] { {0.02f,0.10f} }; |
|
379 |
int[] cornerIndices = new int[] { 0,0,0,-1 }; |
|
380 |
float[][] centers = new float[][] { {0, -(SQ2/3)*L,-2*L/3} }; |
|
381 |
int[] centerIndices = new int[] { 0,0,0,-1 }; |
|
382 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,1); |
|
365 |
return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),1); |
|
366 |
} |
|
367 |
} |
|
368 |
|
|
369 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
370 |
|
|
371 |
public ObjectFaceShape getObjectFaceShape(int variant) |
|
372 |
{ |
|
373 |
if( variant==0 ) |
|
374 |
{ |
|
375 |
float[][] bands = { {0.05f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,1,1} }; |
|
376 |
int[] bandIndices = { 0,0,0,0,1,1,1,1,1 }; |
|
377 |
float[][] corners = { {0.03f,0.10f} }; |
|
378 |
int[] cornerIndices = { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 }; |
|
379 |
float[][] centers = { { LEN/2, 0.0f, -LEN/2} }; |
|
380 |
int[] centerIndices = { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 }; |
|
381 |
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null); |
|
382 |
} |
|
383 |
if( variant==1 ) |
|
384 |
{ |
|
385 |
final float B = LEN-2*LEN*CUT; |
|
386 |
float[][] bands = { {0.03f,35,0.15f,0.3f,3,1,1},{0.00f,35,0.15f,0.3f,3,1,1} }; |
|
387 |
int[] bandIndices = { 0,0,1,1,1,1 }; |
|
388 |
float[][] corners = { {0.02f,0.10f} }; |
|
389 |
int[] cornerIndices = { 0,0,0,0,0,0,-1,-1 }; |
|
390 |
float[][] centers = { { 0, 0, -B} }; |
|
391 |
int[] centerIndices = { 0,0,0,0,0,0,-1,-1 }; |
|
392 |
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null); |
|
393 |
} |
|
394 |
else |
|
395 |
{ |
|
396 |
final float L = LEN-3*LEN*CUT; |
|
397 |
float[][] bands = { {0.03f,35,0.15f,0.3f,4,1,1},{0.00f,35,0.15f,0.3f,4,0,0} }; |
|
398 |
int[] bandIndices = { 0,1,1,1 }; |
|
399 |
float[][] corners = { {0.02f,0.10f} }; |
|
400 |
int[] cornerIndices = { 0,0,0,-1 }; |
|
401 |
float[][] centers = { {0, -(SQ2/3)*L,-2*L/3} }; |
|
402 |
int[] centerIndices = { 0,0,0,-1 }; |
|
403 |
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null); |
|
383 | 404 |
} |
384 | 405 |
} |
385 | 406 |
|
Also available in: Unified diff
Split ObjectShape into ObjectShape and ObjectFaceShape