Revision f2259427
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/objectlib/helpers/ObjectSticker.java | ||
---|---|---|
60 | 60 |
|
61 | 61 |
public String debug() |
62 | 62 |
{ |
63 |
android.util.Log.e("D", "DEBUG BEGIN"); |
|
64 |
|
|
65 | 63 |
String dbg="coords: "; |
66 | 64 |
int len = mCoords.length; |
67 | 65 |
for(int i=0; i<len; i++) dbg+= (" "+mCoords[i]); |
... | ... | |
76 | 74 |
|
77 | 75 |
dbg+= "\nstroke: "+mStroke; |
78 | 76 |
|
79 |
android.util.Log.e("D", "DEBUG END"); |
|
80 |
|
|
81 | 77 |
return dbg; |
82 | 78 |
} |
83 | 79 |
} |
src/main/java/org/distorted/objectlib/objects/TwistyJing.java | ||
---|---|---|
60 | 60 |
@Override |
61 | 61 |
public float getPillowCoeff() |
62 | 62 |
{ |
63 |
return 2.0f;
|
|
63 |
return 1.5f;
|
|
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
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 }; |
src/main/java/org/distorted/objectlib/objects/TwistyMorphix.java | ||
---|---|---|
59 | 59 |
@Override |
60 | 60 |
public float getPillowCoeff() |
61 | 61 |
{ |
62 |
return 2.0f;
|
|
62 |
return 1.5f;
|
|
63 | 63 |
} |
64 | 64 |
|
65 | 65 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/touchcontrol/TouchControlBall.java | ||
---|---|---|
139 | 139 |
float B = 2*(vx*mCamera[0] + vy*mCamera[1] + vz*mCamera[2]); |
140 | 140 |
float C = (mCamera[0]*mCamera[0] + mCamera[1]*mCamera[1] + mCamera[2]*mCamera[2]) - R*R; |
141 | 141 |
|
142 |
float delta = B*B - 4*A*C; |
|
143 |
|
|
144 |
if( delta>=0 ) |
|
142 |
if( B*B >= 4*A*C ) |
|
145 | 143 |
{ |
146 | 144 |
computeLongitudeAndLatitude(A,B,C); |
147 | 145 |
return true; |
... | ... | |
151 | 149 |
} |
152 | 150 |
|
153 | 151 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
152 |
// TODO |
|
154 | 153 |
|
155 | 154 |
public void newRotation(int[] output, Static4D rotatedTouchPoint, Static4D quat) |
156 | 155 |
{ |
157 | 156 |
computeEnabledAxis(); |
158 |
|
|
159 |
int rotIndex = 0; // TODO |
|
160 |
int row = 0; // TODO |
|
157 |
/* |
|
158 |
int rotIndex = computeRotationIndex( mCastedRotAxis[mLastTouchedFace], mMove2D, mEnabledRotAxis); |
|
159 |
float offset = computeOffset(mPoint2D, mCastedRotAxis[mLastTouchedFace][rotIndex]); |
|
160 |
int row = computeRowFromOffset(mLastTouchedFace,rotIndex,offset); |
|
161 |
*/ |
|
162 |
int rotIndex = 0; |
|
163 |
int row = 0; |
|
161 | 164 |
|
162 | 165 |
output[0] = rotIndex; |
163 | 166 |
output[1] = row; |
Also available in: Unified diff
Progress with Masterball.
Remaining: touch control's newRotation() function.