Revision 82e62580
Added by Leszek Koltunski about 2 years ago
src/main/java/org/distorted/objectlib/objects/TwistyWindmill.java | ||
---|---|---|
51 | 51 |
private ScrambleState[] mStates; |
52 | 52 |
private int[] mBasicAngle; |
53 | 53 |
private float[][] mCuts; |
54 |
private float[][] mCenters;
|
|
54 |
private float[][] mPositions;
|
|
55 | 55 |
private int[] mQuatIndex; |
56 | 56 |
|
57 | 57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
165 | 165 |
|
166 | 166 |
public float[][] getCubitPositions(int[] numLayers) |
167 | 167 |
{ |
168 |
if( mCenters==null )
|
|
168 |
if( mPositions==null )
|
|
169 | 169 |
{ |
170 | 170 |
final float DIS1 = -X/2 + 1.5f; |
171 | 171 |
final float DIS2 = -X/2; |
172 | 172 |
|
173 |
mCenters = new float[][]
|
|
173 |
mPositions = new float[][]
|
|
174 | 174 |
{ |
175 | 175 |
{ DIS1, 1.0f, 1.5f }, |
176 | 176 |
{ 1.5f, 1.0f,-DIS1 }, |
... | ... | |
203 | 203 |
}; |
204 | 204 |
} |
205 | 205 |
|
206 |
return mCenters;
|
|
206 |
return mPositions;
|
|
207 | 207 |
} |
208 | 208 |
|
209 | 209 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
210 | 210 |
|
211 | 211 |
public Static4D getCubitQuats(int cubit, int[] numLayers) |
212 | 212 |
{ |
213 |
int I0 =0; int I1 =6; int I2 =5; int I3 =4; |
|
214 |
if( mQuatIndex==null ) mQuatIndex = new int[] {I0,I1,I2,I3,I0,I1,I2,I3,I0,I1,I2,I3, I0,I1,I2,I3,I0,I1,I2,I3,I0,I1,I2,I3, 0,0 }; |
|
213 |
if( mQuatIndex==null ) mQuatIndex = new int[] { 0,6,5,4,0,6,5,4,0,6,5,4, |
|
214 |
0,6,5,4,0,6,5,4,0,6,5,4, |
|
215 |
0,0 }; |
|
215 | 216 |
return mObjectQuats[mQuatIndex[cubit]]; |
216 | 217 |
} |
217 | 218 |
|
Also available in: Unified diff
Progress with cubit quaternions.