Revision bb85236a
Added by Leszek Koltunski 11 months ago
src/main/java/org/distorted/objectlib/bandaged/FactoryBandagedPyraminx.java | ||
---|---|---|
142 | 142 |
// and 'size' is mNumLayers[0]-1 in case of Octahedrons and mNumLayers[0] in case of Tetrahedrons. |
143 | 143 |
// From the above, the below quickly follows. +20*num1 to avoid negative values. |
144 | 144 |
|
145 |
public static int getElementVariant(int size, float y) |
|
146 |
{ |
|
147 |
int num = (int)(2*SQ2*y + 20*size + 0.1f); |
|
148 |
return (num-size)%2; |
|
149 |
} |
|
150 |
|
|
151 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
152 |
|
|
145 | 153 |
public int getElementVariant(float x, float y, float z) |
146 | 154 |
{ |
147 |
int num1 = mNumLayers[0]; |
|
148 |
int num2 = (int)(2*SQ2*y + 20*num1 + 0.1f); |
|
149 |
return (num2-num1)%2; |
|
155 |
return getElementVariant(mNumLayers[0],y); |
|
150 | 156 |
} |
151 | 157 |
|
152 | 158 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Implement TwistyBandagedPyraminx