Project

General

Profile

« Previous | Next » 

Revision b5347187

Added by Leszek Koltunski about 3 years ago

Progress with any size Kilominx.

View differences:

src/main/java/org/distorted/objects/FactoryCubit.java
37 37

  
38 38
class FactoryCubit
39 39
  {
40
  static final float IVY_D = 0.003f;
41
  static final float IVY_C = 0.59f;
42
  static final float IVY_M = 0.35f;
43
  static final float REX_D = 0.2f;
44

  
45 40
  private static final float SQ2 = (float)Math.sqrt(2);
46 41
  private static final float SQ3 = (float)Math.sqrt(3);
47 42
  private static final float SQ5 = (float)Math.sqrt(5);
48 43
  private static final float SQ6 = (float)Math.sqrt(6);
49 44

  
45
  private static final Static1D RADIUS = new Static1D(1);
46
  private static FactoryCubit mThis;
47

  
48
  // IVY
49
  static final float IVY_D = 0.003f;
50
  static final float IVY_C = 0.59f;
51
  static final float IVY_M = 0.35f;
52
  private static final int IVY_N = 8;
53

  
54
  // REX
55
  static final float REX_D = 0.2f;
56

  
57
  // KILO / MEGAMINX
50 58
  static final float SIN54    = (SQ5+1)/4;
51 59
  static final float COS54    = (float)(Math.sqrt(10-2*SQ5)/4);
52 60
  static final float SIN18    = (SQ5-1)/4;
53 61
  static final float COS18    = (float)(0.25f*Math.sqrt(10.0f+2.0f*SQ5));
54 62
  static final float COS_HALFD= (float)(Math.sqrt(0.5f-0.1f*SQ5)); // cos(half the dihedral angle)
55 63
  static final float SIN_HALFD= (float)(Math.sqrt(0.5f+0.1f*SQ5)); // sin(half the dihedral angle)
56

  
57 64
  static final float DIHEDRAL1= (float)(Math.acos(-SQ5/5)*180/Math.PI);
58 65
  static final float DIHEDRAL2= (float)((180/Math.PI)*Math.asin((2*SIN54*SIN54-1)/COS54) - 90);
59

  
60 66
  static final float MINX_SC  = 0.5f;
61 67

  
62
  private static final int IVY_N = 8;
63

  
64
  private static final Static1D RADIUS = new Static1D(1);
65
  private static FactoryCubit mThis;
66

  
67 68
///////////////////////////////////////////////////////////////////////////////////////////////////
68 69

  
69 70
  private FactoryCubit()
......
1356 1357

  
1357 1358
  VertexEffect[] createVertexEffectsKilominxCenter(float width)
1358 1359
    {
1359
    VertexEffect[] effect = new VertexEffect[10];
1360
    VertexEffect[] effect = new VertexEffect[11];
1360 1361

  
1361 1362
    float H = 0.5f*(SIN54/COS54);
1362 1363
    float Y1= 0.5f*SIN_HALFD;
......
1391 1392
    effect[7] = new VertexEffectRotate(angle4, axisC, center);
1392 1393
    effect[8] = new VertexEffectRotate(angle5, axisC, center);
1393 1394
    effect[9] = new VertexEffectRotate(angle6, axisY, center);
1395
    effect[10]= new VertexEffectScale(width/0.5f);
1394 1396

  
1395 1397
    effect[0].setMeshAssociation( 7,-1);  // meshes 0,1,2
1396 1398
    effect[1].setMeshAssociation(56,-1);  // meshes 3,4,5

Also available in: Unified diff