Revision 8cccfb10
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/objects/Cubit.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import android.content.SharedPreferences; |
23 | 23 |
|
24 |
import org.distorted.library.effect.MatrixEffectQuaternion; |
|
25 |
import org.distorted.library.main.DistortedEffects; |
|
26 | 24 |
import org.distorted.library.type.Static3D; |
27 | 25 |
import org.distorted.library.type.Static4D; |
28 | 26 |
import org.distorted.main.RubikSurfaceView; |
... | ... | |
31 | 29 |
|
32 | 30 |
class Cubit |
33 | 31 |
{ |
34 |
private static final Static3D MATRIX_CENTER = new Static3D(0,0,0); |
|
35 |
|
|
36 | 32 |
private final Static3D mOrigPosition; |
37 | 33 |
|
38 | 34 |
private RubikObject mParent; |
39 | 35 |
private Static3D mCurrentPosition; |
40 | 36 |
private int mNumAxis; |
41 | 37 |
|
42 |
DistortedEffects mEffect; |
|
43 | 38 |
Static4D mQuatScramble; |
44 | 39 |
float[] mRotationRow; |
45 | 40 |
|
... | ... | |
60 | 55 |
mNumAxis = mParent.ROTATION_AXIS.length; |
61 | 56 |
mRotationRow = new float[mNumAxis]; |
62 | 57 |
computeRotationRow(); |
63 |
|
|
64 |
mEffect = new DistortedEffects(); |
|
65 |
mEffect.apply( new MatrixEffectQuaternion(mQuatScramble, MATRIX_CENTER)); |
|
66 | 58 |
} |
67 | 59 |
|
68 | 60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
180 | 172 |
{ |
181 | 173 |
row = (int)(mRotationRow[axis]+0.5f); |
182 | 174 |
result += (1<<(row+accumulativeShift)); |
183 |
accumulativeShift += RubikObjectList.MAX_SIZE; |
|
175 |
accumulativeShift += RubikObjectList.MAX_OBJECT_SIZE;
|
|
184 | 176 |
} |
185 | 177 |
|
186 | 178 |
return result; |
Also available in: Unified diff
More progreess porting RubikCube.