Project

General

Profile

« Previous | Next » 

Revision 0431e308

Added by Leszek Koltunski over 1 year ago

Progress with Penrose - debugging solved state.

View differences:

src/main/java/org/distorted/objectlib/main/TwistyObject.java
1340 1340
    boolean error = false;
1341 1341
    String key = getShortName();
1342 1342

  
1343
    int[] qu =
1344
      {
1345
      0,0,
1346
      0,0,0,0,0,0,
1347
      0,0,0,
1348
      0,0,0,0,0,0,0,0,0,
1349
      0,0,0,0,0,0
1350
      };
1351

  
1352
    android.util.Log.e("D", "RESTORING PREFERENCES");
1353

  
1343 1354
    for(int i=0; i<mNumCubits; i++)
1344 1355
      {
1345
      mQuatDebug[i] = mCubits[i].restorePreferences(key,os);
1356
      mQuatDebug[i] = i<qu.length ? qu[i] : mCubits[i].restorePreferences(key,os);
1346 1357

  
1347 1358
      if( mQuatDebug[i]>=0 && mQuatDebug[i]<mNumQuats )
1348 1359
        {
src/main/java/org/distorted/objectlib/metadata/MetadataCU_242.java
20 20
  public MetadataCU_242()         { super( TwistyCuboid.class, new int[] {2,4,2}, 0, null, INDEX ); }
21 21
  public int numScrambles()       { return 21; }
22 22
  public int icon()               { return R.drawable.cu_242; }
23
  public boolean getActive()      { return false; }
23
 // public boolean getActive()      { return false; }
24 24
  public int price()              { return 40; }
25 25
  public int extrasJson()         { return R.raw.cu_242_extras; }
26 26
  public int objectJson()         { return R.raw.cu_242_object; }
src/main/java/org/distorted/objectlib/metadata/MetadataCU_424.java
20 20
  public MetadataCU_424()         { super( TwistyCuboid.class, new int[] {4,2,4}, 0, null, INDEX ); }
21 21
  public int numScrambles()       { return 27; }
22 22
  public int icon()               { return R.drawable.cu_424; }
23
  public boolean getActive()      { return false; }
23
  //public boolean getActive()      { return false; }
24 24
  public int price()              { return 40; }
25 25
  public int extrasJson()         { return R.raw.cu_424_extras; }
26 26
  public int objectJson()         { return R.raw.cu_424_object; }
src/main/java/org/distorted/objectlib/metadata/MetadataCU_432.java
20 20
  public MetadataCU_432()         { super( TwistyCuboid.class, new int[] {4,3,2}, 0, null, INDEX ); }
21 21
  public int numScrambles()       { return 35; }
22 22
  public int icon()               { return R.drawable.cu_432; }
23
  public boolean getActive()      { return false; }
23
 // public boolean getActive()      { return false; }
24 24
  public int price()              { return 40; }
25 25
  public int extrasJson()         { return R.raw.cu_432_extras; }
26 26
  public int objectJson()         { return R.raw.cu_432_object; }
src/main/java/org/distorted/objectlib/metadata/MetadataMJIN_3.java
21 21
  public MetadataMJIN_3()         { super( TwistyMirrorJing.class, new int[] {2,2,2,2}, 0, null, INDEX ); }
22 22
  public int numScrambles()       { return 11; }
23 23
  public int icon()               { return R.drawable.mjin_2; }
24
  public boolean getActive()      { return false; }
24
 // public boolean getActive()      { return false; }
25 25
  public int price()              { return 30; }
26 26
  public int extrasJson()         { return 0; }
27 27
  public int objectJson()         { return R.raw.mjin_2_object; }
src/main/java/org/distorted/objectlib/metadata/MetadataMPYR_3.java
21 21
  public MetadataMPYR_3()         { super( TwistyMirrorPyraminx.class, new int[] {3,3,3,3}, 0, null, INDEX); }
22 22
  public int numScrambles()       { return 11; }
23 23
  public int icon()               { return R.drawable.mpyr_3; }
24
  public boolean getActive()      { return false; }
24
 // public boolean getActive()      { return false; }
25 25
  public int price()              { return 30; }
26 26
  public int extrasJson()         { return 0; }
27 27
  public int objectJson()         { return R.raw.mpyr_3_object; }
src/main/java/org/distorted/objectlib/metadata/MetadataMSKE_2.java
21 21
  public MetadataMSKE_2()         { super( TwistyMirrorSkewb.class, new int[] {2,2,2,2}, 0, null, INDEX ); }
22 22
  public int numScrambles()       { return 11; }
23 23
  public int icon()               { return R.drawable.mske_2; }
24
  public boolean getActive()      { return false; }
24
 // public boolean getActive()      { return false; }
25 25
  public int price()              { return 30; }
26 26
  public int extrasJson()         { return 0; }
27 27
  public int objectJson()         { return R.raw.mske_2_object; }
src/main/java/org/distorted/objectlib/objects/TwistyPenrose.java
12 12
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_CHANGING_MIRROR;
13 13
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
14 14

  
15
import org.distorted.library.effect.EffectName;
16
import org.distorted.library.helpers.QuatHelper;
15 17
import org.distorted.library.type.Static3D;
16 18
import org.distorted.library.type.Static4D;
17 19
import org.distorted.objectlib.helpers.FactoryCubit;
......
29 31

  
30 32
public class TwistyPenrose extends ShapeHexahedron
31 33
{
32
  private static final int N = 8; // has to be >=3
33

  
34 34
  static final Static3D[] ROT_AXIS = new Static3D[]
35 35
         {
36 36
           new Static3D(1,0,0),
......
43 43
  private float[][] mCuts;
44 44
  private int[] mQuatIndex;
45 45
  private int[][] mFaceMap;
46
  private int[][] mQuatDivided;
46 47

  
47 48
///////////////////////////////////////////////////////////////////////////////////////////////////
48 49

  
49 50
  public TwistyPenrose(int iconMode, Static4D quat, Static3D move, float scale, Metadata meta, InitAssets asset)
50 51
    {
51 52
    super(iconMode, meta.getNumLayers()[0], quat, move, scale, meta, asset);
52

  
53
    FactoryCubit f = FactoryCubit.getInstance();
54
    f.printStickerCoords();
55 53
    }
56 54

  
57 55
///////////////////////////////////////////////////////////////////////////////////////////////////
56
// { -0.5f, -0.49999997f, 0.5f, -0.49999997f, 0.5f, 0.49999997f, -0.5f, 0.49999997f}
57
// { -0.24999999f, 0.5f, -0.24999999f, -0.24999999f, 0.5f, -0.24999999f}
58
// { -0.5f, -0.08578644f, -0.08578644f, -0.49999997f, 0.5f, 0.08578644f, 0.085786454f, 0.5f}
58 59

  
59
  @Override
60
  public int getInternalColor()
61
    {
62
    return 0xff222222;
63
    }
64

  
65
///////////////////////////////////////////////////////////////////////////////////////////////////
66
/*
67
{ -0.5f, -0.49999997f, 0.5f, -0.49999997f, 0.5f, 0.49999997f, -0.5f, 0.49999997f}
68
{ -0.49659738f, 0.46088853f, -0.49659738f, -0.5f, 0.4642912f, -0.5f, 0.42613786f, -0.23192067f, 0.28489703f, 0.05908255f, 0.05509505f, 0.28672886f, -0.23722643f, 0.42522076f}
69
{ -0.4642912f, -0.5f, 0.49659738f, -0.5f, 0.49659738f, 0.46088853f, 0.23722643f, 0.42522076f, -0.05509505f, 0.28672886f, -0.28489703f, 0.05908255f, -0.42613786f, -0.23192067f}
70
{ -0.5f, -0.06705149f, 0.46144003f, -0.20388463f, 0.5f, 0.06705155f, -0.46144003f, 0.20388466f}
71
{ -0.5f, 0.06391828f, 0.35955805f, -0.3532754f, 0.49999994f, -0.06391831f, -0.35955808f, 0.3532754f}
72
{ -0.19758901f, 0.46388432f, -0.0650391f, -0.5f, 0.19758904f, -0.46388432f, 0.06503913f, 0.5f}
73
*/
74

  
75
/*
76
{ -0.5f, -0.49999997f, 0.5f, -0.49999997f, 0.5f, 0.49999997f, -0.5f, 0.49999997f}
77
{ -0.49759144f, 0.39903626f, -0.49759144f, -0.5f, 0.40144485f, -0.5f, 0.38744375f, -0.34195277f, 0.33711463f, -0.1660358f, 0.25221044f, -0.0039522364f, 0.13624811f, 0.13758421f, -0.0059688925f, 0.25271076f, -0.16854979f, 0.33665872f, -0.34476027f, 0.3859508f}
78
{ -0.40144485f, -0.5f, 0.49759144f, -0.5f, 0.49759144f, 0.39903626f, 0.34476027f, 0.3859508f, 0.16854979f, 0.33665872f, 0.0059688925f, 0.25271076f, -0.13624811f, 0.13758421f, -0.25221044f, -0.0039522364f, -0.33711463f, -0.1660358f, -0.38744375f, -0.34195277f}
79
{ -0.5f, -0.0432719f, 0.48460624f, -0.13049613f, 0.49999994f, 0.043271806f, -0.48460624f, 0.13049607f}
80
{ -0.5f, 0.03901463f, 0.44497663f, -0.23133945f, 0.5f, -0.0390146f, -0.44497663f, 0.23133945f}
81
{ -0.12627374f, 0.4856021f, -0.04188615f, -0.5f, 0.1262737f, -0.4856021f, 0.04188612f, 0.5f}
82

  
83
 */
84 60
  @Override
85 61
  public void adjustStickerCoords()
86 62
    {
87
    /* N=5
88
    final float A = 0.50f;
89
    final float B = 0.49659738f;
90
    final float C = 0.4642912f;
91
    final float D = 0.06705149f;
92
    final float E = 0.20388463f;
93
    final float F = 0.35955805f;
94
    final float G = 0.19758901f;
95
    */
96

  
97
    // N=8
98 63
    final float A = 0.50f;
99
    final float B = 0.4975f;
100
    final float C = 0.40f;
101
    final float D = 0.0432f;
102
    final float H = 0.4846f;
103
    final float I = 0.1305f;
104
    final float J = 0.0390f;
105
    final float K = 0.4449f;
106
    final float L = 0.23134f;
107
    final float M = 0.12627f;
108
    final float O = 0.04188f;
64
    final float B = 0.25f;
65
    final float C = 0.08578644f;
66
    final float D = 0.23f;
67

  
68
    final float E = (A+D)/5;
69
    final float F = 0.005f;
70
    final float G = (A+D)/2;
71
    final float H = 0.002f;
109 72

  
110 73
    mStickerCoords = new float[][][][]
111 74
          {
112 75
            { { {-A,-A},{ A,-A},{ A, A},{-A, A} } },
113
            { { {-C,-A},{ B,-A},{ B, C} } },
114
            { { {-A,-D},{ H,-I},{ A, D},{-H, I} } },
115
            { { {-A, J},{ K,-L},{ A,-J},{-K, L} } },
116
            { { {-M, H},{-O,-A},{ M,-H},{ O, A} } },
76
            { { {-B, A},{-B,-B},{ A,-B},{ A,-D},{A-E+F,-D+E+F},{A-2*E,-D+2*E},{A-G+H,-D+G+H},{-D+2*E,A-2*E},{-D+E+F,A-E+F},{-D, A} } },
77
            { { {-A,-C},{-C,-A},{ A, C},{ C, A} } }
117 78
          };
118 79
    }
119 80

  
......
123 84
  protected float[][][] getStickerRadii()
124 85
    {
125 86
    float R = getStickerRadius();
87
    float R2 = 1.3f*R;
126 88

  
127 89
    return new float[][][]
128 90
      {
129 91
        { { R, R, R, R } },
130
        { { R, R, R } },
131
        { { R, R, 0, 0 } },
132
        { { 0, 0, 0, 0 } },
133
        { { 0, 0, R, R } },
92
        { { R2, R, R2, 0, 0,0,0,0,0, 0 } },
93
        { { R, R, R, R } },
134 94
      };
135 95
    }
136 96

  
97
///////////////////////////////////////////////////////////////////////////////////////////////////
98
// remember about the double cover or unit quaternions!
99

  
100
  private int mulQuat(int q1, int q2)
101
    {
102
    Static4D result = QuatHelper.quatMultiply(mObjectQuats[q1],mObjectQuats[q2]);
103
    return findQuatIndex(result);
104
    }
105

  
106
///////////////////////////////////////////////////////////////////////////////////////////////////
107
// remember about the double cover or unit quaternions!
108

  
109
  private int findQuatIndex(Static4D quat)
110
    {
111
    int numQ = mObjectQuats.length;
112

  
113
    float rX = quat.get0();
114
    float rY = quat.get1();
115
    float rZ = quat.get2();
116
    float rW = quat.get3();
117

  
118
    final float MAX_ERROR = 0.1f;
119
    float dX,dY,dZ,dW;
120

  
121
    for(int i=0; i<numQ; i++)
122
      {
123
      dX = mObjectQuats[i].get0() - rX;
124
      dY = mObjectQuats[i].get1() - rY;
125
      dZ = mObjectQuats[i].get2() - rZ;
126
      dW = mObjectQuats[i].get3() - rW;
127

  
128
      if( dX<MAX_ERROR && dX>-MAX_ERROR &&
129
          dY<MAX_ERROR && dY>-MAX_ERROR &&
130
          dZ<MAX_ERROR && dZ>-MAX_ERROR &&
131
          dW<MAX_ERROR && dW>-MAX_ERROR  ) return i;
132

  
133
      dX = mObjectQuats[i].get0() + rX;
134
      dY = mObjectQuats[i].get1() + rY;
135
      dZ = mObjectQuats[i].get2() + rZ;
136
      dW = mObjectQuats[i].get3() + rW;
137

  
138
      if( dX<MAX_ERROR && dX>-MAX_ERROR &&
139
          dY<MAX_ERROR && dY>-MAX_ERROR &&
140
          dZ<MAX_ERROR && dZ>-MAX_ERROR &&
141
          dW<MAX_ERROR && dW>-MAX_ERROR  ) return i;
142
      }
143

  
144
    return -1;
145
    }
146

  
147
///////////////////////////////////////////////////////////////////////////////////////////////////
148
// QDivided[i][j] = ObjectQ[i]/ObjectQ[j] -> QDivided[i][j] * ObjectQ[j] = ObjectQ[i]
149

  
150
  private void createQuatDivided()
151
    {
152
    int numQ = mObjectQuats.length;
153

  
154
    mQuatDivided = new int[numQ][numQ];
155

  
156
    for(int i=0; i<numQ; i++)
157
      for(int j=0; j<numQ; j++) mQuatDivided[i][j] = -3;
158

  
159
    for(int i=0; i<numQ; i++)
160
      for(int j=0; j<numQ; j++)
161
        {
162
        int q = mulQuat(i,j);
163
        mQuatDivided[q][j] = i;
164
        }
165

  
166
    for(int i=0; i<numQ; i++)
167
      for(int j=0; j<numQ; j++)
168
        if( mQuatDivided[i][j] == -3 )
169
          android.util.Log.e("D", "quat divided: "+i+" "+j);
170
    }
171

  
137 172
///////////////////////////////////////////////////////////////////////////////////////////////////
138 173

  
139 174
  @Override
140
  protected float[][][] getStickerStrokes()
175
  public int[][] getSolvedQuats()
141 176
    {
142
    float S = getStickerStroke();
177
    if( mQuatDivided==null ) createQuatDivided();
143 178

  
144
    return new float[][][]
179
    int[][] ret =  new int[][]
145 180
      {
146
        { { S, S, S, S } },
147
        { { S, S, S } },
148
        { { S, S, S, 0 } },
149
        { { S, 0, S, 0 } },
150
        { { S, 0, S, S } },
181
              { 1, 12, mQuatDivided[15][12], mQuatDivided[17][12] },  // triplet of full edges 12<-->15<-->17
182
              { 1, 15, mQuatDivided[12][15], mQuatDivided[17][15] },
183
              { 1, 17, mQuatDivided[12][17], mQuatDivided[15][17] },
184
              { 1, 13, mQuatDivided[16][13], mQuatDivided[19][13] },  // triplet of full edges 13<-->16<-->19
185
              { 1, 16, mQuatDivided[13][16], mQuatDivided[19][16] },
186
              { 1, 19, mQuatDivided[13][19], mQuatDivided[16][19] },
187
              { 1, 11, mQuatDivided[14][11], mQuatDivided[18][11] },  // triplet of full edges 11<-->14<-->18
188
              { 1, 14, mQuatDivided[11][14], mQuatDivided[18][14] },
189
              { 1, 18, mQuatDivided[11][18], mQuatDivided[14][18] },
190

  
191
              { 1, 20, 1, 2, 3 },  // +X center; in-face rotations.
192
              { 1, 21, 1, 2, 3 },  // -X center
193
              { 1, 22, 4, 5, 6 },  // +Y center
194
              { 1, 23, 4, 5, 6 },  // -Y center
195
              { 1, 24, 7, 8, 9 },  // +Z center
196
              { 1, 25, 7, 8, 9 }   // -Z center
151 197
      };
198

  
199
    StringBuilder sb = new StringBuilder();
200
    int l = ret.length;
201
    sb.append("SOLVED QUATS");
202

  
203
    for(int i=0; i<l; i++)
204
      {
205
      sb.append("\ngroup ");
206
      sb.append(i);
207
      sb.append(" : ");
208

  
209
      for( int s : ret[i] )
210
        {
211
        sb.append(' ');
212
        sb.append(s);
213
        }
214
      }
215

  
216
    android.util.Log.e("D", sb.toString() );
217

  
218
    return ret;
152 219
    }
153 220

  
154 221
///////////////////////////////////////////////////////////////////////////////////////////////////
......
159 226
    {
160 227
    if( mFaceMap==null )
161 228
      {
162
      int C1 = 0;
163
      int C2 = 2;
164
      int C3 = 4;
229
      final int C1 = 1;
230
      final int C2 = 2;
231
      final int C3 = 4;
165 232

  
166 233
      mFaceMap = new int[][]
167 234
         {
168 235
                 {-1,C2,-1,C1,-1,C3},
169 236
                 {-1,C1,-1,C2,-1,C3},
170 237

  
171
                 {-1,C1,-1,-1,C2},
172
                 {-1,C3,-1,-1,C2},
173
                 {-1,C2,-1,-1,C3},
174
                 {-1,C2,-1,-1,C1},
175
                 {-1,C3,-1,-1,C1},
176
                 {-1,C1,-1,-1,C3},
238
                 {-1,C1,C2,-1,-1,-1},
239
                 {-1,C3,C2,-1,-1,-1},
240
                 {-1,C2,C3,-1,-1,-1},
241
                 {-1,C2,C1,-1,-1,-1},
242
                 {-1,C3,C1,-1,-1,-1},
243
                 {-1,C1,C3,-1,-1,-1},
177 244

  
178
                 {-1,-1,-1,-1,C3},
179
                 {-1,-1,-1,-1,C1},
180
                 {-1,-1,-1,-1,C2},
245
                 {-1,-1,C3,-1,-1,-1},
246
                 {-1,-1,C1,-1,-1,-1},
247
                 {-1,-1,C2,-1,-1,-1},
181 248

  
182 249
                 {-1,-1,-1,C2,-1,C1},
183 250
                 {-1,-1,-1,C3,-1,C2},
......
198 265
         };
199 266
      }
200 267

  
201
    if( cubit>=2 && cubit<=10 )
202
      {
203
      if( face>4 ) return mFaceMap[cubit][4];
204
      }
205
    else
206
      {
207
      if( face>5 ) return -1;
208
      }
209

  
210 268
    return mFaceMap[cubit][face];
211 269
    }
212 270

  
......
377 435
    {
378 436
    if( variant==1 || variant==2 )
379 437
      {
380
      float[][] ret = new float[4+2*N][];
381
      ret[0] = new float[] {-0.5f,-0.5f,-0.5f };
382
      ret[1] = new float[] {+0.5f,-0.5f,-0.5f };
383
      ret[2] = new float[] {+0.5f,+0.5f,-0.5f };
384
      ret[3] = new float[] {-0.5f,-0.5f,+0.5f };
385
      ret[4] = new float[] {+0.5f,-0.5f,+0.5f };
386
      ret[5] = new float[] {+0.5f,+0.5f,+0.5f };
387

  
388
      final float PIH = (float)Math.PI/2;
389
      final float P = 0.90f;           // in order to avoid collapsing all of those into one sticker,
390
      final float O = 0.87f;           // we need to make the first and last a bit different size
391
      final float K = (N-(P+O))/(N-2); // (the middles can collapse, they all have the same strokes)
392
                                       // now P + K+K+..+K + O = N   (K is repeated N-2 times)
393
      float segment = P;
394

  
395
      for(int v=6; v<4+2*N; v++)
396
        {
397
        boolean even = (v%2==0);
398
        float alpha = segment*PIH/N;
399
        if( !even ) segment += K;
400
        float x = 0.5f - (float)Math.cos(alpha);
401
        float y = (float)Math.sin(alpha) - 0.5f;
402
        float z = even ? -0.5f : 0.5f;
403

  
404
        ret[v] = new float[] { x,y,z };
405
        }
406

  
407
      return ret;
438
      return new float[][]
439
          {
440
              {-0.5f,-0.5f,-0.5f },
441
              {+0.5f,-0.5f,-0.5f },
442
              {+0.5f,+0.5f,-0.5f },
443
              {-0.5f,-0.5f,+0.5f },
444
              {+0.5f,-0.5f,+0.5f },
445
              {+0.5f,+0.5f,+0.5f },
446
          };
408 447
      }
409 448
    else
410 449
      {
......
428 467
    {
429 468
    if( variant==1 || variant==2 )
430 469
      {
431
      int[][] indices = new int[4+N][];
432

  
433
      indices[0] = new int[N+2];
434
      indices[0][0] = 2;
435
      indices[0][1] = 1;
436
      indices[0][2] = 0;
437
      for(int v=3; v<N+2; v++) indices[0][v] = 2*v;
438

  
439
      indices[1] = new int[N+2];
440
      indices[1][0] = 3;
441
      indices[1][1] = 4;
442
      indices[1][2] = 5;
443
      for(int v=3; v<N+2; v++) indices[1][v] = 2*N-2*v+9;
444

  
445
      indices[2] = new int[] {0,1,4,3};
446
      indices[3] = new int[] {5,4,1,2};
447
      indices[4] = new int[] {0,3,7,6};
448

  
449
      for(int f=5; f<3+N; f++) indices[f] = new int[] { 2*f-4, 2*f-3, 2*f-1, 2*f-2 };
450

  
451
      indices[3+N] = new int[] { 2*N+2, 2*N+3, 5, 2 };
470
      int[][] indices =
471
          {
472
              {2,1,0},
473
              {3,4,5},
474
              {0,3,5,2},
475
              {0,1,4,3},
476
              {5,4,1,2}
477
          };
452 478

  
453 479
      return new ObjectShape(getVertices(variant), indices);
454 480
      }
......
487 513
    int angle = 35;
488 514
    float R = 0.5f;
489 515
    float S = 0.7f;
490
    int[] bandIndices = null;
491 516

  
492 517
    float[][] bands  =
493 518
         {
494 519
             {    h1,angle,R,S,n1,extraI,extraV},
495 520
             {0.001f,angle,R,S, 2,  n1-2,extraV},
496
             {0.000f,angle,R,S, 2,     0,     0},
521
             {0.001f,angle,R,S, 2,     0,     0},
497 522
             {0.001f,angle,R,S,n1,extraI,extraV},
498 523
             {    h2,angle,R,S,n2,extraI,extraV},
524
             {0.001f,angle,R,S,n2,extraI,extraV},
499 525
         };
500 526

  
501 527
    switch(variant)
502 528
      {
503
      case 0: bandIndices = new int[] {3,0,3,0,3,0}; break;
504
      case 1:
505
      case 2: bandIndices = new int[4+N];
506
              bandIndices[0] = bandIndices[1] = 4;
507
              bandIndices[2] = bandIndices[3] = 3;
508
              for(int i=4; i<4+N; i++) bandIndices[i] = 2;
509
              break;
510
      case 3: bandIndices = new int[] {1,1,1,0,1,0}; break;
511
      case 4: bandIndices = new int[] {2,2,2,2,0,2}; break;
529
      case 0: return new ObjectFaceShape(bands,new int[] {3,0,3,0,3,0},null);
530
      case 1: return new ObjectFaceShape(bands,new int[] { 5,4,4,5,5 },null);
531
      case 2: return new ObjectFaceShape(bands,new int[] { 5,5,4,5,5 },null);
532
      case 3: return new ObjectFaceShape(bands,new int[] {1,1,1,0,1,0},null);
533
      case 4: return new ObjectFaceShape(bands,new int[] {2,2,2,2,0,2},null);
512 534
      }
513 535

  
514
    return new ObjectFaceShape(bands,bandIndices,null);
536
    return null;
515 537
    }
516 538

  
517 539
///////////////////////////////////////////////////////////////////////////////////////////////////
......
521 543
    float[][] corners= { {0.030f,0.12f} };
522 544
    float[][] centers= { {0.0f, 0.0f, 0.0f} };
523 545
    float[][] vertices= getVertices(variant);
524
    int[] indices;
525 546

  
526
    if ( variant<1 || variant>2 )
547
    if( variant==1 || variant==2 )
527 548
      {
528
      indices = new int[] { 0,0,0,0,0,0,0,0 };
549
      int[] indices = { 0,0,0,0,0,0 };
550
      ObjectVertexEffects effects = FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
551
      String n = EffectName.PIPE.name();
552
      float[] v = {0.5f,0,0,1,0.92f};
553
      float[] c = {-0.5f,0.5f,0.0f};
554
      float[] r = {0,0,0,0};
555
      effects.joinEffect(n,v,c,r,true);
556
      return effects;
529 557
      }
530 558
    else
531 559
      {
532
      indices = new int[4+2*N];
533
      indices[0] = indices[2] = indices[3] = indices[5] = 0;
534
      indices[1] = indices[4] = -1;
535
      for(int v=6; v<4+2*N; v++) indices[v] = -1;
560
      int[] indices = { 0,0,0,0,0,0,0,0 };
561
      return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
536 562
      }
537

  
538
    return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
539 563
    }
540 564

  
541 565
///////////////////////////////////////////////////////////////////////////////////////////////////
......
575 599

  
576 600
  public float[][][] getStickerAngles()
577 601
    {
578
    float D = (float)(Math.PI/4);
579

  
580
    return new float[][][]
581
      {
582
        {{ 0,0,0,0 }},
583
        {{ 0,0,D }},
584
        {{ 0,0,0,0 }},
585
        {{ 0,0,0,0 }},
586
        {{ 0,0,0,0 }}
587
      };
602
    return null;
588 603
    }
589 604

  
590 605
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff