122 |
122 |
return null;
|
123 |
123 |
}
|
124 |
124 |
|
|
125 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
126 |
|
|
127 |
@Override
|
|
128 |
public float[][] returnRotationFactor()
|
|
129 |
{
|
|
130 |
int[] numLayers = getNumLayers();
|
|
131 |
int[] len = possiblyShapeshifterNumLayers(numLayers);
|
|
132 |
float[][] factor = new float[3][];
|
|
133 |
|
|
134 |
for(int ax=0; ax<3; ax++)
|
|
135 |
{
|
|
136 |
int numL = len[ax];
|
|
137 |
factor[ax] = new float[numL];
|
|
138 |
for(int la=0; la<numL; la++) factor[ax][la] = 1.0f;
|
|
139 |
}
|
|
140 |
|
|
141 |
return factor;
|
|
142 |
}
|
|
143 |
|
|
144 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
145 |
// TODO
|
|
146 |
|
|
147 |
private int[] possiblyShapeshifterNumLayers(int[] numLayers)
|
|
148 |
{
|
|
149 |
int x = numLayers[0];
|
|
150 |
int y = numLayers[1];
|
|
151 |
int z = numLayers[2];
|
|
152 |
|
|
153 |
if( x==2 && y==4 && z==2 ) return new int[] {4,4,4};
|
|
154 |
|
|
155 |
return numLayers;
|
|
156 |
}
|
|
157 |
|
|
158 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
159 |
|
|
160 |
public float[][] getCuts(int[] numLayers)
|
|
161 |
{
|
|
162 |
if( mCuts==null )
|
|
163 |
{
|
|
164 |
mCuts = new float[3][];
|
|
165 |
int[] len = possiblyShapeshifterNumLayers(numLayers);
|
|
166 |
|
|
167 |
for(int axis=0; axis<3; axis++)
|
|
168 |
{
|
|
169 |
int l = len[axis];
|
|
170 |
float start = (2-l)*0.5f;
|
|
171 |
|
|
172 |
if( l>=2 )
|
|
173 |
{
|
|
174 |
mCuts[axis] = new float[l-1];
|
|
175 |
for(int i=0; i<l-1; i++) mCuts[axis][i] = start+i;
|
|
176 |
}
|
|
177 |
}
|
|
178 |
}
|
|
179 |
|
|
180 |
return mCuts;
|
|
181 |
}
|
|
182 |
|
|
183 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
184 |
|
|
185 |
public boolean[][] getLayerRotatable(int[] numLayers)
|
|
186 |
{
|
|
187 |
int numAxis = ROT_AXIS.length;
|
|
188 |
boolean[][] layerRotatable = new boolean[numAxis][];
|
|
189 |
int[] len = possiblyShapeshifterNumLayers(numLayers);
|
|
190 |
|
|
191 |
for(int i=0; i<numAxis; i++)
|
|
192 |
{
|
|
193 |
int l = len[i];
|
|
194 |
layerRotatable[i] = new boolean[l];
|
|
195 |
for(int j=0; j<l; j++) layerRotatable[i][j] = true;
|
|
196 |
}
|
|
197 |
|
|
198 |
if( isAShapeshifter(numLayers) && (numLayers[0]==1 || numLayers[1]==1 || numLayers[2]==1) )
|
|
199 |
{
|
|
200 |
for(int i=0; i<numAxis; i++)
|
|
201 |
{
|
|
202 |
if( (len[i]%2)==1 )
|
|
203 |
{
|
|
204 |
int mid = (len[i]-1)/2;
|
|
205 |
layerRotatable[i][mid] = false;
|
|
206 |
}
|
|
207 |
}
|
|
208 |
}
|
|
209 |
|
|
210 |
return layerRotatable;
|
|
211 |
}
|
|
212 |
|
125 |
213 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
126 |
214 |
|
127 |
215 |
public Static4D[] getLocQuats()
|
... | ... | |
526 |
614 |
return 2;
|
527 |
615 |
}
|
528 |
616 |
|
529 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
530 |
|
|
531 |
|
public float[][] getCuts(int[] numLayers)
|
532 |
|
{
|
533 |
|
if( mCuts==null )
|
534 |
|
{
|
535 |
|
mCuts = new float[3][];
|
536 |
|
|
537 |
|
for(int axis=0; axis<3; axis++)
|
538 |
|
{
|
539 |
|
int len = numLayers[axis];
|
540 |
|
float start = (2-len)*0.5f;
|
541 |
|
|
542 |
|
if( len>=2 )
|
543 |
|
{
|
544 |
|
mCuts[axis] = new float[len-1];
|
545 |
|
for(int i=0; i<len-1; i++) mCuts[axis][i] = start+i;
|
546 |
|
}
|
547 |
|
}
|
548 |
|
}
|
549 |
|
|
550 |
|
return mCuts;
|
551 |
|
}
|
552 |
|
|
553 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
554 |
|
|
555 |
|
public boolean[][] getLayerRotatable(int[] numLayers)
|
556 |
|
{
|
557 |
|
int numAxis = ROT_AXIS.length;
|
558 |
|
boolean[][] layerRotatable = new boolean[numAxis][];
|
559 |
|
|
560 |
|
for(int i=0; i<numAxis; i++)
|
561 |
|
{
|
562 |
|
layerRotatable[i] = new boolean[numLayers[i]];
|
563 |
|
for(int j=0; j<numLayers[i]; j++) layerRotatable[i][j] = true;
|
564 |
|
}
|
565 |
|
|
566 |
|
if( isAShapeshifter(numLayers) && (numLayers[0]==1 || numLayers[1]==1 || numLayers[2]==1) )
|
567 |
|
{
|
568 |
|
for(int i=0; i<numAxis; i++)
|
569 |
|
{
|
570 |
|
if( (numLayers[i]%2)==1 )
|
571 |
|
{
|
572 |
|
int mid = (numLayers[i]-1)/2;
|
573 |
|
layerRotatable[i][mid] = false;
|
574 |
|
}
|
575 |
|
}
|
576 |
|
}
|
577 |
|
|
578 |
|
return layerRotatable;
|
579 |
|
}
|
580 |
|
|
581 |
617 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
582 |
618 |
|
583 |
619 |
public int getTouchControlType()
|
... | ... | |
712 |
748 |
{
|
713 |
749 |
if( mBasicAngle==null )
|
714 |
750 |
{
|
715 |
|
int[] num = getNumLayers();
|
716 |
|
int numX = num[0];
|
717 |
|
int numY = num[1];
|
718 |
|
int numZ = num[2];
|
|
751 |
int[] numLayers = getNumLayers();
|
|
752 |
int[] len = possiblyShapeshifterNumLayers(numLayers);
|
|
753 |
int numX = len[0];
|
|
754 |
int numY = len[1];
|
|
755 |
int numZ = len[2];
|
719 |
756 |
|
720 |
757 |
int x = basicAngle(numY,numZ);
|
721 |
758 |
int y = basicAngle(numX,numZ);
|
beginning of the fix for the shapeshifting cuboids.