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/TwistyIvy.java
21 21
import org.distorted.objectlib.helpers.ObjectFaceShape;
22 22
import org.distorted.objectlib.helpers.ObjectSignature;
23 23
import org.distorted.objectlib.helpers.ObjectVertexEffects;
24
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
24 25
import org.distorted.objectlib.main.InitData;
25 26
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
26 27
import org.distorted.objectlib.main.ObjectType;
27 28
import org.distorted.objectlib.helpers.ObjectShape;
28
import org.distorted.objectlib.scrambling.ScrambleState;
29 29
import org.distorted.objectlib.shape.ShapeHexahedron;
30 30

  
31 31
///////////////////////////////////////////////////////////////////////////////////////////////////
......
43 43
  public static final float IVY_D = 0.006f;
44 44
  private static final int  IVY_N = 8;
45 45

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

  
75 75
///////////////////////////////////////////////////////////////////////////////////////////////////
76 76

  
77
  public ScrambleState[] getScrambleStates()
77
  public int[][] getScrambleEdges()
78 78
    {
79
    if( mStates==null )
80
      {
81
      int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 };
82

  
83
      mStates = new ScrambleState[]
84
        {
85
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
86
        };
87
      }
88

  
89
    return mStates;
79
    if( mEdges==null ) mEdges = ScrambleEdgeGenerator.getScrambleEdgesSingle(mBasicAngle);
80
    return mEdges;
90 81
    }
91 82

  
92 83
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff