Project

General

Profile

« Previous | Next » 

Revision 1ca2704b

Added by Leszek Koltunski over 2 years ago

Simplification.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
251 251
          };
252 252

  
253 253
    float[][] corners   = new float[][] { {0.036f,0.12f} };
254
    int[] cornerIndices = new int[] { 0,0,0,0,0,0,0,0 };
255 254
    float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
256
    int[] centerIndices = new int[] { 0,0,0,0,0,0,0,0 };
255
    int[] indices = new int[] { 0,0,0,0,0,0,0,0 };
257 256

  
258
    if( variant==0 )
259
      {
260
      float[][] bands   = new float[][] { {height,35,0.5f,0.7f,num,extraI,extraV} };
261
      int[] bandIndices = new int[] {0,0,0,0,0,0};
262
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
263
      }
264
    else if( variant==1 )
265
      {
266
      int extraI2 = numL<=3 ? num-2 : 0;
257
    int extraI2 = numL<=3 ? num-2 : 0;
267 258

  
268
      float[][] bands   = new float[][]
269
        {
270
          {height,35,0.5f,0.7f,num,extraI,extraV},
271
          {height,35,0.5f,0.7f,  2,extraI2,    0},
272
        };
259
    float[][] bands   = new float[][]
260
         {
261
             {height,35,0.5f,0.7f,num,extraI ,extraV},
262
             {height,35,0.5f,0.7f,  2,extraI2,     0},
263
             {height,35,0.5f,0.7f,  2,      0,     0},
264
         };
273 265

  
274
      int[] bandIndices = new int[] {1,1,1,0,1,0};
275
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
276
      }
277
    else
278
      {
279
      int extraI2 = numL<=3 ? num-2 : 0;
266
    int[] bandIndices;
280 267

  
281
      float[][] bands   = new float[][]
282
        {
283
          {height,35,0.5f,0.7f,num,extraI ,extraV},
284
          {height,35,0.5f,0.7f,  2,extraI2,     0},
285
          {height,35,0.5f,0.7f,  2,      0,     0},
286
        };
287
      int[] bandIndices = new int[] {1,1,1,1,0,2};
288
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
289
      }
268
         if( variant==0 ) bandIndices = new int[] {0,0,0,0,0,0};
269
    else if( variant==1 ) bandIndices = new int[] {1,1,1,0,1,0};
270
    else                  bandIndices = new int[] {1,1,1,1,0,2};
271

  
272
    return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,indices,centers,indices,getNumCubitFaces(), null);
290 273
    }
291 274

  
292 275
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff