36 |
36 |
import java.util.Random;
|
37 |
37 |
|
38 |
38 |
import static org.distorted.effects.scramble.ScrambleEffect.START_AXIS;
|
|
39 |
import static org.distorted.objects.FactoryCubit.REX_D;
|
39 |
40 |
|
40 |
41 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
41 |
42 |
|
... | ... | |
191 |
192 |
Static3D[] getCubitPositions(int numLayers)
|
192 |
193 |
{
|
193 |
194 |
final float DIST = 0.50f;
|
194 |
|
final float E = SQ3/3;
|
|
195 |
final float DIST2= SQ3/6*(1.0f-2*REX_D);
|
195 |
196 |
|
196 |
197 |
final Static3D[] CENTERS = new Static3D[42];
|
197 |
198 |
|
198 |
|
CENTERS[ 0] = new Static3D( +DIST , +DIST*E, +DIST*E);
|
199 |
|
CENTERS[ 1] = new Static3D( +DIST , +DIST*E, -DIST*E);
|
200 |
|
CENTERS[ 2] = new Static3D( +DIST , -DIST*E, -DIST*E);
|
201 |
|
CENTERS[ 3] = new Static3D( +DIST , -DIST*E, +DIST*E);
|
202 |
|
CENTERS[ 4] = new Static3D( -DIST , +DIST*E, +DIST*E);
|
203 |
|
CENTERS[ 5] = new Static3D( -DIST , +DIST*E, -DIST*E);
|
204 |
|
CENTERS[ 6] = new Static3D( -DIST , -DIST*E, -DIST*E);
|
205 |
|
CENTERS[ 7] = new Static3D( -DIST , -DIST*E, +DIST*E);
|
206 |
|
CENTERS[ 8] = new Static3D( +DIST*E, +DIST , +DIST*E);
|
207 |
|
CENTERS[ 9] = new Static3D( +DIST*E, +DIST , -DIST*E);
|
208 |
|
CENTERS[10] = new Static3D( -DIST*E, +DIST , -DIST*E);
|
209 |
|
CENTERS[11] = new Static3D( -DIST*E, +DIST , +DIST*E);
|
210 |
|
CENTERS[12] = new Static3D( +DIST*E, -DIST , +DIST*E);
|
211 |
|
CENTERS[13] = new Static3D( +DIST*E, -DIST , -DIST*E);
|
212 |
|
CENTERS[14] = new Static3D( -DIST*E, -DIST , -DIST*E);
|
213 |
|
CENTERS[15] = new Static3D( -DIST*E, -DIST , +DIST*E);
|
214 |
|
CENTERS[16] = new Static3D( +DIST*E, +DIST*E, +DIST );
|
215 |
|
CENTERS[17] = new Static3D( +DIST*E, -DIST*E, +DIST );
|
216 |
|
CENTERS[18] = new Static3D( -DIST*E, -DIST*E, +DIST );
|
217 |
|
CENTERS[19] = new Static3D( -DIST*E, +DIST*E, +DIST );
|
218 |
|
CENTERS[20] = new Static3D( +DIST*E, +DIST*E, -DIST );
|
219 |
|
CENTERS[21] = new Static3D( +DIST*E, -DIST*E, -DIST );
|
220 |
|
CENTERS[22] = new Static3D( -DIST*E, -DIST*E, -DIST );
|
221 |
|
CENTERS[23] = new Static3D( -DIST*E, +DIST*E, -DIST );
|
222 |
|
|
223 |
|
CENTERS[24] = new Static3D( +DIST , +0.00f , +0.00f );
|
224 |
|
CENTERS[25] = new Static3D( -DIST , +0.00f , +0.00f );
|
225 |
|
CENTERS[26] = new Static3D( +0.00f , +DIST , +0.00f );
|
226 |
|
CENTERS[27] = new Static3D( +0.00f , -DIST , +0.00f );
|
227 |
|
CENTERS[28] = new Static3D( +0.00f , +0.00f , +DIST );
|
228 |
|
CENTERS[29] = new Static3D( +0.00f , +0.00f , -DIST );
|
229 |
|
|
230 |
|
CENTERS[30] = new Static3D( +0.00f , +DIST , +DIST );
|
231 |
|
CENTERS[31] = new Static3D( +DIST , +0.00f , +DIST );
|
232 |
|
CENTERS[32] = new Static3D( +0.00f , -DIST , +DIST );
|
233 |
|
CENTERS[33] = new Static3D( -DIST , +0.00f , +DIST );
|
234 |
|
CENTERS[34] = new Static3D( +DIST , +DIST , +0.00f );
|
235 |
|
CENTERS[35] = new Static3D( +DIST , -DIST , +0.00f );
|
236 |
|
CENTERS[36] = new Static3D( -DIST , -DIST , +0.00f );
|
237 |
|
CENTERS[37] = new Static3D( -DIST , +DIST , +0.00f );
|
238 |
|
CENTERS[38] = new Static3D( +0.00f , +DIST , -DIST );
|
239 |
|
CENTERS[39] = new Static3D( +DIST , +0.00f , -DIST );
|
240 |
|
CENTERS[40] = new Static3D( +0.00f , -DIST , -DIST );
|
241 |
|
CENTERS[41] = new Static3D( -DIST , +0.00f , -DIST );
|
|
199 |
CENTERS[ 0] = new Static3D( +DIST , +DIST2, +DIST2);
|
|
200 |
CENTERS[ 1] = new Static3D( +DIST , +DIST2, -DIST2);
|
|
201 |
CENTERS[ 2] = new Static3D( +DIST , -DIST2, -DIST2);
|
|
202 |
CENTERS[ 3] = new Static3D( +DIST , -DIST2, +DIST2);
|
|
203 |
CENTERS[ 4] = new Static3D( -DIST , +DIST2, +DIST2);
|
|
204 |
CENTERS[ 5] = new Static3D( -DIST , +DIST2, -DIST2);
|
|
205 |
CENTERS[ 6] = new Static3D( -DIST , -DIST2, -DIST2);
|
|
206 |
CENTERS[ 7] = new Static3D( -DIST , -DIST2, +DIST2);
|
|
207 |
CENTERS[ 8] = new Static3D( +DIST2, +DIST , +DIST2);
|
|
208 |
CENTERS[ 9] = new Static3D( +DIST2, +DIST , -DIST2);
|
|
209 |
CENTERS[10] = new Static3D( -DIST2, +DIST , -DIST2);
|
|
210 |
CENTERS[11] = new Static3D( -DIST2, +DIST , +DIST2);
|
|
211 |
CENTERS[12] = new Static3D( +DIST2, -DIST , +DIST2);
|
|
212 |
CENTERS[13] = new Static3D( +DIST2, -DIST , -DIST2);
|
|
213 |
CENTERS[14] = new Static3D( -DIST2, -DIST , -DIST2);
|
|
214 |
CENTERS[15] = new Static3D( -DIST2, -DIST , +DIST2);
|
|
215 |
CENTERS[16] = new Static3D( +DIST2, +DIST2, +DIST );
|
|
216 |
CENTERS[17] = new Static3D( +DIST2, -DIST2, +DIST );
|
|
217 |
CENTERS[18] = new Static3D( -DIST2, -DIST2, +DIST );
|
|
218 |
CENTERS[19] = new Static3D( -DIST2, +DIST2, +DIST );
|
|
219 |
CENTERS[20] = new Static3D( +DIST2, +DIST2, -DIST );
|
|
220 |
CENTERS[21] = new Static3D( +DIST2, -DIST2, -DIST );
|
|
221 |
CENTERS[22] = new Static3D( -DIST2, -DIST2, -DIST );
|
|
222 |
CENTERS[23] = new Static3D( -DIST2, +DIST2, -DIST );
|
|
223 |
|
|
224 |
CENTERS[24] = new Static3D( +DIST , +0.00f, +0.00f);
|
|
225 |
CENTERS[25] = new Static3D( -DIST , +0.00f, +0.00f);
|
|
226 |
CENTERS[26] = new Static3D( +0.00f, +DIST , +0.00f);
|
|
227 |
CENTERS[27] = new Static3D( +0.00f, -DIST , +0.00f);
|
|
228 |
CENTERS[28] = new Static3D( +0.00f, +0.00f, +DIST );
|
|
229 |
CENTERS[29] = new Static3D( +0.00f, +0.00f, -DIST );
|
|
230 |
|
|
231 |
CENTERS[30] = new Static3D( +0.00f, +DIST , +DIST );
|
|
232 |
CENTERS[31] = new Static3D( +DIST , +0.00f, +DIST );
|
|
233 |
CENTERS[32] = new Static3D( +0.00f, -DIST , +DIST );
|
|
234 |
CENTERS[33] = new Static3D( -DIST , +0.00f, +DIST );
|
|
235 |
CENTERS[34] = new Static3D( +DIST , +DIST , +0.00f);
|
|
236 |
CENTERS[35] = new Static3D( +DIST , -DIST , +0.00f);
|
|
237 |
CENTERS[36] = new Static3D( -DIST , -DIST , +0.00f);
|
|
238 |
CENTERS[37] = new Static3D( -DIST , +DIST , +0.00f);
|
|
239 |
CENTERS[38] = new Static3D( +0.00f, +DIST , -DIST );
|
|
240 |
CENTERS[39] = new Static3D( +DIST , +0.00f, -DIST );
|
|
241 |
CENTERS[40] = new Static3D( +0.00f, -DIST , -DIST );
|
|
242 |
CENTERS[41] = new Static3D( -DIST , +0.00f, -DIST );
|
242 |
243 |
|
243 |
244 |
return CENTERS;
|
244 |
245 |
}
|
... | ... | |
316 |
317 |
{
|
317 |
318 |
MeshBase mesh;
|
318 |
319 |
|
319 |
|
if( cubit<12 )
|
|
320 |
if( cubit<24 )
|
320 |
321 |
{
|
321 |
322 |
if( mCornerMesh==null ) mCornerMesh = FactoryCubit.getInstance().createRexCornerMesh();
|
322 |
323 |
mesh = mCornerMesh.copy(true);
|
323 |
324 |
}
|
324 |
|
else if( cubit<18 )
|
|
325 |
else if( cubit<30 )
|
325 |
326 |
{
|
326 |
327 |
if( mFaceMesh==null ) mFaceMesh = FactoryCubit.getInstance().createRexFaceMesh();
|
327 |
328 |
mesh = mFaceMesh.copy(true);
|
Fixes for the Rex Cube (still doesn't work)