Revision f2259427
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/objectlib/objects/TwistyMasterball.java | ||
---|---|---|
37 | 37 |
new Static3D(-SQ2/2, 0, SQ2/2), |
38 | 38 |
}; |
39 | 39 |
|
40 |
private static final float D = 0.1f; // shape; keep between (-0.5,0.5) |
|
41 |
|
|
40 | 42 |
private ScrambleState[] mStates; |
41 | 43 |
private int[][] mBasicAngle; |
42 | 44 |
private int[] mQuatIndex; |
... | ... | |
50 | 52 |
super(data, meshState, iconMode, data.getNumLayers()[0], quat, move, scale, stream); |
51 | 53 |
} |
52 | 54 |
|
55 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
56 |
// make the equator a bit thicker |
|
57 |
|
|
58 |
@Override |
|
59 |
public void adjustStickerCoords() |
|
60 |
{ |
|
61 |
final float X1 = -0.38861537f; |
|
62 |
final float Y1 = -0.4252297f; |
|
63 |
final float X2 = 0.5f; |
|
64 |
final float Y2 = -0.2860808f; |
|
65 |
final float X3 = 0.18867691f; |
|
66 |
final float Y3 = 0.39392126f; |
|
67 |
final float X4 = -0.30006152f; |
|
68 |
final float Y4 = 0.3173893f; |
|
69 |
|
|
70 |
final float Y = 0.02f; |
|
71 |
|
|
72 |
mStickerCoords = new float[][] |
|
73 |
{ |
|
74 |
{ X1+Y*(X4-X1), Y1+Y*(Y4-Y1), X2+Y*(X3-X2), Y2+Y*(Y3-Y2), X3, Y3, X4, Y4 }, |
|
75 |
{ -0.17166577f, -0.28301144f, 0.24996112f, -0.21698855f, -0.07829534f, 0.5f, } |
|
76 |
}; |
|
77 |
} |
|
78 |
|
|
53 | 79 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
54 | 80 |
|
55 | 81 |
@Override |
56 | 82 |
public float getPillowCoeff() |
57 | 83 |
{ |
58 |
return 1000f;
|
|
84 |
return 100f; |
|
59 | 85 |
} |
60 | 86 |
|
61 | 87 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
91 | 117 |
{ |
92 | 118 |
if( mCuts==null ) |
93 | 119 |
{ |
94 |
float[] cutH = { -0.25f,0.0f,0.25f }; |
|
120 |
float cut = 0.25f-D/4; |
|
121 |
float[] cutH = { cut,0.0f,cut }; |
|
95 | 122 |
float[] cutV = { 0.0f }; |
96 | 123 |
mCuts = new float[][] { cutH,cutV,cutV,cutV,cutV }; |
97 | 124 |
} |
... | ... | |
250 | 277 |
{ |
251 | 278 |
float[][] vertices = |
252 | 279 |
{ |
253 |
{ -3*SQ2/8, -0.5f, 1.250f-3*SQ2/8 },
|
|
254 |
{ 5*SQ2/8, -0.5f,-0.750f+5*SQ2/8 },
|
|
255 |
{ -3*SQ2/8, 0.5f, 0.250f-3*SQ2/8 },
|
|
256 |
{ SQ2/8, 0.5f,-0.750f+ SQ2/8 },
|
|
257 |
{ -3*SQ2/8, -0.5f,-0.750f-3*SQ2/8 },
|
|
258 |
{ -3*SQ2/8, 0.5f,-0.750f-3*SQ2/8 },
|
|
280 |
{ -3*SQ2/8 , -0.5f , 1.250f-3*SQ2/8 },
|
|
281 |
{ 5*SQ2/8 , -0.5f ,-0.750f+5*SQ2/8 },
|
|
282 |
{ -3*SQ2/8 , 0.5f-D, 0.250f-3*SQ2/8 +D },
|
|
283 |
{ SQ2/8 +D*(4*SQ2/8), 0.5f-D,-0.750f+ SQ2/8 +D*(4*SQ2/8) },
|
|
284 |
{ -3*SQ2/8 , -0.5f ,-0.750f-3*SQ2/8 },
|
|
285 |
{ -3*SQ2/8 , 0.5f-D,-0.750f-3*SQ2/8 },
|
|
259 | 286 |
}; |
260 | 287 |
int[][] indices = |
261 | 288 |
{ |
... | ... | |
272 | 299 |
{ |
273 | 300 |
float[][] vertices = |
274 | 301 |
{ |
275 |
{ -SQ2/8, -0.5f, -SQ2/8+0.75f },
|
|
276 |
{3*SQ2/8, -0.5f, 3*SQ2/8-0.25f },
|
|
277 |
{ -SQ2/8, -0.5f, -SQ2/8-0.25f },
|
|
278 |
{ -SQ2/8, +0.5f, -SQ2/8-0.25f }
|
|
302 |
{ -SQ2/8 , -0.5f -D, -SQ2/8+0.75f +D },
|
|
303 |
{3*SQ2/8 +D*(4*SQ2/8), -0.5f -D, 3*SQ2/8-0.25f +D*(4*SQ2/8) },
|
|
304 |
{ -SQ2/8 , -0.5f -D, -SQ2/8-0.25f },
|
|
305 |
{ -SQ2/8 , +0.5f , -SQ2/8-0.25f }
|
|
279 | 306 |
}; |
280 | 307 |
int[][] indices = |
281 | 308 |
{ |
... | ... | |
295 | 322 |
{ |
296 | 323 |
if( variant==0 ) |
297 | 324 |
{ |
298 |
int N = 7; |
|
299 | 325 |
float height = isInIconMode() ? 0.001f : 0.015f; |
300 |
float[][] bands = { {height,35,0.25f,0.5f,N,0,0},{0.001f,35,0.25f,0.5f,N,0,0} };
|
|
326 |
float[][] bands = { {height,35,0.25f,0.5f,10,0,0},{0.001f,35,0.25f,0.5f,4,0,0} };
|
|
301 | 327 |
int[] bandIndices = { 0,1,1,1,1 }; |
302 | 328 |
float[][] corners = { {0.04f,0.10f} }; |
303 | 329 |
int[] cornerIndices = { -1,-1,-1,-1,-1,-1 }; |
... | ... | |
307 | 333 |
} |
308 | 334 |
else |
309 | 335 |
{ |
310 |
int N = 7; |
|
311 | 336 |
float height = isInIconMode() ? 0.001f : 0.020f; |
312 |
float[][] bands = { {height,35,0.20f,0.6f,N,0,0}, {0.001f,35,0.20f,0.6f,N,0,0} };
|
|
337 |
float[][] bands = { {height,35,0.20f,0.6f,9,0,0}, {0.001f,35,0.20f,0.6f,4,0,0} };
|
|
313 | 338 |
int[] bandIndices = { 0,1,1,1 }; |
314 | 339 |
float[][] corners = { {0.02f,0.10f} }; |
315 | 340 |
int[] cornerIndices = { -1,-1,-1,-1 }; |
Also available in: Unified diff
Progress with Masterball.
Remaining: touch control's newRotation() function.