Project

General

Profile

« Previous | Next » 

Revision 3ee1d662

Added by Leszek Koltunski over 2 years ago

Split ObjectShape into ObjectShape and ObjectFaceShape

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyJing.java
27 27
import org.distorted.library.type.Static3D;
28 28
import org.distorted.library.type.Static4D;
29 29

  
30
import org.distorted.objectlib.helpers.ObjectFaceShape;
30 31
import org.distorted.objectlib.touchcontrol.TouchControlTetrahedron;
31 32
import org.distorted.objectlib.main.ObjectControl;
32 33
import org.distorted.objectlib.main.ObjectType;
......
261 262
             {4,7,6,5}
262 263
          };
263 264

  
264
      float[][] bands     = new float[][] { {0.015f,35,0.25f*F,0.5f*F,5,1,1},{0.001f,35,0.25f*F,0.5f*F,5,1,1} };
265
      int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
266
      float[][] corners   = new float[][] { {0.08f,0.20f*F},{0.07f,0.20f*F} };
267
      int[] cornerIndices = new int[] { 0,1,1,-1,1,-1,-1,-1 };
268
      float[][] centers   = new float[][] { { 0.0f, Y, Z-F/2} };
269
      int[] centerIndices = new int[] { 0,0,0,-1,0,-1,-1,-1 };
270
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 3);
265
      return new ObjectShape(vertices,vert_indices,getNumCubitFaces(), 3);
271 266
      }
272 267
    else if( variant==1 )
273 268
      {
......
292 287
             {2,6,7,3}
293 288
          };
294 289

  
295
      float[][] bands     = new float[][] { {0.015f,35,0.5f*F,F,5,1,1},{0.001f,35,0.5f*F,F,5,1,1} };
296
      int[] bandIndices   = new int[] { 0,0,1,1,1,1 };
297
      float[][] corners   = new float[][] { {0.07f,0.20f*F} };
298
      int[] cornerIndices = new int[] { 0,0,-1,0,0,0,-1,0 };
299
      float[][] centers   = new float[][] { { 0, F*SQ2/2, 0 } };
300
      int[] centerIndices = new int[] { 0,0,-1,0,0,0,-1,0 };
301
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 2);
290
      return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),2);
302 291
      }
303 292
    else
304 293
      {
......
320 309
             {4,5,2,1}
321 310
          };
322 311

  
312
      return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),1);
313
      }
314
    }
315

  
316
///////////////////////////////////////////////////////////////////////////////////////////////////
317

  
318
  public ObjectFaceShape getObjectFaceShape(int variant)
319
    {
320
    final float Y = F*SQ2/2;
321
    final float Z =-F/2;
322
    final float L = (2.0f-3*F);
323

  
324
    if( variant==0 )
325
      {
326
      float[][] bands     = new float[][] { {0.015f,35,0.25f*F,0.5f*F,5,1,1},{0.001f,35,0.25f*F,0.5f*F,5,1,1} };
327
      int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
328
      float[][] corners   = new float[][] { {0.08f,0.20f*F},{0.07f,0.20f*F} };
329
      int[] cornerIndices = new int[] { 0,1,1,-1,1,-1,-1,-1 };
330
      float[][] centers   = new float[][] { { 0.0f, Y, Z-F/2} };
331
      int[] centerIndices = new int[] { 0,0,0,-1,0,-1,-1,-1 };
332
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
333
      }
334
    else if( variant==1 )
335
      {
336
      float[][] bands     = new float[][] { {0.015f,35,0.5f*F,F,5,1,1},{0.001f,35,0.5f*F,F,5,1,1} };
337
      int[] bandIndices   = new int[] { 0,0,1,1,1,1 };
338
      float[][] corners   = new float[][] { {0.07f,0.20f*F} };
339
      int[] cornerIndices = new int[] { 0,0,-1,0,0,0,-1,0 };
340
      float[][] centers   = new float[][] { { 0, F*SQ2/2, 0 } };
341
      int[] centerIndices = new int[] { 0,0,-1,0,0,0,-1,0 };
342
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
343
      }
344
    else
345
      {
323 346
      float[][] bands     = new float[][] { {0.020f,35,0.20f*L,0.6f*L,5,1,1}, {0.001f,35,0.05f*L,0.1f*L,5,1,1} };
324 347
      int[] bandIndices   = new int[] { 0,1,1,1,1,1 };
325 348
      float[][] corners   = new float[][] { {0.04f,0.6f*F} };
326 349
      int[] cornerIndices = new int[] { 0,0,0,-1,-1,-1 };
327 350
      float[][] centers   = new float[][] { { 0, -2*Y/3, 4*Z/3 } };
328 351
      int[] centerIndices = new int[] { 0,0,0,-1,-1,-1 };
329
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null, 1);
352
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
330 353
      }
331 354
    }
332 355

  

Also available in: Unified diff