Project

General

Profile

« Previous | Next » 

Revision 9ba7f3f6

Added by Leszek Koltunski over 1 year ago

Move scrambling to a new model where there are spearete scrambling 'algorithms' and 'edges' of the scrambling graph.
Now each edge can contain a whole algorithm, i.e. a sequence of moves leading from state to state, which permits construction of scrambling for more complicated bandaged objects such as the AI cube.

Unchecked as of yet, probably still a lot of bugs.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyPyraminxDuo.java
19 19
import org.distorted.objectlib.helpers.ObjectShape;
20 20
import org.distorted.objectlib.helpers.ObjectSignature;
21 21
import org.distorted.objectlib.helpers.ObjectVertexEffects;
22
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
22 23
import org.distorted.objectlib.main.InitData;
23 24
import org.distorted.objectlib.main.ObjectType;
24 25
import org.distorted.objectlib.shape.ShapeTetrahedron;
25
import org.distorted.objectlib.scrambling.ScrambleState;
26 26
import org.distorted.objectlib.touchcontrol.TouchControlTetrahedron;
27 27

  
28 28
import java.io.InputStream;
......
43 43
                                         // C - corner of the triangular face cubit. Then C = A + F(B-A)
44 44
  private static final float G = 0.02f;  // this defines the gap between two corner cubits. 0.0 -> no gap.
45 45

  
46
  private ScrambleState[] mStates;
46
  private int[][] mEdges;
47 47
  private int[][] mBasicAngle;
48 48
  private int[] mQuatIndex;
49 49
  private float[][] mCuts;
......
58 58

  
59 59
///////////////////////////////////////////////////////////////////////////////////////////////////
60 60

  
61
  public ScrambleState[] getScrambleStates()
61
  public int[][] getScrambleEdges()
62 62
    {
63
    if( mStates==null )
64
      {
65
      int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 };
66

  
67
      mStates = new ScrambleState[]
68
        {
69
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
70
        };
71
      }
72

  
73
    return mStates;
63
    if( mEdges==null ) mEdges = ScrambleEdgeGenerator.getScrambleEdgesSingle(mBasicAngle);
64
    return mEdges;
74 65
    }
75 66

  
76 67
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff