Revision efa81f0c
Added by Leszek Koltunski about 4 years ago
| src/main/java/org/distorted/objects/TwistySquare.java | ||
|---|---|---|
| 29 | 29 |
|
| 30 | 30 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 31 | 31 |
|
| 32 |
abstract class TwistySquare extends TwistyObject
|
|
| 32 |
abstract class TwistySquare extends Twisty6
|
|
| 33 | 33 |
{
|
| 34 | 34 |
static final float COS15 = (SQ6+SQ2)/4; |
| 35 | 35 |
static final float SIN15 = (SQ6-SQ2)/4; |
| ... | ... | |
| 46 | 46 |
new Static3D(0,-1,0), |
| 47 | 47 |
}; |
| 48 | 48 |
|
| 49 |
static final int[] FACE_COLORS = new int[] |
|
| 50 |
{
|
|
| 51 |
COLOR_YELLOW, COLOR_WHITE, |
|
| 52 |
COLOR_BLUE , COLOR_GREEN, |
|
| 53 |
COLOR_RED , COLOR_ORANGE |
|
| 54 |
}; |
|
| 55 |
|
|
| 56 | 49 |
private int[] mBasicAngle; |
| 57 | 50 |
private Movement mMovement; |
| 58 | 51 |
Static4D[] mQuats; |
| ... | ... | |
| 114 | 107 |
return mQuats; |
| 115 | 108 |
} |
| 116 | 109 |
|
| 117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 118 |
|
|
| 119 |
boolean shouldResetTextureMaps() |
|
| 120 |
{
|
|
| 121 |
return false; |
|
| 122 |
} |
|
| 123 |
|
|
| 124 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 125 |
|
|
| 126 |
int getNumFaceColors() |
|
| 127 |
{
|
|
| 128 |
return FACE_COLORS.length; |
|
| 129 |
} |
|
| 130 |
|
|
| 131 | 110 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 132 | 111 |
|
| 133 | 112 |
int getNumCubitFaces() |
| ... | ... | |
| 135 | 114 |
return 6; |
| 136 | 115 |
} |
| 137 | 116 |
|
| 138 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 139 |
|
|
| 140 |
float getScreenRatio() |
|
| 141 |
{
|
|
| 142 |
return 0.5f; |
|
| 143 |
} |
|
| 144 |
|
|
| 145 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 146 |
|
|
| 147 |
float returnMultiplier() |
|
| 148 |
{
|
|
| 149 |
return 1.0f; |
|
| 150 |
} |
|
| 151 |
|
|
| 152 | 117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 153 | 118 |
|
| 154 | 119 |
float[][] getCuts(int numLayers) |
| ... | ... | |
| 156 | 121 |
return new float[][] { {-0.5f,+0.5f}, {0.0f}, {-0.5f,+0.5f} };
|
| 157 | 122 |
} |
| 158 | 123 |
|
| 159 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 160 |
|
|
| 161 |
int getColor(int face) |
|
| 162 |
{
|
|
| 163 |
return FACE_COLORS[face]; |
|
| 164 |
} |
|
| 165 |
|
|
| 166 | 124 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 167 | 125 |
// PUBLIC API |
| 168 | 126 |
|
Also available in: Unified diff
Introduce abstract 4,6,8 adn 12 classes.