Project

General

Profile

« Previous | Next » 

Revision f5c134c3

Added by Leszek Koltunski about 4 years ago

Fixes for the Rex Cube (still doesn't work)

View differences:

src/main/java/org/distorted/main/RubikPreRender.java
382 382
    final RubikScores scores = RubikScores.getInstance();
383 383
    int numWins = scores.incrementNumWins();
384 384

  
385
    if( numWins==8 || numWins==35 || numWins==100 || numWins==200)
385
    if( numWins==7 || numWins==30 || numWins==100 || numWins==200)
386 386
      {
387 387
      final long timeBegin = System.currentTimeMillis();
388 388
      final RubikActivity act = (RubikActivity)mView.getContext();
src/main/java/org/distorted/objects/FactoryCubit.java
1178 1178
    final float D = 0.5f - REX_D;
1179 1179
    final float F = H*D;
1180 1180

  
1181
    Static3D move  = new Static3D(0.0f, 0.5f - F, 0.0f);
1182
    Static3D center= new Static3D(0.0f, F, 0.0f);
1181
    Static3D move  = new Static3D(0.0f,   -F, 0.0f);
1182
    Static3D center= new Static3D(0.0f, 0.0f, 0.0f);
1183 1183
    Static3D axisX = new Static3D(1.0f, 0.0f, 0.0f);
1184 1184
    Static3D axisY = new Static3D(0.0f, 1.0f, 0.0f);
1185 1185

  
......
1188 1188

  
1189 1189
    VertexEffect[] effect = new VertexEffect[3];
1190 1190

  
1191
    effect[0] = new VertexEffectRotate(angle180, axisY, center);
1192
    effect[1] = new VertexEffectRotate(angle90 , axisX, center);
1193
    effect[2] = new VertexEffectMove(move);
1191
    effect[0] = new VertexEffectMove(move);
1192
    effect[1] = new VertexEffectRotate(angle180, axisY, center);
1193
    effect[2] = new VertexEffectRotate(angle90 , axisX, center);
1194 1194

  
1195
    effect[0].setMeshAssociation(10,-1);  // meshes 1 & 3
1196 1195
    effect[1].setMeshAssociation(10,-1);  // meshes 1 & 3
1196
    effect[2].setMeshAssociation(10,-1);  // meshes 1 & 3
1197 1197

  
1198 1198
    return effect;
1199 1199
    }
......
1202 1202

  
1203 1203
  VertexEffect[] createVertexEffectsRexCorner()
1204 1204
    {
1205
    float F = SQ3/6*(1.0f-2*REX_D);
1206
    Static3D move  = new Static3D(F,F,0.0f);
1207 1205
    Static3D center= new Static3D(0.0f, 0.0f, 0.0f);
1208 1206
    Static3D axisZ = new Static3D(0.0f, 0.0f, 1.0f);
1209 1207
    Static1D angle = new Static1D(45);
1210 1208

  
1211
    VertexEffect[] effect = new VertexEffect[2];
1212

  
1209
    VertexEffect[] effect = new VertexEffect[1];
1213 1210
    effect[0] = new VertexEffectRotate(angle, axisZ, center);
1214
    effect[1] = new VertexEffectMove(move);
1215 1211

  
1216 1212
    return effect;
1217 1213
    }
src/main/java/org/distorted/objects/TwistyRex.java
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);

Also available in: Unified diff