Project

General

Profile

« Previous | Next » 

Revision a57e6870

Added by Leszek Koltunski over 2 years ago

make numLayers into an int[] (preparation for Cuboids)
Caution: because of previous changes to cubit order in cube, the Solver is broken!

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyDino.java
72 72

  
73 73
///////////////////////////////////////////////////////////////////////////////////////////////////
74 74

  
75
  TwistyDino(int size, Static4D quat, Static3D move, DistortedTexture texture,
75
  TwistyDino(int[] numL, Static4D quat, Static3D move, DistortedTexture texture,
76 76
             MeshSquare mesh, DistortedEffects effects, Resources res, int scrWidth)
77 77
    {
78
    super(size, size, quat, move, texture, mesh, effects, res, scrWidth);
78
    super(numL, numL[0], quat, move, texture, mesh, effects, res, scrWidth);
79 79
    }
80 80

  
81 81
///////////////////////////////////////////////////////////////////////////////////////////////////
......
101 101

  
102 102
///////////////////////////////////////////////////////////////////////////////////////////////////
103 103

  
104
  protected int getResource(int numLayers)
104
  protected int getResource(int[] numLayers)
105 105
    {
106 106
    return R.raw.dino;
107 107
    }
......
116 116

  
117 117
///////////////////////////////////////////////////////////////////////////////////////////////////
118 118

  
119
  protected float[][] getCuts(int size)
119
  protected float[][] getCuts(int[] numLayers)
120 120
    {
121 121
    if( mCuts==null )
122 122
      {
......
129 129

  
130 130
///////////////////////////////////////////////////////////////////////////////////////////////////
131 131

  
132
  private void getLayerRotatable(int numLayers)
132
  private void getLayerRotatable(int[] numLayers)
133 133
    {
134 134
    if( mLayerRotatable==null )
135 135
      {
......
142 142

  
143 143
///////////////////////////////////////////////////////////////////////////////////////////////////
144 144

  
145
  protected int getNumStickerTypes(int numLayers)
145
  protected int getNumStickerTypes(int[] numLayers)
146 146
    {
147 147
    return 1;
148 148
    }
......
156 156

  
157 157
///////////////////////////////////////////////////////////////////////////////////////////////////
158 158

  
159
  protected float[][] getCubitPositions(int size)
159
  protected float[][] getCubitPositions(int[] numLayers)
160 160
    {
161 161
    if( mCenters ==null )
162 162
      {
......
182 182

  
183 183
///////////////////////////////////////////////////////////////////////////////////////////////////
184 184

  
185
  protected ObjectShape getObjectShape(int cubit, int numLayers)
185
  protected ObjectShape getObjectShape(int cubit, int[] numLayers)
186 186
    {
187 187
    double[][] vertices = new double[][] { {-1.5, 0.0, 0.0},{ 1.5, 0.0, 0.0},{ 0.0,-1.5, 0.0},{ 0.0, 0.0,-1.5} };
188 188
    int[][] vert_indices= new int[][] { {2,1,0},{3,0,1},{2,3,1},{3,2,0} };
......
197 197

  
198 198
///////////////////////////////////////////////////////////////////////////////////////////////////
199 199

  
200
  protected Static4D getQuat(int cubit, int numLayers)
200
  protected Static4D getQuat(int cubit, int[] numLayers)
201 201
    {
202 202
    if( mQuats==null ) initializeQuats();
203 203
    return mQuats[cubit];
......
205 205

  
206 206
///////////////////////////////////////////////////////////////////////////////////////////////////
207 207

  
208
  protected int getNumCubitVariants(int numLayers)
208
  protected int getNumCubitVariants(int[] numLayers)
209 209
    {
210 210
    return 1;
211 211
    }
212 212

  
213 213
///////////////////////////////////////////////////////////////////////////////////////////////////
214 214

  
215
  protected int getCubitVariant(int cubit, int numLayers)
215
  protected int getCubitVariant(int cubit, int[] numLayers)
216 216
    {
217 217
    return 0;
218 218
    }
......
254 254
    {
255 255
    if( mMovement==null )
256 256
      {
257
      int numLayers = getNumLayers();
257
      int[] numLayers = getNumLayers();
258 258
      if( mCuts==null ) getCuts(numLayers);
259 259
      getLayerRotatable(numLayers);
260
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,ENABLED);
260
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers[0],TYPE_SPLIT_CORNER,ENABLED);
261 261
      }
262 262
    return mMovement;
263 263
    }
......
272 272

  
273 273
///////////////////////////////////////////////////////////////////////////////////////////////////
274 274

  
275
  public int getComplexity(int numLayers)
275
  public int getComplexity(int[] numLayers)
276 276
    {
277 277
    return 2;
278 278
    }

Also available in: Unified diff