Revision c187cb69
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/objectlib/helpers/ObjectShape.java | ||
---|---|---|
34 | 34 |
private final int[] mCenterIndices; |
35 | 35 |
private final int mNumComponents; |
36 | 36 |
private final float[] mConvexityCenter; |
37 |
private final int mNumOutsideFaces; |
|
37 | 38 |
|
38 | 39 |
private float[][] mBands; |
39 | 40 |
|
... | ... | |
41 | 42 |
|
42 | 43 |
public ObjectShape(float[][] vertices, int[][] vertIndices, float[][] bands, int[] bandIndices, |
43 | 44 |
float[][] corners, int[] cornIndices, float[][] centers, int[] centIndices, |
44 |
int numComponents, float[] convexityCenter) |
|
45 |
int numComponents, float[] convexityCenter, int numOutside)
|
|
45 | 46 |
{ |
46 | 47 |
mVertices = vertices; |
47 | 48 |
mVertIndices = vertIndices; |
... | ... | |
53 | 54 |
mCenterIndices = centIndices; |
54 | 55 |
mNumComponents = numComponents; |
55 | 56 |
mConvexityCenter = convexityCenter; |
57 |
mNumOutsideFaces = numOutside; |
|
56 | 58 |
|
57 | 59 |
if( ObjectControl.isInIconMode() ) |
58 | 60 |
{ |
... | ... | |
138 | 140 |
{ |
139 | 141 |
return mConvexityCenter; |
140 | 142 |
} |
143 |
|
|
144 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
145 |
|
|
146 |
public int getNumOutside() |
|
147 |
{ |
|
148 |
return mNumOutsideFaces; |
|
149 |
} |
|
141 | 150 |
} |
src/main/java/org/distorted/objectlib/json/JsonReader.java | ||
---|---|---|
25 | 25 |
import java.io.InputStreamReader; |
26 | 26 |
import java.nio.charset.StandardCharsets; |
27 | 27 |
|
28 |
import org.distorted.objectlib.touchcontrol.TouchControl; |
|
29 | 28 |
import org.json.JSONArray; |
30 | 29 |
import org.json.JSONException; |
31 | 30 |
import org.json.JSONObject; |
src/main/java/org/distorted/objectlib/objects/TwistyBandagedAbstract.java | ||
---|---|---|
207 | 207 |
{-0.5f*(X-1),-0.5f*(Y-1),-0.5f*(Z-1)} |
208 | 208 |
}; |
209 | 209 |
|
210 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
210 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 6);
|
|
211 | 211 |
} |
212 | 212 |
|
213 | 213 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java | ||
---|---|---|
266 | 266 |
else if( variant==1 ) bandIndices = new int[] {1,1,1,0,1,0}; |
267 | 267 |
else bandIndices = new int[] {2,2,2,2,0,2}; |
268 | 268 |
|
269 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null); |
|
269 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null, 1);
|
|
270 | 270 |
} |
271 | 271 |
|
272 | 272 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyDiamond.java | ||
---|---|---|
415 | 415 |
int[] cornerIndices = new int[] { 0,0,0,0,0,0 }; |
416 | 416 |
float[][] centers = new float[][] { {0.0f, 0.0f, 0.0f} }; |
417 | 417 |
int[] centerIndices = new int[] { 0,0,0,0,0,0 }; |
418 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
418 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
419 | 419 |
} |
420 | 420 |
else |
421 | 421 |
{ |
... | ... | |
427 | 427 |
int[] cornerIndices = new int[] { 0,0,0,0 }; |
428 | 428 |
float[][] centers = new float[][] { {0.0f, 0.0f, 0.0f} }; |
429 | 429 |
int[] centerIndices = new int[] { 0,0,0,0 }; |
430 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
430 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
431 | 431 |
} |
432 | 432 |
} |
433 | 433 |
|
src/main/java/org/distorted/objectlib/objects/TwistyDino.java | ||
---|---|---|
202 | 202 |
int[] cornerIndices = new int[] { 0,0,1,1 }; |
203 | 203 |
float[][] centers = new float[][] { {0.0f, -0.75f, -0.75f} }; |
204 | 204 |
int[] centerIndices = new int[] { 0,0,0,0 }; |
205 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
205 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
206 | 206 |
} |
207 | 207 |
|
208 | 208 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyHelicopter.java | ||
---|---|---|
314 | 314 |
int[] cornerIndices = new int[] { 0,0,0,0,0 }; |
315 | 315 |
float[][] centers = new float[][] { {-0.75f, -0.75f, -0.75f} }; |
316 | 316 |
int[] centerIndices = new int[] { 0,0,0,-1,0 }; |
317 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
317 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
318 | 318 |
} |
319 | 319 |
else |
320 | 320 |
{ |
... | ... | |
340 | 340 |
int[] cornerIndices = new int[] { 0,0,0,-1 }; |
341 | 341 |
float[][] centers = new float[][] { {-0.25f, -0.25f, -0.75f} }; |
342 | 342 |
int[] centerIndices = new int[] { 0,0,0,-1 }; |
343 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
343 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
344 | 344 |
} |
345 | 345 |
} |
346 | 346 |
|
src/main/java/org/distorted/objectlib/objects/TwistyIvy.java | ||
---|---|---|
336 | 336 |
|
337 | 337 |
float C = 1-SQ2/2; |
338 | 338 |
float[] convexCenter = new float[] {-C,-C,-C}; |
339 |
return new ObjectShape(vertices,vertIndices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), convexCenter); |
|
339 |
return new ObjectShape(vertices,vertIndices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), convexCenter, 3);
|
|
340 | 340 |
} |
341 | 341 |
else |
342 | 342 |
{ |
... | ... | |
381 | 381 |
{-0.10f,45,0.5f,0.0f,2,0,0} |
382 | 382 |
}; |
383 | 383 |
|
384 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indexes,centers,indexes,getNumCubitFaces(), null); |
|
384 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indexes,centers,indexes,getNumCubitFaces(), null, 1);
|
|
385 | 385 |
} |
386 | 386 |
} |
387 | 387 |
|
src/main/java/org/distorted/objectlib/objects/TwistyJing.java | ||
---|---|---|
276 | 276 |
int[] cornerIndices = new int[] { 0,1,1,-1,1,-1,-1,-1 }; |
277 | 277 |
float[][] centers = new float[][] { { 0.0f, Y, Z-F/2} }; |
278 | 278 |
int[] centerIndices = new int[] { 0,0,0,-1,0,-1,-1,-1 }; |
279 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
279 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
280 | 280 |
} |
281 | 281 |
else if( variant==1 ) |
282 | 282 |
{ |
... | ... | |
307 | 307 |
int[] cornerIndices = new int[] { 0,0,-1,0,0,0,-1,0 }; |
308 | 308 |
float[][] centers = new float[][] { { 0, F*SQ2/2, 0 } }; |
309 | 309 |
int[] centerIndices = new int[] { 0,0,-1,0,0,0,-1,0 }; |
310 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
310 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
311 | 311 |
} |
312 | 312 |
else |
313 | 313 |
{ |
... | ... | |
335 | 335 |
int[] cornerIndices = new int[] { 0,0,0,-1,-1,-1 }; |
336 | 336 |
float[][] centers = new float[][] { { 0, -2*Y/3, 4*Z/3 } }; |
337 | 337 |
int[] centerIndices = new int[] { 0,0,0,-1,-1,-1 }; |
338 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
338 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
339 | 339 |
} |
340 | 340 |
} |
341 | 341 |
|
src/main/java/org/distorted/objectlib/objects/TwistyKilominx.java | ||
---|---|---|
360 | 360 |
float[][] centers = new float[][] { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} }; |
361 | 361 |
int[] centerIndices = new int[] { 0,-1,-1,-1,-1,-1,-1,-1 }; |
362 | 362 |
|
363 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
363 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
364 | 364 |
} |
365 | 365 |
if( variant<numVariants-1 ) |
366 | 366 |
{ |
... | ... | |
429 | 429 |
float[][] centers = new float[][] { {0.0f, -width/2, (float)(-2*Z)} }; |
430 | 430 |
int[] centerIndices = new int[] { 0,-1,-1,-1, 0,-1,-1,-1 }; |
431 | 431 |
|
432 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
432 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
433 | 433 |
} |
434 | 434 |
else |
435 | 435 |
{ |
... | ... | |
482 | 482 |
float[][] centers = new float[][] { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} }; |
483 | 483 |
int[] centerIndices = new int[] { 0, 0,-1, 0, 0,-1,-1,-1 }; |
484 | 484 |
|
485 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
485 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
486 | 486 |
} |
487 | 487 |
} |
488 | 488 |
|
src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java | ||
---|---|---|
302 | 302 |
float[][] centers = new float[][] { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} }; |
303 | 303 |
int[] centerIndices = new int[] { 0,-1,-1,-1,-1,-1,-1,-1 }; |
304 | 304 |
|
305 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
305 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
306 | 306 |
} |
307 | 307 |
if( variant<numVariants-1 ) |
308 | 308 |
{ |
... | ... | |
350 | 350 |
float[][] centers = new float[][] { {0.0f, 0.0f, (float)(-2*Z)} }; |
351 | 351 |
int[] centerIndices = new int[] { -1,-1,-1,-1, -1,-1,-1,-1 }; |
352 | 352 |
|
353 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
353 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
354 | 354 |
} |
355 | 355 |
else |
356 | 356 |
{ |
... | ... | |
400 | 400 |
float[][] centers = new float[][] { {0.0f, 0.0f, 0.0f} }; |
401 | 401 |
int[] centerIndices = new int[] { -1,-1,-1,-1, -1,-1 }; |
402 | 402 |
|
403 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
403 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
404 | 404 |
} |
405 | 405 |
} |
406 | 406 |
|
src/main/java/org/distorted/objectlib/objects/TwistyMirror.java | ||
---|---|---|
470 | 470 |
float[][] centers = new float[][] { {0.0f, 0.0f, 0.0f} }; |
471 | 471 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 }; |
472 | 472 |
|
473 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
473 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 6);
|
|
474 | 474 |
} |
475 | 475 |
|
476 | 476 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyPyraminx.java | ||
---|---|---|
347 | 347 |
int[] cornerIndices = new int[] { 0,0,0,0,0,0 }; |
348 | 348 |
float[][] centers = new float[][] { {0.0f, 0.0f, 0.0f} }; |
349 | 349 |
int[] centerIndices = new int[] { 0,0,0,0,0,0 }; |
350 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
350 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
351 | 351 |
} |
352 | 352 |
else |
353 | 353 |
{ |
... | ... | |
361 | 361 |
int[] cornerIndices = new int[] { 0,0,0,0 }; |
362 | 362 |
float[][] centers = new float[][] { {0.0f, 0.0f, 0.0f} }; |
363 | 363 |
int[] centerIndices = new int[] { 0,0,0,0 }; |
364 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
364 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
365 | 365 |
} |
366 | 366 |
} |
367 | 367 |
|
src/main/java/org/distorted/objectlib/objects/TwistyRedi.java | ||
---|---|---|
283 | 283 |
int[] cornerIndices = new int[] { -1,0,-1,0,0,0,-1,-1 }; |
284 | 284 |
float[][] centers = new float[][] { { 0.0f, 0.0f, 0.0f} }; |
285 | 285 |
int[] centerIndices = new int[] { -1,0,-1,0,0,0,-1,-1 }; |
286 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
286 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
287 | 287 |
} |
288 | 288 |
else |
289 | 289 |
{ |
... | ... | |
315 | 315 |
int[] cornerIndices = new int[] { 0,0,-1,-1,-1,-1,-1,-1 }; |
316 | 316 |
float[][] centers = new float[][] { { 0.0f,-0.75f,-0.75f} }; |
317 | 317 |
int[] centerIndices = new int[] { 0,0,-1,-1,-1,-1,-1,-1 }; |
318 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
318 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
319 | 319 |
} |
320 | 320 |
} |
321 | 321 |
|
src/main/java/org/distorted/objectlib/objects/TwistyRex.java | ||
---|---|---|
275 | 275 |
int[] bandIndices= new int[] { 0,1,1,1,1 }; |
276 | 276 |
float[][] bands = { {+0.016f,10,G/3,0.5f,5,1,1},{ +0.0f,45,0.1f,0.1f,2,0,0} }; |
277 | 277 |
|
278 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null); |
|
278 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null, 1);
|
|
279 | 279 |
} |
280 | 280 |
else if( variant==1 ) |
281 | 281 |
{ |
... | ... | |
286 | 286 |
int[] bandIndices= new int[] { 0,1,1,1,1 }; |
287 | 287 |
float[][] bands = { {0.025f,10,G/2,0.5f,5,0,0},{0.000f,45,G/2,0.0f,2,0,0} }; |
288 | 288 |
|
289 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,null,indices,null,indices,getNumCubitFaces(), null); |
|
289 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,null,indices,null,indices,getNumCubitFaces(), null, 1);
|
|
290 | 290 |
} |
291 | 291 |
else |
292 | 292 |
{ |
... | ... | |
301 | 301 |
int[] bandIndices= new int[] { 0,0,1,1 }; |
302 | 302 |
float[][] bands = { {0.03f,27,F/3,0.8f,5,2,3},{0.01f,45,G/3,0.2f,3,1,2} }; |
303 | 303 |
|
304 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null); |
|
304 |
return new ObjectShape(vertices,vertIndexes,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null, 2);
|
|
305 | 305 |
} |
306 | 306 |
} |
307 | 307 |
|
src/main/java/org/distorted/objectlib/objects/TwistySkewb.java | ||
---|---|---|
433 | 433 |
int[] cornerIndices = new int[] { 1,1,1,0,0 }; |
434 | 434 |
float[][] centers = new float[][] { {-0.5f, -0.5f, -0.5f} }; |
435 | 435 |
int[] centerIndices = new int[] { 0,0,0,-1,0 }; |
436 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
436 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
437 | 437 |
} |
438 | 438 |
else if( variant==1 ) |
439 | 439 |
{ |
... | ... | |
447 | 447 |
int[] cornerIndices = new int[] { 0,0,1,1 }; |
448 | 448 |
float[][] centers = new float[][] { {0.0f, -0.5f, -0.5f} }; |
449 | 449 |
int[] centerIndices = new int[] { 0,0,0,0 }; |
450 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
450 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
451 | 451 |
} |
452 | 452 |
else |
453 | 453 |
{ |
... | ... | |
461 | 461 |
int[] cornerIndices = new int[] { 0,0,0,0,0 }; |
462 | 462 |
float[][] centers = new float[][] { {0,0,-0.4f} }; |
463 | 463 |
int[] centerIndices = new int[] { 0,0,0,0,-1 }; |
464 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
464 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
|
|
465 | 465 |
} |
466 | 466 |
} |
467 | 467 |
|
src/main/java/org/distorted/objectlib/objects/TwistySquare1.java | ||
---|---|---|
108 | 108 |
float[][] centers = new float[][] { { -0.75f, 0.0f, 0.0f} }; |
109 | 109 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 }; |
110 | 110 |
|
111 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
111 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
112 | 112 |
} |
113 | 113 |
else if( variant==1 ) |
114 | 114 |
{ |
... | ... | |
125 | 125 |
int[][] vert_indices = new int[][] |
126 | 126 |
{ |
127 | 127 |
{0,1,2}, |
128 |
{3,4,5}, |
|
129 | 128 |
{3,4,1,0}, |
129 |
{3,4,5}, |
|
130 | 130 |
{4,5,2,1}, |
131 | 131 |
{5,3,0,2} |
132 | 132 |
}; |
... | ... | |
138 | 138 |
float[][] centers = new float[][] { { 0.0f, 0.0f,-0.5f} }; |
139 | 139 |
int[] centerIndices = new int[] { 0,0,-1,0,0,-1 }; |
140 | 140 |
|
141 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
141 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
142 | 142 |
} |
143 | 143 |
else |
144 | 144 |
{ |
... | ... | |
170 | 170 |
float[][] centers = new float[][] { { -0.5f, 0.0f,-0.5f} }; |
171 | 171 |
int[] centerIndices = new int[] { -1,0,-1,-1,-1,0,-1,-1 }; |
172 | 172 |
|
173 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
173 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
174 | 174 |
} |
175 | 175 |
} |
176 | 176 |
|
src/main/java/org/distorted/objectlib/objects/TwistySquare2.java | ||
---|---|---|
116 | 116 |
int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0 }; |
117 | 117 |
float[][] centers = new float[][] { { -0.75f, 0.0f, 0.0f} }; |
118 | 118 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 }; |
119 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
119 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
120 | 120 |
} |
121 | 121 |
else if( variant==1 ) |
122 | 122 |
{ |
... | ... | |
133 | 133 |
int[][] vert_indices = new int[][] |
134 | 134 |
{ |
135 | 135 |
{0,1,2}, |
136 |
{3,4,5}, |
|
137 | 136 |
{3,4,1,0}, |
137 |
{3,4,5}, |
|
138 | 138 |
{4,5,2,1}, |
139 | 139 |
{5,3,0,2} |
140 | 140 |
}; |
... | ... | |
145 | 145 |
int[] cornerIndices = new int[] { 0,0,-1,0,0,-1 }; |
146 | 146 |
float[][] centers = new float[][] { { 0.0f, 0.0f,-0.5f} }; |
147 | 147 |
int[] centerIndices = new int[] { 0,0,-1,0,0,-1 }; |
148 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
148 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
149 | 149 |
} |
150 | 150 |
else |
151 | 151 |
{ |
... | ... | |
161 | 161 |
int[][] vert_indices = new int[][] |
162 | 162 |
{ |
163 | 163 |
{0,1,2}, |
164 |
{5,4,3}, |
|
165 | 164 |
{3,4,1,0}, |
165 |
{5,4,3}, |
|
166 | 166 |
{4,5,2,1}, |
167 | 167 |
{5,3,0,2} |
168 | 168 |
}; |
... | ... | |
173 | 173 |
int[] cornerIndices = new int[] { 0,0,-1,0,0,-1 }; |
174 | 174 |
float[][] centers = new float[][] { { 0.0f, 0.0f,-0.5f} }; |
175 | 175 |
int[] centerIndices = new int[] { 0,0,-1,0,0,-1 }; |
176 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
176 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
|
|
177 | 177 |
} |
178 | 178 |
} |
179 | 179 |
|
src/main/java/org/distorted/objectlib/objects/TwistyTrajber.java | ||
---|---|---|
112 | 112 |
{ |
113 | 113 |
mQuats = new Static4D[] |
114 | 114 |
{ |
115 |
new Static4D( 0.0f, 0.0f, 0.0f, 1.0f), // 0 nothing // OK
|
|
116 |
new Static4D( SQ2/2, 0.0f, SQ2/2, 0.0f), // 1 ( 1, 0,-1) 180 // OK
|
|
117 |
new Static4D( 0.0f, 1.0f, 0.0f, 0.0f), // 2 ( 0, 1, 0) 180 // OK
|
|
118 |
new Static4D( SQ2/2, 0.0f, -SQ2/2, 0.0f), // 3 ( 1, 0, 1) 180 // OK
|
|
115 |
new Static4D( 0.0f, 0.0f, 0.0f, 1.0f), // 0 nothing |
|
116 |
new Static4D( SQ2/2, 0.0f, SQ2/2, 0.0f), // 1 ( 1, 0,-1) 180 |
|
117 |
new Static4D( 0.0f, 1.0f, 0.0f, 0.0f), // 2 ( 0, 1, 0) 180 |
|
118 |
new Static4D( SQ2/2, 0.0f, -SQ2/2, 0.0f), // 3 ( 1, 0, 1) 180 |
|
119 | 119 |
|
120 | 120 |
new Static4D( 0.5f, SQ2/2, -0.5f, 0.0f), // 4 (0.5,SQ2/2,0.5) 180 |
121 | 121 |
new Static4D( 0.5f, -SQ2/2, -0.5f, 0.0f), // 5 (0.5,-SQ2/2,-0.5) 180 |
122 | 122 |
new Static4D( 1.0f, 0.0f, 0.0f, 0.0f), // 6 (1,0,0) 180 |
123 | 123 |
new Static4D( 0.0f, 0.0f, 1.0f, 0.0f), // 7 (0,0,1) 180 |
124 |
new Static4D( 0.5f, 0.0f, 0.5f, SQ2/2), // 8 ( 1, 0, 1) +-90 // OK
|
|
125 |
new Static4D( 0.5f, 0.0f, 0.5f, -SQ2/2), // 9 ( 1, 0, 1) -+90 // OK
|
|
124 |
new Static4D( 0.5f, 0.0f, 0.5f, SQ2/2), // 8 ( 1, 0, 1) +-90 |
|
125 |
new Static4D( 0.5f, 0.0f, 0.5f, -SQ2/2), // 9 ( 1, 0, 1) -+90 |
|
126 | 126 |
new Static4D( 0.5f, SQ2/2, 0.5f, 0.0f), // 10 (-0.5,-SQ2/2,-0.5) 180 |
127 | 127 |
new Static4D( 0.5f, -SQ2/2, 0.5f, 0.0f), // 11 (0.5,-SQ2/2,0.5) 180 |
128 |
new Static4D( 0.0f, SQ2/2, 0.0f, SQ2/2), // 12 ( 0, 1, 0) +-90 // OK
|
|
129 |
new Static4D( 0.0f, SQ2/2, 0.0f, -SQ2/2), // 13 ( 0, 1, 0) -+90 // OK
|
|
130 |
new Static4D( 0.5f, 0.0f, -0.5f, -SQ2/2), // 15 ( 1, 0,-1) -+90 // OK
|
|
131 |
new Static4D( 0.5f, 0.0f, -0.5f, SQ2/2), // 14 ( 1, 0,-1) +-90 // OK
|
|
128 |
new Static4D( 0.0f, SQ2/2, 0.0f, SQ2/2), // 12 ( 0, 1, 0) +-90 |
|
129 |
new Static4D( 0.0f, SQ2/2, 0.0f, -SQ2/2), // 13 ( 0, 1, 0) -+90 |
|
130 |
new Static4D( 0.5f, 0.0f, -0.5f, -SQ2/2), // 15 ( 1, 0,-1) -+90 |
|
131 |
new Static4D( 0.5f, 0.0f, -0.5f, SQ2/2), // 14 ( 1, 0,-1) +-90 |
|
132 | 132 |
|
133 | 133 |
new Static4D( SQ2/2, 0.5f, 0.0f, 0.5f), // 16 (+,+,0) + |
134 | 134 |
new Static4D( 0.0f, -0.5f, SQ2/2, -0.5f), // 17 (0,-,+) - |
... | ... | |
328 | 328 |
int[] cornerIndices = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 }; |
329 | 329 |
float[][] centers = new float[][] { { LEN/2, 0.0f, -LEN/2} }; |
330 | 330 |
int[] centerIndices = new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 }; |
331 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
331 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,4);
|
|
332 | 332 |
} |
333 | 333 |
if( variant==1 ) |
334 | 334 |
{ |
... | ... | |
364 | 364 |
int[] cornerIndices = new int[] { 0,0,0,0,0,0,-1,-1 }; |
365 | 365 |
float[][] centers = new float[][] { { 0, 0, -B} }; |
366 | 366 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,-1,-1 }; |
367 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
367 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,2);
|
|
368 | 368 |
} |
369 | 369 |
else |
370 | 370 |
{ |
... | ... | |
392 | 392 |
int[] cornerIndices = new int[] { 0,0,0,-1 }; |
393 | 393 |
float[][] centers = new float[][] { {0, -(SQ2/3)*L,-2*L/3} }; |
394 | 394 |
int[] centerIndices = new int[] { 0,0,0,-1 }; |
395 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
395 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null,1);
|
|
396 | 396 |
} |
397 | 397 |
} |
398 | 398 |
|
... | ... | |
438 | 438 |
|
439 | 439 |
if( mEdgeColorMap==null) |
440 | 440 |
{ |
441 |
mEdgeColorMap = new int[][] { {3,0},{1,2},{4,7},{6,5}, {0,4},{5,1},{7,3},{2,6}, {1,0},{4,5},{3,2},{6,7} };
|
|
441 |
mEdgeColorMap = new int[][] { {3,0},{1,2},{4,7},{6,5}, {0,4},{5,1},{7,3},{2,6}, {1,0},{4,5},{3,2},{6,7} }; |
|
442 | 442 |
} |
443 | 443 |
|
444 | 444 |
if( mCornerColorMap==null) |
src/main/java/org/distorted/objectlib/objects/TwistyUltimate.java | ||
---|---|---|
151 | 151 |
int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 }; |
152 | 152 |
float[][] centers = new float[][] { { 0.0f,-1.0f, -(SQ5+3)/2 } }; |
153 | 153 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 }; |
154 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
154 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
155 | 155 |
} |
156 | 156 |
else if( variant==1 ) |
157 | 157 |
{ |
... | ... | |
182 | 182 |
int[] cornerIndices = new int[] { 0, 0, 0, 0,-1, 0, 0, 0 }; |
183 | 183 |
float[][] centers = new float[][] { { 0.0f,-1.0f, -(SQ5+3)/2 } }; |
184 | 184 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 }; |
185 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
185 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
|
|
186 | 186 |
} |
187 | 187 |
else |
188 | 188 |
{ |
... | ... | |
218 | 218 |
int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0,0,0,-1 }; |
219 | 219 |
float[][] centers = new float[][] { { -(SQ5+1)/4, 0.5f, -(SQ5+5)/4 } }; |
220 | 220 |
int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0,0,0,0 }; |
221 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null); |
|
221 |
return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 4);
|
|
222 | 222 |
} |
223 | 223 |
} |
224 | 224 |
|
Also available in: Unified diff
Initial commit