Project

General

Profile

« Previous | Next » 

Revision 4e9f2df5

Added by Leszek Koltunski over 2 years ago

Simplify.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistySquare1.java
75 75
    {
76 76
    if( variant==0 )
77 77
      {
78
      float[][] vertices = new float[][]
78
      float[][] vertices =
79 79
        {
80 80
         { -1.5f-X, 0.5f, 1.5f },
81 81
         {    0.0f, 0.5f, 1.5f },
......
87 87
         { -1.5f+X,-0.5f,-1.5f }
88 88
        };
89 89

  
90
      int[][] vert_indices = new int[][]
90
      int[][] indices =
91 91
        {
92 92
         {4,5,1,0},
93 93
         {5,6,2,1},
......
97 97
         {4,5,6,7}
98 98
        };
99 99

  
100
      return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),3);
100
      return new ObjectShape(vertices, indices, getNumCubitFaces(), 3);
101 101
      }
102 102
    else if( variant==1 )
103 103
      {
104
      float[][] vertices = new float[][]
104
      float[][] vertices =
105 105
        {
106 106
         {  -X, 0.5f, 0.0f },
107 107
         {  +X, 0.5f, 0.0f },
......
111 111
         {0.0f,-0.5f,-1.5f },
112 112
        };
113 113

  
114
      int[][] vert_indices = new int[][]
114
      int[][] indices =
115 115
        {
116 116
         {0,1,2},
117 117
         {3,4,1,0},
......
120 120
         {5,3,0,2}
121 121
        };
122 122

  
123
      return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),2);
123
      return new ObjectShape(vertices, indices, getNumCubitFaces(), 2);
124 124
      }
125 125
    else
126 126
      {
127
      float[][] vertices = new float[][]
127
      float[][] vertices =
128 128
        {
129 129
         { X-1.5f, 0.5f,  0.0f },
130 130
         {   0.0f, 0.5f,  0.0f },
......
135 135
         {   0.0f,-0.5f,X-1.5f },
136 136
         {  -1.5f,-0.5f, -1.5f }
137 137
        };
138
      int[][] vert_indices = new int[][]
138
      int[][] indices =
139 139
        {
140 140
         {0,1,2,3},
141 141
         {4,5,1,0},
......
145 145
         {4,5,6,7}
146 146
        };
147 147

  
148
      return new ObjectShape(vertices,vert_indices,getNumCubitFaces(),3);
148
      return new ObjectShape(vertices, indices, getNumCubitFaces(), 3);
149 149
      }
150 150
    }
151 151

  
......
161 161
      int[] cornerIndices = { 0,0,0,0,0,0,0,0 };
162 162
      float[][] centers   = { { -0.75f, 0.0f, 0.0f} };
163 163
      int[] centerIndices = { 0,0,0,0,0,0,0,0 };
164

  
165 164
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
166 165
      }
167 166
    else if( variant==1 )
......
172 171
      int[] cornerIndices = { 0,0,-1,0,0,-1 };
173 172
      float[][] centers   = { { 0.0f, 0.0f,-0.5f} };
174 173
      int[] centerIndices = { 0,0,-1,0,0,-1 };
175

  
176 174
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
177 175
      }
178 176
    else
......
183 181
      int[] cornerIndices = { 0,0,0,-1,0,0,0,-1 };
184 182
      float[][] centers   = { { -0.5f, 0.0f,-0.5f} };
185 183
      int[] centerIndices = { -1,0,-1,-1,-1,0,-1,-1 };
186

  
187 184
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
188 185
      }
189 186
    }

Also available in: Unified diff