Revision bdbbb4c5
Added by Leszek Koltunski about 4 years ago
| src/main/java/org/distorted/objects/TwistyKilominx.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 |
|
| ... | ... | |
| 38 | 42 |
|
| 39 | 43 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 40 | 44 |
|
| 41 |
TwistyKilominx(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh, |
|
| 42 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth) |
|
| 45 |
public TwistyKilominx(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
|
|
| 46 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
|
|
| 43 | 47 |
{
|
| 44 | 48 |
super(size, size, quat, texture, mesh, effects, moves, ObjectList.KILO, res, scrWidth); |
| 45 | 49 |
} |
| ... | ... | |
| 81 | 85 |
|
| 82 | 86 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 83 | 87 |
|
| 84 |
int getNumStickerTypes(int numLayers) |
|
| 88 |
protected int getNumStickerTypes(int numLayers)
|
|
| 85 | 89 |
{
|
| 86 | 90 |
return numLayers<5 ? 1 : numLayers/2 + 1; |
| 87 | 91 |
} |
| 88 | 92 |
|
| 89 | 93 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 90 | 94 |
|
| 91 |
float[][] getCuts(int numLayers) |
|
| 95 |
protected float[][] getCuts(int numLayers)
|
|
| 92 | 96 |
{
|
| 93 | 97 |
return genericGetCuts(numLayers,0.5f); |
| 94 | 98 |
} |
| ... | ... | |
| 227 | 231 |
|
| 228 | 232 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 229 | 233 |
|
| 230 |
float[][] getCubitPositions(int numLayers) |
|
| 234 |
protected float[][] getCubitPositions(int numLayers)
|
|
| 231 | 235 |
{
|
| 232 | 236 |
if( mCorners==null ) initializeCorners(); |
| 233 | 237 |
if( numLayers<5 ) return mCorners; |
| ... | ... | |
| 305 | 309 |
|
| 306 | 310 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 307 | 311 |
|
| 308 |
ObjectShape getObjectShape(int cubit, int numLayers) |
|
| 312 |
protected ObjectShape getObjectShape(int cubit, int numLayers)
|
|
| 309 | 313 |
{
|
| 310 | 314 |
int variant = getCubitVariant(cubit,numLayers); |
| 311 | 315 |
int numVariants = getNumCubitVariants(numLayers); |
| ... | ... | |
| 483 | 487 |
|
| 484 | 488 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 485 | 489 |
|
| 486 |
Static4D getQuat(int cubit, int numLayers) |
|
| 490 |
protected Static4D getQuat(int cubit, int numLayers)
|
|
| 487 | 491 |
{
|
| 488 | 492 |
if( mQuats==null ) initializeQuats(); |
| 489 | 493 |
int numCubitsPerCorner = numCubitsPerCorner(numLayers); |
| ... | ... | |
| 494 | 498 |
|
| 495 | 499 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 496 | 500 |
|
| 497 |
int getNumCubitVariants(int numLayers) |
|
| 501 |
protected int getNumCubitVariants(int numLayers)
|
|
| 498 | 502 |
{
|
| 499 | 503 |
int[] sizes = ObjectList.KILO.getSizes(); |
| 500 | 504 |
int variants = sizes.length; |
| ... | ... | |
| 505 | 509 |
|
| 506 | 510 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 507 | 511 |
|
| 508 |
int getCubitVariant(int cubit, int numLayers) |
|
| 512 |
protected int getCubitVariant(int cubit, int numLayers)
|
|
| 509 | 513 |
{
|
| 510 | 514 |
int numCubitsPerCorner = numCubitsPerCorner(numLayers); |
| 511 | 515 |
|
| ... | ... | |
| 601 | 605 |
|
| 602 | 606 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 603 | 607 |
|
| 604 |
int getFaceColor(int cubit, int cubitface, int numLayers) |
|
| 608 |
protected int getFaceColor(int cubit, int cubitface, int numLayers)
|
|
| 605 | 609 |
{
|
| 606 | 610 |
int numCubitsPerCorner = numCubitsPerCorner(numLayers); |
| 607 | 611 |
int numCubitsPerEdge = numCubitsPerEdge(numLayers); |
| ... | ... | |
| 624 | 628 |
|
| 625 | 629 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 626 | 630 |
|
| 627 |
ObjectSticker retSticker(int face) |
|
| 631 |
protected ObjectSticker retSticker(int face)
|
|
| 628 | 632 |
{
|
| 629 | 633 |
if( mStickers==null ) |
| 630 | 634 |
{
|
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.