Project

General

Profile

« Previous | Next » 

Revision f2d0d23e

Added by Leszek Koltunski over 2 years ago

Remove statics from the Bandaged Cube classes.

View differences:

src/main/java/org/distorted/objects/TwistyBandaged2Bar.java
32 32

  
33 33
class TwistyBandaged2Bar extends TwistyBandagedAbstract
34 34
{
35
  private static final float[][] POSITIONS = new float[][]
36
      {
37
       { 0.0f, +1.0f,  1.0f, 0.0f, +1.0f,  0.0f, 0.0f, +1.0f, -1.0f},
38
       {-1.0f, -1.0f,  0.0f, 0.0f, -1.0f,  0.0f, 1.0f, -1.0f,  0.0f},
39
       {-1.0f, +1.0f, +1.0f},
40
       {-1.0f, +1.0f,  0.0f},
41
       {-1.0f, +1.0f, -1.0f},
42
       {-1.0f,  0.0f, +1.0f},
43
       {-1.0f,  0.0f,  0.0f},
44
       {-1.0f,  0.0f, -1.0f},
45
       {-1.0f, -1.0f, +1.0f},
46
       {-1.0f, -1.0f, -1.0f},
47
       {+1.0f, +1.0f, +1.0f},
48
       {+1.0f, +1.0f,  0.0f},
49
       {+1.0f, +1.0f, -1.0f},
50
       {+1.0f,  0.0f, +1.0f},
51
       {+1.0f,  0.0f,  0.0f},
52
       {+1.0f,  0.0f, -1.0f},
53
       {+1.0f, -1.0f, +1.0f},
54
       {+1.0f, -1.0f, -1.0f},
55
       { 0.0f,  0.0f, +1.0f},
56
       { 0.0f, -1.0f, +1.0f},
57
       { 0.0f,  0.0f, -1.0f},
58
       { 0.0f, -1.0f, -1.0f}
59
      };
60

  
61
  private static final int[] QUAT_INDICES = new int[] { 2 };
62

  
63
///////////////////////////////////////////////////////////////////////////////////////////////////
64

  
65 35
  TwistyBandaged2Bar(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
66 36
                     DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
67 37
    {
......
79 49

  
80 50
  float[][] getPositions()
81 51
    {
52
    if( POSITIONS==null )
53
      {
54
      POSITIONS = new float[][]
55
        {
56
         { 0.0f, +1.0f,  1.0f, 0.0f, +1.0f,  0.0f, 0.0f, +1.0f, -1.0f},
57
         {-1.0f, -1.0f,  0.0f, 0.0f, -1.0f,  0.0f, 1.0f, -1.0f,  0.0f},
58
         {-1.0f, +1.0f, +1.0f},
59
         {-1.0f, +1.0f,  0.0f},
60
         {-1.0f, +1.0f, -1.0f},
61
         {-1.0f,  0.0f, +1.0f},
62
         {-1.0f,  0.0f,  0.0f},
63
         {-1.0f,  0.0f, -1.0f},
64
         {-1.0f, -1.0f, +1.0f},
65
         {-1.0f, -1.0f, -1.0f},
66
         {+1.0f, +1.0f, +1.0f},
67
         {+1.0f, +1.0f,  0.0f},
68
         {+1.0f, +1.0f, -1.0f},
69
         {+1.0f,  0.0f, +1.0f},
70
         {+1.0f,  0.0f,  0.0f},
71
         {+1.0f,  0.0f, -1.0f},
72
         {+1.0f, -1.0f, +1.0f},
73
         {+1.0f, -1.0f, -1.0f},
74
         { 0.0f,  0.0f, +1.0f},
75
         { 0.0f, -1.0f, +1.0f},
76
         { 0.0f,  0.0f, -1.0f},
77
         { 0.0f, -1.0f, -1.0f}
78
        };
79
      }
80

  
82 81
    return POSITIONS;
83 82
    }
84 83

  
......
86 85

  
87 86
  int[] getQuatIndices()
88 87
    {
88
    if( QUAT_INDICES==null )
89
      {
90
      QUAT_INDICES = new int[] { 2 };
91
      }
92

  
89 93
    return QUAT_INDICES;
90 94
    }
91 95

  
src/main/java/org/distorted/objects/TwistyBandaged3Plate.java
32 32

  
33 33
class TwistyBandaged3Plate extends TwistyBandagedAbstract
34 34
{
35
  private static final float[][] POSITIONS = new float[][]
36
      {
37
       {-1.0f,  1.0f,  1.0f, -1.0f,  0.0f,  1.0f,  0.0f,  1.0f,  1.0f,  0.0f,  0.0f,  1.0f},
38
       { 1.0f,  0.0f, -1.0f,  1.0f,  0.0f,  0.0f,  1.0f,  1.0f, -1.0f,  1.0f,  1.0f,  0.0f},
39
       {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f,  0.0f,  0.0f, -1.0f, -1.0f,  0.0f, -1.0f,  0.0f},
40
       { 1.0f,  1.0f,  1.0f},
41
       { 1.0f,  0.0f,  1.0f},
42
       { 1.0f, -1.0f,  1.0f},
43
       {-1.0f, -1.0f,  1.0f},
44
       { 0.0f, -1.0f,  1.0f},
45
       { 1.0f, -1.0f,  0.0f},
46
       { 1.0f, -1.0f, -1.0f},
47
       {-1.0f,  1.0f, -1.0f},
48
       {-1.0f,  1.0f,  0.0f},
49
       { 0.0f,  1.0f, -1.0f},
50
       { 0.0f,  1.0f,  0.0f},
51
       {-1.0f,  0.0f, -1.0f},
52
       {-1.0f,  0.0f,  0.0f},
53
       { 0.0f,  0.0f, -1.0f}
54
      };
55

  
56
  private static final int[] QUAT_INDICES = new int[] { 1, 3 };
57

  
58
///////////////////////////////////////////////////////////////////////////////////////////////////
59

  
60 35
  TwistyBandaged3Plate(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
61 36
                       DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
62 37
    {
......
87 62

  
88 63
  float[][] getPositions()
89 64
    {
65
    if( POSITIONS==null )
66
      {
67
      POSITIONS = new float[][]
68
        {
69
          {-1.0f,  1.0f,  1.0f, -1.0f,  0.0f,  1.0f,  0.0f,  1.0f,  1.0f,  0.0f,  0.0f,  1.0f},
70
          { 1.0f,  0.0f, -1.0f,  1.0f,  0.0f,  0.0f,  1.0f,  1.0f, -1.0f,  1.0f,  1.0f,  0.0f},
71
          {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f,  0.0f,  0.0f, -1.0f, -1.0f,  0.0f, -1.0f,  0.0f},
72
          { 1.0f,  1.0f,  1.0f},
73
          { 1.0f,  0.0f,  1.0f},
74
          { 1.0f, -1.0f,  1.0f},
75
          {-1.0f, -1.0f,  1.0f},
76
          { 0.0f, -1.0f,  1.0f},
77
          { 1.0f, -1.0f,  0.0f},
78
          { 1.0f, -1.0f, -1.0f},
79
          {-1.0f,  1.0f, -1.0f},
80
          {-1.0f,  1.0f,  0.0f},
81
          { 0.0f,  1.0f, -1.0f},
82
          { 0.0f,  1.0f,  0.0f},
83
          {-1.0f,  0.0f, -1.0f},
84
          {-1.0f,  0.0f,  0.0f},
85
          { 0.0f,  0.0f, -1.0f}
86
        };
87
      }
90 88
    return POSITIONS;
91 89
    }
92 90

  
......
94 92

  
95 93
  int[] getQuatIndices()
96 94
    {
95
    if( QUAT_INDICES==null )
96
      {
97
      QUAT_INDICES = new int[] { 1,3 };
98
      }
99

  
97 100
    return QUAT_INDICES;
98 101
    }
99 102

  
src/main/java/org/distorted/objects/TwistyBandagedAbstract.java
153 153

  
154 154
  private int mCurrState;
155 155
  private int mIndexExcluded;
156
  ScrambleState[] mStates;
157 156
  private int[][] mScrambleTable;
158 157
  private int[] mNumOccurences;
158
  ScrambleState[] mStates;
159
  float[][] POSITIONS;
160
  int[] QUAT_INDICES;
159 161

  
160 162
///////////////////////////////////////////////////////////////////////////////////////////////////
161 163

  
src/main/java/org/distorted/objects/TwistyBandagedEvil.java
32 32

  
33 33
class TwistyBandagedEvil extends TwistyBandagedAbstract
34 34
{
35
  private static final float[][] POSITIONS = new float[][]
36
      {
37
        { 1.0f,  1.0f, -1.0f},
38
        {-1.0f, -1.0f,  0.0f, -1.0f,  0.0f,  0.0f, 0.0f, -1.0f,  0.0f,  0.0f,  0.0f,  0.0f},
39
        {-1.0f,  1.0f, -1.0f,  0.0f,  1.0f, -1.0f},
40
        {-1.0f,  0.0f, -1.0f,  0.0f,  0.0f, -1.0f},
41
        {-1.0f, -1.0f, -1.0f,  0.0f, -1.0f, -1.0f},
42
        {-1.0f,  1.0f,  0.0f, -1.0f,  1.0f,  1.0f},
43
        { 0.0f,  1.0f,  0.0f,  0.0f,  1.0f,  1.0f},
44
        { 1.0f,  1.0f,  0.0f,  1.0f,  1.0f,  1.0f},
45
        {-1.0f, -1.0f,  1.0f, -1.0f,  0.0f,  1.0f},
46
        { 0.0f, -1.0f,  1.0f,  0.0f,  0.0f,  1.0f},
47
        { 1.0f, -1.0f,  1.0f,  1.0f,  0.0f,  1.0f},
48
        { 1.0f, -1.0f,  0.0f,  1.0f,  0.0f,  0.0f},
49
        { 1.0f, -1.0f, -1.0f,  1.0f,  0.0f, -1.0f}
50
      };
51

  
52
  private static final int[] QUAT_INDICES = new int[]
53
      { 0, 1, 0, 0, 0, 2, 2, 2, 3, 3, 3, 3, 3 };
54

  
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56

  
57 35
  TwistyBandagedEvil(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
58 36
                     DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
59 37
    {
......
207 185
     new ScrambleState( new int[][] {{}                          , {2, 1,  1}                  , {2, 2, 12,2,-1, 13} })
208 186
     };
209 187
    }
210

  
211 188
///////////////////////////////////////////////////////////////////////////////////////////////////
212 189

  
213 190
  float[][] getPositions()
214 191
    {
192
    if( POSITIONS==null )
193
      {
194
      POSITIONS = new float[][]
195
        {
196
          { 1.0f,  1.0f, -1.0f},
197
          {-1.0f, -1.0f,  0.0f, -1.0f,  0.0f,  0.0f, 0.0f, -1.0f,  0.0f,  0.0f,  0.0f,  0.0f},
198
          {-1.0f,  1.0f, -1.0f,  0.0f,  1.0f, -1.0f},
199
          {-1.0f,  0.0f, -1.0f,  0.0f,  0.0f, -1.0f},
200
          {-1.0f, -1.0f, -1.0f,  0.0f, -1.0f, -1.0f},
201
          {-1.0f,  1.0f,  0.0f, -1.0f,  1.0f,  1.0f},
202
          { 0.0f,  1.0f,  0.0f,  0.0f,  1.0f,  1.0f},
203
          { 1.0f,  1.0f,  0.0f,  1.0f,  1.0f,  1.0f},
204
          {-1.0f, -1.0f,  1.0f, -1.0f,  0.0f,  1.0f},
205
          { 0.0f, -1.0f,  1.0f,  0.0f,  0.0f,  1.0f},
206
          { 1.0f, -1.0f,  1.0f,  1.0f,  0.0f,  1.0f},
207
          { 1.0f, -1.0f,  0.0f,  1.0f,  0.0f,  0.0f},
208
          { 1.0f, -1.0f, -1.0f,  1.0f,  0.0f, -1.0f}
209
        };
210
      }
215 211
    return POSITIONS;
216 212
    }
217 213

  
......
219 215

  
220 216
  int[] getQuatIndices()
221 217
    {
218
    if( QUAT_INDICES==null )
219
      {
220
      QUAT_INDICES = new int[] { 0, 1, 0, 0, 0, 2, 2, 2, 3, 3, 3, 3, 3 };
221
      }
222

  
222 223
    return QUAT_INDICES;
223 224
    }
224 225

  
src/main/java/org/distorted/objects/TwistyBandagedFused.java
32 32

  
33 33
class TwistyBandagedFused extends TwistyBandagedAbstract
34 34
{
35
  private static final float[][] POSITIONS = new float[][]
36
      {
37
       {-1.0f, -1.0f, +0.0f,
38
        -1.0f, -1.0f, +1.0f,
39
        -1.0f,  0.0f, +0.0f,
40
        -1.0f,  0.0f, +1.0f,
41
         0.0f, -1.0f, +0.0f,
42
         0.0f, -1.0f, +1.0f,
43
         0.0f,  0.0f, +0.0f,
44
         0.0f,  0.0f, +1.0f},
45
       {-1.0f, +1.0f, +1.0f},
46
       {-1.0f, +1.0f, +0.0f},
47
       {-1.0f, +1.0f, -1.0f},
48
       { 0.0f, +1.0f, +1.0f},
49
       { 0.0f, +1.0f, +0.0f},
50
       { 0.0f, +1.0f, -1.0f},
51
       { 1.0f, +1.0f, +1.0f},
52
       { 1.0f, +1.0f, +0.0f},
53
       { 1.0f, +1.0f, -1.0f},
54
       { 1.0f,  0.0f, +1.0f},
55
       { 1.0f,  0.0f, +0.0f},
56
       { 1.0f,  0.0f, -1.0f},
57
       { 1.0f, -1.0f, +1.0f},
58
       { 1.0f, -1.0f, +0.0f},
59
       { 1.0f, -1.0f, -1.0f},
60
       {-1.0f, -1.0f, -1.0f},
61
       {-1.0f,  0.0f, -1.0f},
62
       { 0.0f, -1.0f, -1.0f},
63
       { 0.0f,  0.0f, -1.0f}
64
      };
65

  
66
  private static final int[] QUAT_INDICES = new int[] { 0 };
67

  
68
///////////////////////////////////////////////////////////////////////////////////////////////////
69

  
70 35
  TwistyBandagedFused(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
71 36
                      DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
72 37
    {
......
84 49

  
85 50
  float[][] getPositions()
86 51
    {
52
    if( POSITIONS==null )
53
      {
54
      POSITIONS = new float[][]
55
        {
56
          {-1.0f, -1.0f, +0.0f,
57
           -1.0f, -1.0f, +1.0f,
58
           -1.0f,  0.0f, +0.0f,
59
           -1.0f,  0.0f, +1.0f,
60
            0.0f, -1.0f, +0.0f,
61
            0.0f, -1.0f, +1.0f,
62
            0.0f,  0.0f, +0.0f,
63
            0.0f,  0.0f, +1.0f},
64
          {-1.0f, +1.0f, +1.0f},
65
          {-1.0f, +1.0f, +0.0f},
66
          {-1.0f, +1.0f, -1.0f},
67
          { 0.0f, +1.0f, +1.0f},
68
          { 0.0f, +1.0f, +0.0f},
69
          { 0.0f, +1.0f, -1.0f},
70
          { 1.0f, +1.0f, +1.0f},
71
          { 1.0f, +1.0f, +0.0f},
72
          { 1.0f, +1.0f, -1.0f},
73
          { 1.0f,  0.0f, +1.0f},
74
          { 1.0f,  0.0f, +0.0f},
75
          { 1.0f,  0.0f, -1.0f},
76
          { 1.0f, -1.0f, +1.0f},
77
          { 1.0f, -1.0f, +0.0f},
78
          { 1.0f, -1.0f, -1.0f},
79
          {-1.0f, -1.0f, -1.0f},
80
          {-1.0f,  0.0f, -1.0f},
81
          { 0.0f, -1.0f, -1.0f},
82
          { 0.0f,  0.0f, -1.0f}
83
        };
84
      }
87 85
    return POSITIONS;
88 86
    }
89 87

  
......
91 89

  
92 90
  int[] getQuatIndices()
93 91
    {
92
    if( QUAT_INDICES==null )
93
      {
94
      QUAT_INDICES = new int[] { 0 };
95
      }
96

  
94 97
    return QUAT_INDICES;
95 98
    }
96 99

  

Also available in: Unified diff