Revision bdbbb4c5
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyMegaminx.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.objects; |
21 | 21 |
|
22 |
import static org.distorted.objectlb.Movement12.COS54; |
|
23 |
import static org.distorted.objectlb.Movement12.SIN54; |
|
24 |
|
|
22 | 25 |
import android.content.res.Resources; |
23 | 26 |
|
24 |
import org.distorted.helpers.ObjectShape;
|
|
25 |
import org.distorted.helpers.ObjectSticker;
|
|
26 |
import org.distorted.helpers.QuatHelper;
|
|
27 |
import org.distorted.objectlb.ObjectShape;
|
|
28 |
import org.distorted.objectlb.ObjectSticker;
|
|
29 |
import org.distorted.objectlb.QuatHelper;
|
|
27 | 30 |
import org.distorted.library.main.DistortedEffects; |
28 | 31 |
import org.distorted.library.main.DistortedTexture; |
29 | 32 |
import org.distorted.library.mesh.MeshSquare; |
30 | 33 |
import org.distorted.library.type.Static4D; |
31 | 34 |
import org.distorted.main.R; |
35 |
import org.distorted.objectlb.ObjectList; |
|
32 | 36 |
|
33 | 37 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
34 | 38 |
|
... | ... | |
39 | 43 |
|
40 | 44 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
41 | 45 |
|
42 |
TwistyMegaminx(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh, |
|
43 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth) |
|
46 |
public TwistyMegaminx(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
|
|
47 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
|
|
44 | 48 |
{ |
45 | 49 |
super(size, size, quat, texture, mesh, effects, moves, ObjectList.MEGA, res, scrWidth); |
46 | 50 |
} |
... | ... | |
68 | 72 |
|
69 | 73 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
70 | 74 |
|
71 |
int getNumStickerTypes(int numLayers) |
|
75 |
protected int getNumStickerTypes(int numLayers)
|
|
72 | 76 |
{ |
73 | 77 |
return (numLayers+3)/2; |
74 | 78 |
} |
75 | 79 |
|
76 | 80 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
77 | 81 |
|
78 |
float[][] getCuts(int numLayers) |
|
82 |
protected float[][] getCuts(int numLayers)
|
|
79 | 83 |
{ |
80 | 84 |
return genericGetCuts(numLayers,0.5f-MEGA_D); |
81 | 85 |
} |
... | ... | |
189 | 193 |
|
190 | 194 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
191 | 195 |
|
192 |
float[][] getCubitPositions(int numLayers) |
|
196 |
protected float[][] getCubitPositions(int numLayers)
|
|
193 | 197 |
{ |
194 | 198 |
int numCubitsPerCorner = numCubitsPerCorner(numLayers); |
195 | 199 |
int numCubitsPerEdge = numCubitsPerEdge(numLayers); |
... | ... | |
249 | 253 |
|
250 | 254 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
251 | 255 |
|
252 |
ObjectShape getObjectShape(int cubit, int numLayers) |
|
256 |
protected ObjectShape getObjectShape(int cubit, int numLayers)
|
|
253 | 257 |
{ |
254 | 258 |
int variant = getCubitVariant(cubit,numLayers); |
255 | 259 |
int numVariants = getNumCubitVariants(numLayers); |
... | ... | |
399 | 403 |
|
400 | 404 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
401 | 405 |
|
402 |
Static4D getQuat(int cubit, int numLayers) |
|
406 |
protected Static4D getQuat(int cubit, int numLayers)
|
|
403 | 407 |
{ |
404 | 408 |
if( mQuats==null ) initializeQuats(); |
405 | 409 |
int numCubitsPerCorner = numCubitsPerCorner(numLayers); |
... | ... | |
410 | 414 |
|
411 | 415 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
412 | 416 |
|
413 |
int getNumCubitVariants(int numLayers) |
|
417 |
protected int getNumCubitVariants(int numLayers)
|
|
414 | 418 |
{ |
415 | 419 |
int[] sizes = ObjectList.MEGA.getSizes(); |
416 | 420 |
int variants = sizes.length; |
... | ... | |
420 | 424 |
|
421 | 425 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
422 | 426 |
|
423 |
int getCubitVariant(int cubit, int numLayers) |
|
427 |
protected int getCubitVariant(int cubit, int numLayers)
|
|
424 | 428 |
{ |
425 | 429 |
int numCubitsPerCorner = numCubitsPerCorner(numLayers); |
426 | 430 |
|
... | ... | |
506 | 510 |
|
507 | 511 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
508 | 512 |
|
509 |
int getFaceColor(int cubit, int cubitface, int numLayers) |
|
513 |
protected int getFaceColor(int cubit, int cubitface, int numLayers)
|
|
510 | 514 |
{ |
511 | 515 |
int numCubitsPerCorner = numCubitsPerCorner(numLayers); |
512 | 516 |
int numCubitsPerEdge = numCubitsPerEdge(numLayers); |
... | ... | |
529 | 533 |
|
530 | 534 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
531 | 535 |
|
532 |
ObjectSticker retSticker(int face) |
|
536 |
protected ObjectSticker retSticker(int face)
|
|
533 | 537 |
{ |
534 | 538 |
if( mStickers==null ) |
535 | 539 |
{ |
Also available in: Unified diff
Refactoring: split the 'objects' package into two, 'objects' and 'objectlib'.
The point: we're going to need to move the 'objectlib' stuff into its own library module, and that's because we're going to create a new app module which needs access to it.