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/TwistyRex.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
///////////////////////////////////////////////////////////////////////////////////////////////////
......
42 42

  
43 43
  public static final float REX_D = 0.2f;
44 44

  
45
  private ScrambleState[] mStates;
45
  private int[][] mEdges;
46 46
  private int[][] mBasicAngle;
47 47
  private float[][] mCuts;
48 48
  private float[][] mPosition;
......
70 70

  
71 71
///////////////////////////////////////////////////////////////////////////////////////////////////
72 72

  
73
  public ScrambleState[] getScrambleStates()
73
  public int[][] getScrambleEdges()
74 74
    {
75
    if( mStates==null )
76
      {
77
      int[] tmp = {0,-1,0, 0,1,0, 2,-1,0, 2,1,0 };
78

  
79
      mStates = new ScrambleState[]
80
        {
81
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
82
        };
83
      }
84

  
85
    return mStates;
75
    if( mEdges==null ) mEdges = ScrambleEdgeGenerator.getScrambleEdgesSingle(mBasicAngle);
76
    return mEdges;
86 77
    }
87 78

  
88 79
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff