Project

General

Profile

« Previous | Next » 

Revision e65095eb

Added by Leszek Koltunski 7 months ago

Ghost Floppy: jsons, mesh, everything works besides that it is too small in the app :)

View differences:

src/main/java/org/distorted/objectlib/metadata/MetadataGHFL_2.java
18 18
public class MetadataGHFL_2 extends Metadata
19 19
  {
20 20
  public static int INDEX = 99;
21
  public MetadataGHFL_2()         { super( TwistyGhostFloppy.class, new int[] {2,2,2,2,2}, 0, null, INDEX); }
21
  public MetadataGHFL_2()         { super( TwistyGhostFloppy.class, new int[] {2,2,2,2,2,1}, 0, null, INDEX); }
22 22
  public int numScrambles()       { return 12; }
23
  public int icon()               { return R.drawable.ghsk_2; }
23
  public int icon()               { return R.drawable.ghfl_2; }
24 24
  public int price()              { return 50; }
25
  public int extrasJson()         { return R.raw.ghsk_2_extras; }
26
  public int objectJson()         { return R.raw.ghsk_2_object; }
27
  public int mesh()               { return R.raw.ghsk_2; }
28
  public boolean getActive()      { return false; }
25
  public int extrasJson()         { return R.raw.ghfl_2_extras; }
26
  public int objectJson()         { return R.raw.ghfl_2_object; }
27
  public int mesh()               { return R.raw.ghfl_2; }
28
  public boolean getActive()      { return true; }
29 29
  public String getAuthor()       { return "Jack.S.N.Triton"; }
30 30
  public int getYearOfInvention() { return 2019; }
31 31
  public float getDifficulty()    { return 0.90f; }
src/main/java/org/distorted/objectlib/objects/TwistyGhostAbstract.java
306 306
    float[] tmp = new float[4];
307 307
    int numFaces= faceAxis.length;
308 308
    int numCuts = 0;
309
    for( float[] c : cuts ) numCuts += c.length;
309
    for( float[] c : cuts ) numCuts += (c==null? 0 : c.length);
310 310
    int[] rowState = getGhostRowState();
311 311
    int numPlanes = numFaces + numCuts;
312 312
    mCutPlanes  = new float[numL][numPlanes][];
......
326 326
    int index = numFaces;
327 327

  
328 328
    for(int r=0; r<rotAxis.length; r++)
329
      {
330
      Static3D ax = rotAxis[r];
331
      float x = ax.get0();
332
      float y = ax.get1();
333
      float z = ax.get2();
334

  
335
      for( float c : cuts[r] )
329
      if( cuts[r] !=null )
336 330
        {
337
        float[] plane = new float[] {x,y,z,c};
338
        for(int l=0; l<numL; l++) mCutPlanes[l][index] = plane;
339
        index++;
331
        Static3D ax = rotAxis[r];
332
        float x = ax.get0();
333
        float y = ax.get1();
334
        float z = ax.get2();
335

  
336
        for( float c : cuts[r] )
337
          {
338
          float[] plane = new float[] {x,y,z,c};
339
          for(int l=0; l<numL; l++) mCutPlanes[l][index] = plane;
340
          index++;
341
          }
340 342
        }
341
      }
342 343
    }
343 344

  
344 345
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objectlib/objects/TwistyGhostFloppy.java
36 36
                  new Static3D( SIN36, 0, COS36),
37 37
                  new Static3D(-SIN36, 0, COS36),
38 38
                  new Static3D(-SIN72, 0,-COS72),
39
                  new Static3D(     0, 1,     0)   // fake, non-rotatable. Only here so that the
40
                                                   // Shapemod TouchControl has some axis to disable
39 41
          };
40 42

  
41 43
  private float[][] mCuts;
......
68 70
  public boolean[][] getLayerRotatable()
69 71
    {
70 72
    boolean[] r = new boolean[] {false,true};
71
    return new boolean[][] {r,r,r,r,r};
73
    return new boolean[][] {r,r,r,r,r, new boolean[] {false} };
72 74
    }
73 75

  
74 76
///////////////////////////////////////////////////////////////////////////////////////////////////
......
76 78
  @Override
77 79
  public float[][] returnRotationFactor()
78 80
    {
79
    final float F = 1.5f;
81
    final float F = 2.0f;
80 82
    float[] f = new float[] { F,F };
81
    return new float[][] { f,f,f,f,f };
83
    return new float[][] { f,f,f,f,f,f };
82 84
    }
83 85

  
84 86
///////////////////////////////////////////////////////////////////////////////////////////////////
......
119 121

  
120 122
  float[][] getOriginalPositions()
121 123
    {
122
    int numAxis = ROT_AXIS.length;
124
    int numAxis = ROT_AXIS.length -1; // without the fake axis
123 125
    float[][] cuts = getCuts();
124 126
    float[][] positions = new float[1+2*numAxis][];
125 127

  
......
146 148
  Static4D getPlanesQuat()
147 149
    {
148 150
    Static3D axis1 = new Static3D(0,1,0);
149
    int angle1 = 0;
151
    int angle1 = 6;
150 152
    return makeQuat(axis1,angle1);
151 153
    }
152 154

  
......
159 161
      {
160 162
      float cut = 0.57f;
161 163
      int numAxis = ROT_AXIS.length;
162
      mCuts = new float[numAxis][1];
163
      for(int c=0; c<numAxis; c++) mCuts[c][0] = cut;
164
      mCuts = new float[numAxis][];
165
      for(int c=0; c<numAxis-1; c++) mCuts[c] = new float[] {cut};
164 166
      }
165 167

  
166 168
    return mCuts;
......
199 201
  public String[][] getTutorials()
200 202
    {
201 203
    return new String[][] {
202
                            {"gb","k37LPaEpDF8","Ghost Cube Tutorial","acpCubing"},
203
                            {"es","CGnePVg1Es0","Resolver Cubo Ghost 2X2","Cuby"},
204
                            {"pl","usyn8vzT9wo","Ghost 2x2 Cube Tutorial","MrUk"},
205
                            {"vn","v0-JQL-oFro","Hướng Dẫn Giải Ghost 2x2x2","Duy Thích Rubik"},
206
                            {"tw","pcJsft7w3mA","二階鬼魔方 教學","不正常魔術方塊研究中心"},
204
                            {"gb","TKf0-7Tdgo0","Floppy Ghost Cube","Brent Richter"},
205
                            {"es","XDxPuR-CDPI","Tutorial Floppy Ghost","Mastercubix"},
206
                            {"ru","v8gnDsrFycs","Как собрать Floppy Ghost","Кирилл Суханов"},
207
                            {"fr","r-2ezFkE_dU","Résolution du Floppy Ghost","asthalis"},
208
                            {"pl","8HK5p4wujQ8","Floppy Ghost Cube","MrUk"},
209
                            {"br","7qUe1_YKZX8","Floppy Ghost Cube","Cubo vício"},
210
                            {"tw","YFQidvLGCA0","Floppy Ghost Cube","不正常魔術方塊研究中心"},
207 211
                          };
208 212
    }
209 213
}

Also available in: Unified diff