Revision 3bf19410
Added by Leszek Koltunski about 2 years ago
src/main/java/org/distorted/objectlib/helpers/FactoryBandaged3x3Cubit.java | ||
---|---|---|
1155 | 1155 |
|
1156 | 1156 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
1157 | 1157 |
|
1158 |
public ObjectFaceShape createIrregularFaceShape(int variant) |
|
1158 |
public ObjectFaceShape createIrregularFaceShape(int variant, boolean iconMode)
|
|
1159 | 1159 |
{ |
1160 |
float defHeight = 0.05f;
|
|
1161 |
int angle = 60;
|
|
1162 |
float R = 0.2f;
|
|
1163 |
float S = 0.7f;
|
|
1164 |
int numVertices = 5;
|
|
1165 |
int extraI = 1;
|
|
1166 |
int extraV = 1;
|
|
1160 |
float height = iconMode ? 0.001f : 0.05f;
|
|
1161 |
int angle = 60; |
|
1162 |
float R = 0.2f; |
|
1163 |
float S = 0.7f; |
|
1164 |
int numVertices= 5; |
|
1165 |
int extraI = 1; |
|
1166 |
int extraV = 1; |
|
1167 | 1167 |
|
1168 | 1168 |
float[][] corners = { {0.02f,0.12f} }; |
1169 |
float[][] bands = { { 0.001f,angle,R,S,numVertices,extraV,extraI},
|
|
1170 |
{defHeight/1,angle,R,S,numVertices,extraV,extraI},
|
|
1171 |
{defHeight/2,angle,R,S,numVertices,extraV,extraI},
|
|
1172 |
{defHeight/3,angle,R,S,numVertices,extraV,extraI} };
|
|
1169 |
float[][] bands = { { 0.001f,angle,R,S,numVertices,extraV,extraI}, |
|
1170 |
{height/1,angle,R,S,numVertices,extraV,extraI},
|
|
1171 |
{height/2,angle,R,S,numVertices,extraV,extraI},
|
|
1172 |
{height/3,angle,R,S,numVertices,extraV,extraI} };
|
|
1173 | 1173 |
|
1174 | 1174 |
int[] bandIndices = generateBandIndices(mVertices[variant], mIndices[variant], mMove[variant]); |
1175 | 1175 |
int[] cornerIndices = generateCornerIndices(mVertices[variant], mIndices[variant]); |
... | ... | |
1182 | 1182 |
|
1183 | 1183 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
1184 | 1184 |
|
1185 |
public MeshBase createMesh(float[] pos) |
|
1185 |
public MeshBase createMesh(float[] pos, boolean iconMode)
|
|
1186 | 1186 |
{ |
1187 | 1187 |
prepare(1); |
1188 | 1188 |
ObjectShape shape = createIrregularShape(0,pos); |
1189 |
ObjectFaceShape face = createIrregularFaceShape(0); |
|
1189 |
ObjectFaceShape face = createIrregularFaceShape(0,iconMode);
|
|
1190 | 1190 |
int[][] indices = shape.getVertIndices(); |
1191 | 1191 |
int numComponents = indices.length; |
1192 | 1192 |
|
src/main/java/org/distorted/objectlib/helpers/FactoryCubit.java | ||
---|---|---|
73 | 73 |
private static final ArrayList<FaceTransform> mOldFaceTransf = new ArrayList<>(); |
74 | 74 |
private static final ArrayList<StickerCoords> mStickerCoords = new ArrayList<>(); |
75 | 75 |
|
76 |
private final float[] mqx,mqy,mqz,mqw; |
|
77 |
private int mnum; |
|
78 |
|
|
79 | 76 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
80 | 77 |
|
81 | 78 |
private FactoryCubit() |
82 | 79 |
{ |
83 |
int num= 100; |
|
84 |
mqx = new float[num]; |
|
85 |
mqy = new float[num]; |
|
86 |
mqz = new float[num]; |
|
87 |
mqw = new float[num]; |
|
80 |
|
|
88 | 81 |
} |
89 | 82 |
|
90 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
823 | 816 |
{ |
824 | 817 |
printTransform(mNewFaceTransf.get(f)); |
825 | 818 |
} |
826 |
|
|
827 |
android.util.Log.d("D", "---- used quats ---"); |
|
828 |
|
|
829 |
for(int i=0; i<mnum; i++) |
|
830 |
{ |
|
831 |
android.util.Log.e("D", mqx[i]+" "+mqy[i]+" "+mqz[i]+" "+mqw[i]); |
|
832 |
} |
|
833 | 819 |
} |
834 | 820 |
|
835 | 821 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
1072 | 1058 |
MeshBase mesh = new MeshJoined(meshes); |
1073 | 1059 |
Static3D center = new Static3D(0,0,0); |
1074 | 1060 |
|
1075 |
mnum = numFaces; |
|
1076 |
|
|
1077 | 1061 |
for(int face=0; face<numFaces; face++) |
1078 | 1062 |
{ |
1079 | 1063 |
int assoc = (1<<face); |
... | ... | |
1088 | 1072 |
float qz = fInfo.qz; |
1089 | 1073 |
float qw = fInfo.qw; |
1090 | 1074 |
|
1091 |
mqx[face]=qx; |
|
1092 |
mqy[face]=qy; |
|
1093 |
mqz[face]=qz; |
|
1094 |
mqw[face]=qw; |
|
1095 |
|
|
1096 | 1075 |
Static3D scale = new Static3D(sc,sc,sc); |
1097 | 1076 |
Static3D move3D= new Static3D(vx,vy,vz); |
1098 | 1077 |
Static4D quat = new Static4D(qx,qy,qz,qw); |
src/main/java/org/distorted/objectlib/helpers/ObjectFaceShape.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.objectlib.helpers; |
21 | 21 |
|
22 |
import org.distorted.objectlib.main.ObjectControl; |
|
23 |
|
|
24 | 22 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
25 | 23 |
|
26 | 24 |
public class ObjectFaceShape |
... | ... | |
31 | 29 |
private final float[][] mCenters; |
32 | 30 |
private final int[] mCenterIndices; |
33 | 31 |
private final float[] mConvexityCenter; |
34 |
|
|
35 |
private float[][] mBands; |
|
32 |
private final float[][] mBands; |
|
36 | 33 |
|
37 | 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
38 | 35 |
|
... | ... | |
46 | 43 |
mCenters = centers; |
47 | 44 |
mCenterIndices = centIndices; |
48 | 45 |
mConvexityCenter = convexityCenter; |
49 |
|
|
50 |
if( ObjectControl.isInIconMode() ) |
|
51 |
{ |
|
52 |
int len = bands.length; |
|
53 |
mBands = new float[len][]; |
|
54 |
|
|
55 |
for(int i=0; i<len; i++) |
|
56 |
{ |
|
57 |
int l = bands[i].length; |
|
58 |
mBands[i] = new float[l]; |
|
59 |
mBands[i][0] = 0.01f; |
|
60 |
if (l>=1) System.arraycopy(bands[i], 1, mBands[i], 1, l-1); |
|
61 |
} |
|
62 |
} |
|
63 | 46 |
} |
64 | 47 |
|
65 | 48 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/main/ObjectControl.java | ||
---|---|---|
81 | 81 |
private boolean mIsLocked, mRemLocked; |
82 | 82 |
private final int[] mBuffer; |
83 | 83 |
private final float[] mAxis; |
84 |
private int mMeshState; |
|
84 |
private int mMeshState, mIconMode;
|
|
85 | 85 |
private boolean mRotateOnCreation; |
86 | 86 |
|
87 | 87 |
private static final Static4D mQuat= new Static4D(-0.25189602f,0.3546389f,0.009657208f,0.90038127f); |
88 | 88 |
private static final Static4D mTemp= new Static4D(0,0,0,1); |
89 | 89 |
|
90 |
private static boolean mForcedIconMode = false; |
|
91 |
|
|
92 | 90 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
93 | 91 |
|
94 | 92 |
private void addSpeedProbe(float x, float y) |
... | ... | |
543 | 541 |
return mInterface; |
544 | 542 |
} |
545 | 543 |
|
546 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
547 |
|
|
548 |
public static void setIconMode(boolean mode) |
|
549 |
{ |
|
550 |
mForcedIconMode = mode; |
|
551 |
} |
|
552 |
|
|
553 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
554 |
|
|
555 |
public static boolean isInIconMode() |
|
556 |
{ |
|
557 |
return mForcedIconMode; |
|
558 |
} |
|
559 |
|
|
560 | 544 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
561 | 545 |
// PUBLIC API |
562 | 546 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
578 | 562 |
mFirstIndex= 0; |
579 | 563 |
mLastIndex = 0; |
580 | 564 |
mMeshState =-1; |
565 |
mIconMode =-1; |
|
581 | 566 |
|
582 | 567 |
DisplayMetrics dm = new DisplayMetrics(); |
583 | 568 |
act.getWindowManager().getDefaultDisplay().getMetrics(dm); |
... | ... | |
769 | 754 |
|
770 | 755 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
771 | 756 |
|
772 |
public void changeObject(int ordinal, int meshState, InputStream jsonStream, InputStream meshStream) |
|
757 |
public void changeObject(int ordinal, int meshState, int iconMode, InputStream jsonStream, InputStream meshStream)
|
|
773 | 758 |
{ |
774 |
mPreRender.changeObject(ordinal, meshState, jsonStream, meshStream); |
|
759 |
mPreRender.changeObject(ordinal, meshState, iconMode, jsonStream, meshStream);
|
|
775 | 760 |
} |
776 | 761 |
|
777 | 762 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
778 | 763 |
|
779 |
public void changeIfDifferent(int ordinal, String oldName, int meshState, InputStream jsonStream, InputStream meshStream) |
|
764 |
public void changeIfDifferent(int ordinal, String oldName, int meshState, int iconMode, InputStream jsonStream, InputStream meshStream)
|
|
780 | 765 |
{ |
781 | 766 |
TwistyObject object = mPreRender.getObject(); |
782 | 767 |
String newName = object==null ? "" : object.getShortName(); |
783 | 768 |
|
784 |
if( !oldName.equals(newName) || mMeshState!=meshState ) |
|
769 |
if( !oldName.equals(newName) || mMeshState!=meshState || mIconMode!=iconMode )
|
|
785 | 770 |
{ |
786 | 771 |
mMeshState = meshState; |
787 |
mPreRender.changeObject(ordinal, meshState, jsonStream, meshStream); |
|
772 |
mIconMode = iconMode; |
|
773 |
mPreRender.changeObject(ordinal, meshState, iconMode, jsonStream, meshStream); |
|
788 | 774 |
} |
789 | 775 |
} |
790 | 776 |
|
src/main/java/org/distorted/objectlib/main/ObjectPreRender.java | ||
---|---|---|
64 | 64 |
private int mCubit, mFace, mNewColor; |
65 | 65 |
private int mNearestAngle; |
66 | 66 |
private long mScrambleStartTime, mScrambleEndTime; |
67 |
private int mMeshState; |
|
67 |
private int mMeshState, mIconMode;
|
|
68 | 68 |
|
69 | 69 |
// debugging only |
70 | 70 |
private long mAddRotationTime; |
... | ... | |
101 | 101 |
|
102 | 102 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
103 | 103 |
|
104 |
private void createObjectNow(int ordinal, int meshState, InputStream jsonStream, InputStream meshStream) |
|
104 |
private void createObjectNow(int ordinal, int meshState, int iconMode, InputStream jsonStream, InputStream meshStream)
|
|
105 | 105 |
{ |
106 | 106 |
boolean firstTime = (mNewObject==null); |
107 | 107 |
|
... | ... | |
112 | 112 |
|
113 | 113 |
long time1 = System.currentTimeMillis(); |
114 | 114 |
|
115 |
if( jsonStream==null ) mNewObject = ObjectType.create( ordinal, meshState, quat, move, mScale, meshStream); |
|
116 |
else mNewObject = new TwistyJson( jsonStream, meshState, quat, move, mScale, meshStream); |
|
115 |
if( jsonStream==null ) mNewObject = ObjectType.create( ordinal, meshState, iconMode, quat, move, mScale, meshStream);
|
|
116 |
else mNewObject = new TwistyJson( jsonStream, meshState, iconMode, quat, move, mScale, meshStream);
|
|
117 | 117 |
|
118 | 118 |
long time2 = System.currentTimeMillis(); |
119 | 119 |
mInterface.onObjectCreated(time2-time1); |
... | ... | |
242 | 242 |
{ |
243 | 243 |
mChangeObject = false; |
244 | 244 |
blockEverything(BlockController.PLACE_1); |
245 |
createObjectNow(mOrdinal,mMeshState,mJsonStream,mMeshStream); |
|
245 |
createObjectNow(mOrdinal,mMeshState,mIconMode,mJsonStream,mMeshStream);
|
|
246 | 246 |
doEffectNow( BaseEffect.Type.SIZECHANGE ); |
247 | 247 |
} |
248 | 248 |
|
... | ... | |
412 | 412 |
|
413 | 413 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
414 | 414 |
|
415 |
public void changeObject(int ordinal, int meshState, InputStream jsonStream, InputStream meshStream) |
|
415 |
public void changeObject(int ordinal, int meshState, int iconMode, InputStream jsonStream, InputStream meshStream)
|
|
416 | 416 |
{ |
417 | 417 |
mChangeObject = true; |
418 | 418 |
mOrdinal = ordinal; |
419 | 419 |
mMeshState = meshState; |
420 |
mIconMode = iconMode; |
|
420 | 421 |
mJsonStream = jsonStream; |
421 | 422 |
mMeshStream = meshStream; |
422 | 423 |
} |
src/main/java/org/distorted/objectlib/main/ObjectType.java | ||
---|---|---|
160 | 160 |
|
161 | 161 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
162 | 162 |
|
163 |
public static TwistyObject create(int ordinal, int meshState, Static4D quat, Static3D move, float scale, InputStream meshStream) |
|
163 |
public static TwistyObject create(int ordinal, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream meshStream)
|
|
164 | 164 |
{ |
165 | 165 |
int[] numL= objects[ordinal].mNumLayers; |
166 | 166 |
Class<? extends TwistyObject> clazz = objects[ordinal].mClass; |
... | ... | |
171 | 171 |
|
172 | 172 |
if( cons.length==1 ) |
173 | 173 |
{ |
174 |
Object[] parameters = new Object[] { numL,meshState,quat,move,scale,meshStream }; |
|
174 |
Object[] parameters = new Object[] { numL,meshState,iconMode,quat,move,scale,meshStream };
|
|
175 | 175 |
return (TwistyObject)cons[0].newInstance(parameters); |
176 | 176 |
} |
177 | 177 |
else |
src/main/java/org/distorted/objectlib/main/ShapeDodecahedron.java | ||
---|---|---|
56 | 56 |
|
57 | 57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
58 | 58 |
|
59 |
public ShapeDodecahedron(int[] numLayers, int meshState, float realSize, Static4D quat, Static3D move, float scale, InputStream stream) |
|
59 |
public ShapeDodecahedron(int[] numLayers, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
60 | 60 |
{ |
61 |
super(numLayers, meshState, realSize, quat, move, scale, stream); |
|
61 |
super(numLayers, meshState, iconMode, realSize, quat, move, scale, stream);
|
|
62 | 62 |
} |
63 | 63 |
|
64 | 64 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/main/ShapeHexahedron.java | ||
---|---|---|
43 | 43 |
|
44 | 44 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
45 | 45 |
|
46 |
public ShapeHexahedron(int[] numLayers, int meshState, float realSize, Static4D quat, Static3D move, float scale, InputStream stream) |
|
46 |
public ShapeHexahedron(int[] numLayers, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
47 | 47 |
{ |
48 |
super(numLayers, meshState, realSize, quat, move, scale, stream); |
|
48 |
super(numLayers, meshState, iconMode, realSize, quat, move, scale, stream);
|
|
49 | 49 |
} |
50 | 50 |
|
51 | 51 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/main/ShapeOctahedron.java | ||
---|---|---|
44 | 44 |
|
45 | 45 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
46 | 46 |
|
47 |
public ShapeOctahedron(int[] numLayers, int meshState, float realSize, Static4D quat, Static3D move, float scale, InputStream stream) |
|
47 |
public ShapeOctahedron(int[] numLayers, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
48 | 48 |
{ |
49 |
super(numLayers, meshState, realSize, quat, move, scale, stream); |
|
49 |
super(numLayers, meshState, iconMode, realSize, quat, move, scale, stream);
|
|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/main/ShapeTetrahedron.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
44 | 44 |
|
45 |
public ShapeTetrahedron(int[] numLayers, int meshState, float realSize, Static4D quat, Static3D move, float scale, InputStream stream) |
|
45 |
public ShapeTetrahedron(int[] numLayers, int meshState, int iconMode, float realSize, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
46 | 46 |
{ |
47 |
super(numLayers, meshState, realSize, quat, move, scale, stream); |
|
47 |
super(numLayers, meshState, iconMode, realSize, quat, move, scale, stream);
|
|
48 | 48 |
} |
49 | 49 |
|
50 | 50 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/main/TwistyJson.java | ||
---|---|---|
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
39 | 39 |
|
40 |
public TwistyJson(InputStream jsonStream, int meshState, Static4D quat, Static3D move, float scale, InputStream meshStream) |
|
40 |
public TwistyJson(InputStream jsonStream, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream meshStream)
|
|
41 | 41 |
{ |
42 |
super(jsonStream, meshState, quat, move, scale, meshStream); |
|
42 |
super(jsonStream, meshState, iconMode, quat, move, scale, meshStream);
|
|
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/main/TwistyObject.java | ||
---|---|---|
70 | 70 |
public static final int MESH_NICE = 0; |
71 | 71 |
public static final int MESH_FAST = 1; |
72 | 72 |
|
73 |
public static final int MODE_ICON = 0; |
|
74 |
public static final int MODE_NORM = 1; |
|
75 |
|
|
73 | 76 |
public static final int COLOR_YELLOW = 0xffffff00; |
74 | 77 |
public static final int COLOR_WHITE = 0xffffffff; |
75 | 78 |
public static final int COLOR_BLUE = 0xff0000ff; |
... | ... | |
143 | 146 |
private int[][] mCubitFaceColors; |
144 | 147 |
private int[][] mVariantFaceIsOuter; |
145 | 148 |
private int[] mBasicAngles; |
149 |
private int mIconMode; |
|
146 | 150 |
|
147 | 151 |
//////////////////// SOLVED1 //////////////////////// |
148 | 152 |
|
... | ... | |
152 | 156 |
|
153 | 157 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
154 | 158 |
|
155 |
TwistyObject(InputStream jsonStream, int meshState, Static4D quat, Static3D move, float scale, InputStream meshStream) |
|
159 |
TwistyObject(InputStream jsonStream, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream meshStream)
|
|
156 | 160 |
{ |
157 | 161 |
JsonReader reader = JsonReader.getInstance(); |
158 | 162 |
reader.parseJsonFile(jsonStream); |
... | ... | |
160 | 164 |
|
161 | 165 |
mNumLayers = reader.getNumLayers(); |
162 | 166 |
mSize = reader.getSize(); |
163 |
initialize(meshState,quat,move,scale,meshStream,true); |
|
167 |
initialize(meshState,iconMode,quat,move,scale,meshStream,true);
|
|
164 | 168 |
} |
165 | 169 |
|
166 | 170 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
167 | 171 |
|
168 |
TwistyObject(int[] numLayers, int meshState, float size, Static4D quat, Static3D move, float scale, InputStream meshStream) |
|
172 |
TwistyObject(int[] numLayers, int meshState, int iconMode, float size, Static4D quat, Static3D move, float scale, InputStream meshStream)
|
|
169 | 173 |
{ |
170 | 174 |
mNumLayers = numLayers; |
171 | 175 |
mSize = size; |
172 |
initialize(meshState,quat,move,scale,meshStream,false); |
|
176 |
initialize(meshState,iconMode,quat,move,scale,meshStream,false);
|
|
173 | 177 |
} |
174 | 178 |
|
175 | 179 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
176 | 180 |
|
177 |
private void initialize(int meshState,Static4D quat, Static3D move, float scale, InputStream stream, boolean fromJSON) |
|
181 |
private void initialize(int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream, boolean fromJSON)
|
|
178 | 182 |
{ |
183 |
mIconMode = iconMode; |
|
179 | 184 |
mQuat = quat; |
180 | 185 |
mAxis = getRotationAxis(); |
181 | 186 |
mInitScreenRatio = getScreenRatio(); |
... | ... | |
450 | 455 |
return mQuatMult[index1][index2]; |
451 | 456 |
} |
452 | 457 |
|
458 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
459 |
|
|
460 |
public boolean isInIconMode() |
|
461 |
{ |
|
462 |
return mIconMode==MODE_ICON; |
|
463 |
} |
|
464 |
|
|
453 | 465 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
454 | 466 |
|
455 | 467 |
public int getVariantFaceColor(int variant, int face) |
src/main/java/org/distorted/objectlib/objects/TwistyAxis.java | ||
---|---|---|
24 | 24 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
25 | 25 |
import org.distorted.objectlib.helpers.ObjectShape; |
26 | 26 |
import org.distorted.objectlib.scrambling.ScrambleState; |
27 |
import org.distorted.objectlib.main.ObjectControl; |
|
28 | 27 |
import org.distorted.objectlib.main.ObjectType; |
29 | 28 |
import org.distorted.objectlib.main.ShapeHexahedron; |
30 | 29 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
... | ... | |
53 | 52 |
|
54 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
55 | 54 |
|
56 |
public TwistyAxis(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
55 |
public TwistyAxis(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
57 | 56 |
{ |
58 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
57 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
59 | 58 |
} |
60 | 59 |
|
61 | 60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
364 | 363 |
|
365 | 364 |
public ObjectFaceShape getObjectFaceShape(int variant) |
366 | 365 |
{ |
366 |
float height = isInIconMode() ? 0.001f : 0.025f; |
|
367 |
|
|
367 | 368 |
if( variant==0 ) |
368 | 369 |
{ |
369 |
float[][] bands = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
|
|
370 |
float[][] bands = { {height,20,0.2f,0.4f,5,1,0}, {0.001f,20,0.2f,0.4f,5,1,0} };
|
|
370 | 371 |
int[] bandIndices = { 0,0,1,1,1,1,1 }; |
371 | 372 |
float[][] corners = { {0.04f,0.09f} }; |
372 | 373 |
int[] indices = { 0,0,0,0,-1,-1,-1,-1 }; |
... | ... | |
375 | 376 |
} |
376 | 377 |
else if( variant==1 ) |
377 | 378 |
{ |
378 |
float[][] bands = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
|
|
379 |
float[][] bands = { {height,20,0.2f,0.4f,5,1,0}, {0.001f,20,0.2f,0.4f,5,1,0} };
|
|
379 | 380 |
int[] bandIndices = { 0,1,1,1,1 }; |
380 | 381 |
float[][] corners = { {0.04f,0.09f} }; |
381 | 382 |
int[] indices = { 0,0,0,0,-1,-1 }; |
... | ... | |
384 | 385 |
} |
385 | 386 |
else if( variant==2 ) |
386 | 387 |
{ |
387 |
float[][] bands = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
|
|
388 |
float[][] bands = { {height,20,0.2f,0.4f,5,1,0}, {0.001f,20,0.2f,0.4f,5,1,0} };
|
|
388 | 389 |
int[] bandIndices = { 0,0,1,1,1,1 }; |
389 | 390 |
float[][] corners = { {0.04f,0.09f} }; |
390 | 391 |
int[] indices = { 0,0,0,0,-1,-1 }; |
... | ... | |
393 | 394 |
} |
394 | 395 |
else if( variant==3 ) |
395 | 396 |
{ |
396 |
float[][] bands = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
|
|
397 |
float[][] bands = { {height,20,0.2f,0.4f,5,1,0}, {0.001f,20,0.2f,0.4f,5,1,0} };
|
|
397 | 398 |
int[] bandIndices = { 0,0,1,1,1,1 }; |
398 | 399 |
float[][] corners = { {0.04f,0.09f} }; |
399 | 400 |
int[] indices = { 0,0,0,0,-1,-1 }; |
... | ... | |
402 | 403 |
} |
403 | 404 |
else if( variant==4 ) |
404 | 405 |
{ |
405 |
float[][] bands = { {0.025f,20,0.2f,0.4f,5,1,0}, {0.005f,20,0.2f,0.4f,5,1,0} };
|
|
406 |
float[][] bands = { {height,20,0.2f,0.4f,5,1,0}, {0.001f,20,0.2f,0.4f,5,1,0} };
|
|
406 | 407 |
int[] bandIndices = { 0,0,0,1,1,1 }; |
407 | 408 |
float[][] corners = { {0.03f,0.08f} }; |
408 | 409 |
int[] indices = { 0,0,0,0,-1 }; |
... | ... | |
411 | 412 |
} |
412 | 413 |
else |
413 | 414 |
{ |
414 |
float[][] bands = { {0.05f,35,0.25f,0.7f,5,1,0}, {0.01f,35,0.25f,0.7f,5,1,0} }; |
|
415 |
float h1 = isInIconMode() ? 0.001f : 0.05f; |
|
416 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
417 |
float[][] bands = { {h1,35,0.25f,0.7f,5,1,0}, {h2,35,0.25f,0.7f,5,1,0} }; |
|
415 | 418 |
int[] bandIndices = { 0,1,1,1 }; |
416 | 419 |
float[][] corners = { {0.04f,0.12f} }; |
417 | 420 |
int[] indices = { 0,0,0,-1 }; |
... | ... | |
451 | 454 |
|
452 | 455 |
public float getStickerStroke() |
453 | 456 |
{ |
454 |
return ObjectControl.isInIconMode() ? 0.22f : 0.10f;
|
|
457 |
return isInIconMode() ? 0.22f : 0.10f; |
|
455 | 458 |
} |
456 | 459 |
|
457 | 460 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyBandaged2Bar.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
public class TwistyBandaged2Bar extends TwistyBandagedAbstract |
32 | 32 |
{ |
33 |
public TwistyBandaged2Bar(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
33 |
public TwistyBandaged2Bar(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
34 | 34 |
{ |
35 |
super(numL, meshState, quat, move, scale, stream); |
|
35 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyBandaged3Plate.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
public class TwistyBandaged3Plate extends TwistyBandagedAbstract |
32 | 32 |
{ |
33 |
public TwistyBandaged3Plate(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
33 |
public TwistyBandaged3Plate(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
34 | 34 |
{ |
35 |
super(numL, meshState, quat, move, scale, stream); |
|
35 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyBandagedAbstract.java | ||
---|---|---|
33 | 33 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
34 | 34 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 35 |
import org.distorted.objectlib.scrambling.ScrambleState; |
36 |
import org.distorted.objectlib.main.ObjectControl; |
|
37 | 36 |
import org.distorted.objectlib.main.ShapeHexahedron; |
38 | 37 |
|
39 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
75 | 74 |
|
76 | 75 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
77 | 76 |
|
78 |
TwistyBandagedAbstract(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
77 |
TwistyBandagedAbstract(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
79 | 78 |
{ |
80 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
79 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
81 | 80 |
} |
82 | 81 |
|
83 | 82 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
350 | 349 |
int Y = mDims[type][1]; |
351 | 350 |
int Z = mDims[type][2]; |
352 | 351 |
|
353 |
float defHeight = 0.048f;
|
|
352 |
float height = isInIconMode() ? 0.001f : 0.048f;
|
|
354 | 353 |
int[] bandIndices = { 0,0,1,1,2,2 }; |
355 | 354 |
float[][] corners = { {0.04f,0.15f} }; |
356 | 355 |
int[] cornerIndices = { 0,0,0,0,0,0,0,0 }; |
... | ... | |
362 | 361 |
|
363 | 362 |
float[][] bands = |
364 | 363 |
{ |
365 |
{defHeight/maxYZ,45,0.25f,0.5f,5,1,1},
|
|
366 |
{defHeight/maxXZ,45,0.25f,0.5f,5,1,1},
|
|
367 |
{defHeight/maxXY,45,0.25f,0.5f,5,1,1}
|
|
364 |
{height/maxYZ,45,0.25f,0.5f,5,1,1},
|
|
365 |
{height/maxXZ,45,0.25f,0.5f,5,1,1},
|
|
366 |
{height/maxXY,45,0.25f,0.5f,5,1,1}
|
|
368 | 367 |
}; |
369 | 368 |
|
370 | 369 |
float[][] centers = |
... | ... | |
383 | 382 |
} |
384 | 383 |
|
385 | 384 |
FactoryBandaged3x3Cubit factory = FactoryBandaged3x3Cubit.getInstance(); |
386 |
return factory.createIrregularFaceShape(variant); |
|
385 |
return factory.createIrregularFaceShape(variant, isInIconMode() );
|
|
387 | 386 |
} |
388 | 387 |
|
389 | 388 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
556 | 555 |
|
557 | 556 |
public float getStickerStroke() |
558 | 557 |
{ |
559 |
return ObjectControl.isInIconMode() ? 0.16f : 0.08f;
|
|
558 |
return isInIconMode() ? 0.16f : 0.08f; |
|
560 | 559 |
} |
561 | 560 |
|
562 | 561 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyBandagedBiCube.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
public class TwistyBandagedBiCube extends TwistyBandagedAbstract |
32 | 32 |
{ |
33 |
public TwistyBandagedBiCube(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
33 |
public TwistyBandagedBiCube(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
34 | 34 |
{ |
35 |
super(numL, meshState, quat, move, scale, stream); |
|
35 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyBandagedFused.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
public class TwistyBandagedFused extends TwistyBandagedAbstract |
32 | 32 |
{ |
33 |
public TwistyBandagedFused(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
33 |
public TwistyBandagedFused(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
34 | 34 |
{ |
35 |
super(numL, meshState, quat, move, scale, stream); |
|
35 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
36 | 36 |
} |
37 | 37 |
|
38 | 38 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyBandagedGeneric.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
35 | 35 |
|
36 |
public TwistyBandagedGeneric(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
36 |
public TwistyBandagedGeneric(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
37 | 37 |
{ |
38 |
super(numL, meshState, quat, move, scale, stream); |
|
38 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
39 | 39 |
} |
40 | 40 |
|
41 | 41 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
42 | 42 |
|
43 | 43 |
public TwistyBandagedGeneric() |
44 | 44 |
{ |
45 |
super( new int[] {3,3,3}, MESH_NICE, new Static4D(0,0,0,1), new Static3D(0,0,0), 1.0f, null); |
|
45 |
super( new int[] {3,3,3}, MESH_NICE, MODE_NORM, new Static4D(0,0,0,1), new Static3D(0,0,0), 1.0f, null);
|
|
46 | 46 |
} |
47 | 47 |
|
48 | 48 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyContainer.java | ||
---|---|---|
26 | 26 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
27 | 27 |
import org.distorted.objectlib.helpers.ObjectShape; |
28 | 28 |
import org.distorted.objectlib.scrambling.ScrambleState; |
29 |
import org.distorted.objectlib.main.ObjectControl; |
|
30 | 29 |
import org.distorted.objectlib.main.ObjectType; |
31 | 30 |
import org.distorted.objectlib.main.ShapeHexahedron; |
32 | 31 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
... | ... | |
53 | 52 |
|
54 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
55 | 54 |
|
56 |
public TwistyContainer(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
55 |
public TwistyContainer(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
57 | 56 |
{ |
58 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
57 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
59 | 58 |
} |
60 | 59 |
|
61 | 60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
245 | 244 |
{ |
246 | 245 |
if( variant==0 ) |
247 | 246 |
{ |
248 |
float[][] bands = { {0.05f,35,0.26f,0.7f,5,1,1}, {0.01f,15,0.1f,0.7f,5,1,1} }; |
|
247 |
float h1 = isInIconMode() ? 0.001f : 0.05f; |
|
248 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
249 |
float[][] bands = { {h1,35,0.26f,0.7f,5,1,1}, {h2,15,0.1f,0.7f,5,1,1} }; |
|
249 | 250 |
int[] bandIndices = { 0,1,1,1,1 }; |
250 | 251 |
float[][] corners = { {0.03f,0.20f} }; |
251 | 252 |
int[] indices = { 0,0,0,0,-1 }; |
... | ... | |
254 | 255 |
} |
255 | 256 |
else if( variant==1 ) |
256 | 257 |
{ |
257 |
float[][] bands = { {0.04f,25,0.26f,0.7f,5,1,1}, {0.01f,15,0.1f,0.7f,5,1,1} }; |
|
258 |
float h1 = isInIconMode() ? 0.001f : 0.04f; |
|
259 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
260 |
float[][] bands = { {h1,25,0.26f,0.7f,5,1,1}, {h2,15,0.1f,0.7f,5,1,1} }; |
|
258 | 261 |
int[] bandIndices = { 0,0,1,1,1,1 }; |
259 | 262 |
float[][] corners = { {0.03f,0.20f} }; |
260 | 263 |
int[] indices = { -1,0,0,0,0 }; |
... | ... | |
263 | 266 |
} |
264 | 267 |
else |
265 | 268 |
{ |
266 |
float[][] bands = { {0.05f,35,0.26f,0.7f,5,1,1}, {0.01f,15,0.1f,0.7f,5,1,1} }; |
|
269 |
float h1 = isInIconMode() ? 0.001f : 0.05f; |
|
270 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
271 |
float[][] bands = { {h1,35,0.26f,0.7f,5,1,1}, {h2,15,0.1f,0.7f,5,1,1} }; |
|
267 | 272 |
int[] bandIndices = { 0,1,1,1 }; |
268 | 273 |
float[][] corners = { {0.03f,0.20f} }; |
269 | 274 |
int[] indices = { 0,0,0,-1 }; |
... | ... | |
297 | 302 |
|
298 | 303 |
public float getStickerStroke() |
299 | 304 |
{ |
300 |
return ObjectControl.isInIconMode() ? 0.20f : 0.06f;
|
|
305 |
return isInIconMode() ? 0.20f : 0.06f; |
|
301 | 306 |
} |
302 | 307 |
|
303 | 308 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyCrystal.java | ||
---|---|---|
25 | 25 |
import org.distorted.library.type.Static4D; |
26 | 26 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
27 | 27 |
import org.distorted.objectlib.helpers.ObjectShape; |
28 |
import org.distorted.objectlib.main.ObjectControl; |
|
29 | 28 |
import org.distorted.objectlib.main.ObjectType; |
30 | 29 |
|
31 | 30 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
40 | 39 |
|
41 | 40 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
42 | 41 |
|
43 |
public TwistyCrystal(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
42 |
public TwistyCrystal(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
44 | 43 |
{ |
45 |
super(numL, meshState, quat, move, scale, stream); |
|
44 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
46 | 45 |
} |
47 | 46 |
|
48 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
159 | 158 |
{ |
160 | 159 |
if( variant==0 ) |
161 | 160 |
{ |
162 |
float[][] bands = { {0.03f,17,0.5f,0.2f,5,1,0}, {0.01f, 1,0.5f,0.2f,5,1,0} }; |
|
161 |
float h1 = isInIconMode() ? 0.001f : 0.03f; |
|
162 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
163 |
float[][] bands = { {h1,17,0.5f,0.2f,5,1,0}, {h2, 1,0.5f,0.2f,5,1,0} }; |
|
163 | 164 |
int[] bandIndices = { 0,0,1,1 }; |
164 | 165 |
float[][] corners = { { 0.015f, 0.20f } }; |
165 | 166 |
int[] cornerIndices = { 0,0,0,0 }; |
... | ... | |
169 | 170 |
} |
170 | 171 |
else |
171 | 172 |
{ |
172 |
float[][] bands = { {0.03f,17,0.5f,0.2f,5,1,0}, {0.01f, 1,0.5f,0.2f,5,1,0}, {0.01f, 1,0.5f,0.2f,3,0,0} }; |
|
173 |
float h1 = isInIconMode() ? 0.001f : 0.03f; |
|
174 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
175 |
float[][] bands = { {h1,17,0.5f,0.2f,5,1,0}, {h2, 1,0.5f,0.2f,5,1,0}, {h2, 1,0.5f,0.2f,3,0,0} }; |
|
173 | 176 |
int[] bandIndices = { 0,0,0,1,1,1,2 }; |
174 | 177 |
float[][] corners = { { 0.01f, 0.20f } }; |
175 | 178 |
int[] cornerIndices = { 0,0,0,0,0,0,0 }; |
... | ... | |
218 | 221 |
|
219 | 222 |
public float getStickerStroke() |
220 | 223 |
{ |
221 |
return ObjectControl.isInIconMode() ? 0.22f : 0.15f;
|
|
224 |
return isInIconMode() ? 0.22f : 0.15f; |
|
222 | 225 |
} |
223 | 226 |
|
224 | 227 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 | 31 |
import org.distorted.objectlib.touchcontrol.TouchControlCuboids; |
32 |
import org.distorted.objectlib.main.ObjectControl; |
|
33 | 32 |
import org.distorted.objectlib.main.ObjectType; |
34 | 33 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 34 |
import org.distorted.objectlib.scrambling.ScrambleState; |
... | ... | |
52 | 51 |
|
53 | 52 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
54 | 53 |
|
55 |
public TwistyCuboid(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
54 |
public TwistyCuboid(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
56 | 55 |
{ |
57 |
super(numL, meshState, (numL[0]+numL[1]+numL[2])/3.0f, quat, move, scale, stream); |
|
56 |
super(numL, meshState, iconMode, (numL[0]+numL[1]+numL[2])/3.0f, quat, move, scale, stream);
|
|
58 | 57 |
} |
59 | 58 |
|
60 | 59 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
238 | 237 |
{ |
239 | 238 |
int[] bandIndices; |
240 | 239 |
int extraI, extraV, num, numL = getNumLayers()[0]; |
241 |
float height; |
|
240 |
float height = isInIconMode() ? 0.001f : 0.045f;
|
|
242 | 241 |
|
243 | 242 |
switch(numL) |
244 | 243 |
{ |
245 |
case 2 : num = 6; extraI = 2; extraV = 2; height = 0.045f; break;
|
|
246 |
case 3 : num = 5; extraI = 2; extraV = 2; height = 0.045f; break;
|
|
247 |
case 4 : num = 5; extraI = 1; extraV = 1; height = 0.045f; break;
|
|
248 |
default: num = 5; extraI = 0; extraV = 0; height = 0.045f; break;
|
|
244 |
case 2 : num = 6; extraI = 2; extraV = 2; break; |
|
245 |
case 3 : num = 5; extraI = 2; extraV = 2; break; |
|
246 |
case 4 : num = 5; extraI = 1; extraV = 1; break; |
|
247 |
default: num = 5; extraI = 0; extraV = 0; break; |
|
249 | 248 |
} |
250 | 249 |
|
251 | 250 |
float[][] corners= { {0.036f,0.12f} }; |
... | ... | |
621 | 620 |
{ |
622 | 621 |
float stroke = 0.08f; |
623 | 622 |
|
624 |
if( ObjectControl.isInIconMode() )
|
|
623 |
if( isInIconMode() ) |
|
625 | 624 |
{ |
626 | 625 |
int[] numLayers = getNumLayers(); |
627 | 626 |
|
src/main/java/org/distorted/objectlib/objects/TwistyDiamond.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 | 31 |
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron; |
32 |
import org.distorted.objectlib.main.ObjectControl; |
|
33 | 32 |
import org.distorted.objectlib.main.ObjectType; |
34 | 33 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 34 |
import org.distorted.objectlib.scrambling.ScrambleState; |
... | ... | |
55 | 54 |
|
56 | 55 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
57 | 56 |
|
58 |
public TwistyDiamond(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
57 |
public TwistyDiamond(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
59 | 58 |
{ |
60 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
59 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
61 | 60 |
} |
62 | 61 |
|
63 | 62 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
389 | 388 |
int numL = getNumLayers()[0]; |
390 | 389 |
int N = numL>3 ? 5:6; |
391 | 390 |
int E = numL>2 ? (numL>3 ? 0:1) : 2; |
391 |
float height = isInIconMode() ? 0.001f : 0.05f; |
|
392 | 392 |
|
393 | 393 |
if( variant==0 ) |
394 | 394 |
{ |
395 |
float[][] bands = { {0.05f,20,0.5f,0.8f,N,E,E} };
|
|
395 |
float[][] bands = { {height,20,0.5f,0.8f,N,E,E} };
|
|
396 | 396 |
int[] bandIndices = { 0,0,0,0,0,0,0,0 }; |
397 | 397 |
float[][] corners = { {0.04f,0.20f} }; |
398 | 398 |
int[] cornerIndices = { 0,0,0,0,0,0 }; |
... | ... | |
402 | 402 |
} |
403 | 403 |
else |
404 | 404 |
{ |
405 |
float[][] bands = { {0.05f,35,0.5f,0.8f,N,E,E} };
|
|
405 |
float[][] bands = { {height,35,0.5f,0.8f,N,E,E} };
|
|
406 | 406 |
int[] bandIndices = { 0,0,0,0 }; |
407 | 407 |
float[][] corners = { {0.08f,0.15f} }; |
408 | 408 |
int[] cornerIndices = { 0,0,0,0 }; |
... | ... | |
439 | 439 |
{ |
440 | 440 |
float stroke = 0.08f; |
441 | 441 |
|
442 |
if( ObjectControl.isInIconMode() )
|
|
442 |
if( isInIconMode() ) |
|
443 | 443 |
{ |
444 | 444 |
int[] numLayers = getNumLayers(); |
445 | 445 |
|
src/main/java/org/distorted/objectlib/objects/TwistyDino.java | ||
---|---|---|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 | 31 |
import org.distorted.objectlib.helpers.ObjectShape; |
32 | 32 |
import org.distorted.objectlib.scrambling.ScrambleState; |
33 |
import org.distorted.objectlib.main.ObjectControl; |
|
34 | 33 |
import org.distorted.objectlib.main.ShapeHexahedron; |
35 | 34 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
36 | 35 |
|
... | ... | |
54 | 53 |
|
55 | 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
56 | 55 |
|
57 |
TwistyDino(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
56 |
TwistyDino(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
58 | 57 |
{ |
59 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
58 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
60 | 59 |
} |
61 | 60 |
|
62 | 61 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
174 | 173 |
|
175 | 174 |
public ObjectFaceShape getObjectFaceShape(int variant) |
176 | 175 |
{ |
177 |
float[][] bands = { {0.035f,30,0.16f,0.8f,6,2,2}, {0.010f,30,0.16f,0.2f,6,2,2} }; |
|
176 |
float h1 = isInIconMode() ? 0.001f : 0.035f; |
|
177 |
float h2 = isInIconMode() ? 0.001f : 0.010f; |
|
178 |
float[][] bands = { {h1,30,0.16f,0.8f,6,2,2}, {h2,30,0.16f,0.2f,6,2,2} }; |
|
178 | 179 |
int[] bandIndices = { 0,0,1,1 }; |
179 | 180 |
float[][] corners = { {0.07f,0.40f}, {0.05f,0.30f} }; |
180 | 181 |
int[] cornerIndices = { 0,0,1,1 }; |
... | ... | |
208 | 209 |
|
209 | 210 |
public float getStickerStroke() |
210 | 211 |
{ |
211 |
return ObjectControl.isInIconMode() ? 0.22f : 0.15f;
|
|
212 |
return isInIconMode() ? 0.22f : 0.15f; |
|
212 | 213 |
} |
213 | 214 |
|
214 | 215 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyDino4.java | ||
---|---|---|
35 | 35 |
|
36 | 36 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
37 | 37 |
|
38 |
public TwistyDino4(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
38 |
public TwistyDino4(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
39 | 39 |
{ |
40 |
super(numL, meshState, quat, move, scale, stream); |
|
40 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
41 | 41 |
} |
42 | 42 |
|
43 | 43 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyDino6.java | ||
---|---|---|
31 | 31 |
|
32 | 32 |
public class TwistyDino6 extends TwistyDino |
33 | 33 |
{ |
34 |
public TwistyDino6(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
34 |
public TwistyDino6(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
35 | 35 |
{ |
36 |
super(numL, meshState, quat, move, scale, stream); |
|
36 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyFisher.java | ||
---|---|---|
24 | 24 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
25 | 25 |
import org.distorted.objectlib.helpers.ObjectShape; |
26 | 26 |
import org.distorted.objectlib.scrambling.ScrambleState; |
27 |
import org.distorted.objectlib.main.ObjectControl; |
|
28 | 27 |
import org.distorted.objectlib.main.ObjectType; |
29 | 28 |
import org.distorted.objectlib.main.ShapeHexahedron; |
30 | 29 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
... | ... | |
53 | 52 |
|
54 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
55 | 54 |
|
56 |
public TwistyFisher(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
55 |
public TwistyFisher(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
57 | 56 |
{ |
58 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
57 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
59 | 58 |
} |
60 | 59 |
|
61 | 60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
307 | 306 |
if( variant==0 ) |
308 | 307 |
{ |
309 | 308 |
final float A = (3-SQ2)/2; |
310 |
|
|
311 |
float[][] bands = { {0.025f,20,0.2f,0.4f,5,1,1}, {0.02f,20,0.2f,0.4f,5,1,1} }; |
|
309 |
float h1 = isInIconMode() ? 0.001f : 0.025f; |
|
310 |
float h2 = isInIconMode() ? 0.001f : 0.020f; |
|
311 |
float[][] bands = { {h1,20,0.2f,0.4f,5,1,1}, {h2,20,0.2f,0.4f,5,1,1} }; |
|
312 | 312 |
int[] bandIndices = { 0,0,0,1,1 }; |
313 | 313 |
float[][] corners = { {0.04f,0.09f} }; |
314 | 314 |
int[] indices = { 0,0,0,0,-1,-1 }; |
... | ... | |
318 | 318 |
else if( variant==1 ) |
319 | 319 |
{ |
320 | 320 |
final float B = SQ2/2; |
321 |
|
|
322 |
float[][] bands = { {0.025f,20,0.2f,0.4f,5,1,1}, {0.02f,20,0.2f,0.4f,5,1,1} }; |
|
321 |
float h1 = isInIconMode() ? 0.001f : 0.025f; |
|
322 |
float h2 = isInIconMode() ? 0.001f : 0.020f; |
|
323 |
float[][] bands = { {h1,20,0.2f,0.4f,5,1,1}, {h2,20,0.2f,0.4f,5,1,1} }; |
|
323 | 324 |
int[] bandIndices = { 0,0,0,1,1,1,0 }; |
324 | 325 |
float[][] corners = { {0.03f,0.09f} }; |
325 | 326 |
int[] indices = { 0,0,-1,-1,0,0,0,-1,-1,0 }; |
... | ... | |
328 | 329 |
} |
329 | 330 |
else |
330 | 331 |
{ |
331 |
float[][] bands = { {0.05f,35,0.25f,0.7f,5,1,0}, {0.04f,35,0.25f,0.7f,5,1,0} }; |
|
332 |
float h1 = isInIconMode() ? 0.001f : 0.05f; |
|
333 |
float h2 = isInIconMode() ? 0.001f : 0.04f; |
|
334 |
float[][] bands = { {h1,35,0.25f,0.7f,5,1,0}, {h2,35,0.25f,0.7f,5,1,0} }; |
|
332 | 335 |
int[] bandIndices = { 1,0,0,1,1,1 }; |
333 | 336 |
float[][] corners = { {0.04f,0.12f} }; |
334 | 337 |
int[] indices = { 0,0,0,0,0,0,0,0 }; |
... | ... | |
362 | 365 |
|
363 | 366 |
public float getStickerStroke() |
364 | 367 |
{ |
365 |
return ObjectControl.isInIconMode() ? 0.22f : 0.10f;
|
|
368 |
return isInIconMode() ? 0.22f : 0.10f; |
|
366 | 369 |
} |
367 | 370 |
|
368 | 371 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyHelicopter.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 | 31 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
32 |
import org.distorted.objectlib.main.ObjectControl; |
|
33 | 32 |
import org.distorted.objectlib.main.ObjectType; |
34 | 33 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 34 |
import org.distorted.objectlib.scrambling.ScrambleState; |
... | ... | |
57 | 56 |
|
58 | 57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
59 | 58 |
|
60 |
public TwistyHelicopter(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
59 |
public TwistyHelicopter(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
61 | 60 |
{ |
62 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
61 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
63 | 62 |
} |
64 | 63 |
|
65 | 64 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
241 | 240 |
|
242 | 241 |
public ObjectFaceShape getObjectFaceShape(int variant) |
243 | 242 |
{ |
243 |
float height = isInIconMode() ? 0.001f : 0.028f; |
|
244 |
|
|
244 | 245 |
if( variant==0 ) |
245 | 246 |
{ |
246 |
float[][] bands = { {0.028f,35,0.16f,0.7f,7,3,3}, {0.000f, 0,1.00f,0.0f,3,1,5} };
|
|
247 |
float[][] bands = { {height,35,0.16f,0.7f,7,3,3}, {0.001f, 0,1.00f,0.0f,3,1,5} };
|
|
247 | 248 |
int[] bandIndices = { 0,0,0,1,1,1 }; |
248 | 249 |
float[][] corners = { {0.08f,0.20f} }; |
249 | 250 |
int[] cornerIndices = { 0,0,0,0,0 }; |
... | ... | |
253 | 254 |
} |
254 | 255 |
else |
255 | 256 |
{ |
256 |
float[][] bands = { {0.028f,35,0.16f,0.7f,7,3,3}, {0.000f, 0,1.00f,0.0f,3,1,3} };
|
|
257 |
float[][] bands = { {height,35,0.16f,0.7f,7,3,3}, {0.001f, 0,1.00f,0.0f,3,1,3} };
|
|
257 | 258 |
int[] bandIndices = { 0,1,1,1 }; |
258 | 259 |
float[][] corners = { {0.06f,0.20f} }; |
259 | 260 |
int[] cornerIndices = { 0,0,0,-1 }; |
... | ... | |
288 | 289 |
|
289 | 290 |
public float getStickerStroke() |
290 | 291 |
{ |
291 |
return ObjectControl.isInIconMode() ? 0.20f : 0.10f;
|
|
292 |
return isInIconMode() ? 0.20f : 0.10f; |
|
292 | 293 |
} |
293 | 294 |
|
294 | 295 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyIvy.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 | 31 |
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron; |
32 |
import org.distorted.objectlib.main.ObjectControl; |
|
33 | 32 |
import org.distorted.objectlib.main.ObjectType; |
34 | 33 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 34 |
import org.distorted.objectlib.scrambling.ScrambleState; |
... | ... | |
57 | 56 |
|
58 | 57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
59 | 58 |
|
60 |
public TwistyIvy(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
59 |
public TwistyIvy(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
61 | 60 |
{ |
62 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
61 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
63 | 62 |
} |
64 | 63 |
|
65 | 64 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
320 | 319 |
{ |
321 | 320 |
if( variant==0 ) |
322 | 321 |
{ |
322 |
float height = isInIconMode() ? 0.001f : 0.015f; |
|
323 | 323 |
float[][] centers = { {-1.0f,-1.0f,-1.0f} }; |
324 | 324 |
float[][] corners = { {0.04f,0.20f}, {0.03f,0.20f} }; |
325 |
float[][] bands = { {+0.015f,20,0.2f,0.5f,7,1,2}, {0.001f,1,0.2f,0.0f,2,0,0} };
|
|
325 |
float[][] bands = { {height,20,0.2f,0.5f,7,1,2}, {0.001f,1,0.2f,0.0f,2,0,0} };
|
|
326 | 326 |
|
327 | 327 |
int[] cornerIndices= new int[3*(IVY_N+1)+5]; |
328 | 328 |
int[] centerIndices= new int[3*(IVY_N+1)+5]; |
... | ... | |
358 | 358 |
} |
359 | 359 |
else |
360 | 360 |
{ |
361 |
float h1 = isInIconMode() ? 0.001f : 0.03f; |
|
362 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
361 | 363 |
float[][] corners= { {0.04f,0.20f} }; |
362 | 364 |
float[][] centers= { {-0.0f,-0.0f,-1.0f} }; |
363 |
float[][] bands = { { 0.03f,35,0.5f,0.5f,5,0,0}, {0.01f,1,0.5f,0.8f,2,0,0} };
|
|
365 |
float[][] bands = { { h1,35,0.5f,0.5f,5,0,0}, {h2,1,0.5f,0.8f,2,0,0} };
|
|
364 | 366 |
|
365 | 367 |
int[] bandIndices= new int[2*IVY_N+1]; |
366 | 368 |
int[] indexes = new int[2*IVY_N+1]; |
... | ... | |
401 | 403 |
|
402 | 404 |
public float getStickerStroke() |
403 | 405 |
{ |
404 |
return ObjectControl.isInIconMode() ? 0.16f : 0.12f;
|
|
406 |
return isInIconMode() ? 0.16f : 0.12f; |
|
405 | 407 |
} |
406 | 408 |
|
407 | 409 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyJing.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 | 31 |
import org.distorted.objectlib.touchcontrol.TouchControlTetrahedron; |
32 |
import org.distorted.objectlib.main.ObjectControl; |
|
33 | 32 |
import org.distorted.objectlib.main.ObjectType; |
34 | 33 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 34 |
import org.distorted.objectlib.scrambling.ScrambleState; |
... | ... | |
59 | 58 |
|
60 | 59 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
61 | 60 |
|
62 |
public TwistyJing(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
61 |
public TwistyJing(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
63 | 62 |
{ |
64 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
63 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
65 | 64 |
} |
66 | 65 |
|
67 | 66 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
273 | 272 |
|
274 | 273 |
if( variant==0 ) |
275 | 274 |
{ |
276 |
float[][] bands = { {0.015f,35,0.25f*F,0.5f*F,5,1,1},{0.001f,35,0.25f*F,0.5f*F,5,1,1} }; |
|
275 |
float height = isInIconMode() ? 0.001f : 0.015f; |
|
276 |
float[][] bands = { {height,35,0.25f*F,0.5f*F,5,1,1},{0.001f,35,0.25f*F,0.5f*F,5,1,1} }; |
|
277 | 277 |
int[] bandIndices = { 0,0,0,1,1,1 }; |
278 | 278 |
float[][] corners = { {0.08f,0.20f*F},{0.07f,0.20f*F} }; |
279 | 279 |
int[] cornerIndices = { 0,1,1,-1,1,-1,-1,-1 }; |
... | ... | |
283 | 283 |
} |
284 | 284 |
else if( variant==1 ) |
285 | 285 |
{ |
286 |
float[][] bands = { {0.015f,35,0.5f*F,F,5,1,1},{0.001f,35,0.5f*F,F,5,1,1} }; |
|
286 |
float height = isInIconMode() ? 0.001f : 0.015f; |
|
287 |
float[][] bands = { {height,35,0.5f*F,F,5,1,1},{0.001f,35,0.5f*F,F,5,1,1} }; |
|
287 | 288 |
int[] bandIndices = { 0,0,1,1,1,1 }; |
288 | 289 |
float[][] corners = { {0.07f,0.20f*F} }; |
289 | 290 |
int[] cornerIndices = { 0,0,-1,0,0,0,-1,0 }; |
... | ... | |
293 | 294 |
} |
294 | 295 |
else |
295 | 296 |
{ |
296 |
float[][] bands = { {0.020f,35,0.20f*L,0.6f*L,5,1,1}, {0.001f,35,0.05f*L,0.1f*L,5,1,1} }; |
|
297 |
float height = isInIconMode() ? 0.001f : 0.020f; |
|
298 |
float[][] bands = { {height,35,0.20f*L,0.6f*L,5,1,1}, {0.001f,35,0.05f*L,0.1f*L,5,1,1} }; |
|
297 | 299 |
int[] bandIndices = { 0,1,1,1,1,1 }; |
298 | 300 |
float[][] corners = { {0.04f,0.6f*F} }; |
299 | 301 |
int[] cornerIndices = { 0,0,0,-1,-1,-1 }; |
... | ... | |
328 | 330 |
|
329 | 331 |
public float getStickerStroke() |
330 | 332 |
{ |
331 |
return ObjectControl.isInIconMode() ? 0.08f : 0.04f;
|
|
333 |
return isInIconMode() ? 0.08f : 0.04f; |
|
332 | 334 |
} |
333 | 335 |
|
334 | 336 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyKilominx.java | ||
---|---|---|
29 | 29 |
import org.distorted.library.main.QuatHelper; |
30 | 30 |
|
31 | 31 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
32 |
import org.distorted.objectlib.main.ObjectControl; |
|
33 | 32 |
import org.distorted.objectlib.main.ObjectType; |
34 | 33 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 34 |
|
... | ... | |
37 | 36 |
|
38 | 37 |
public class TwistyKilominx extends TwistyMinx |
39 | 38 |
{ |
40 |
public TwistyKilominx(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
39 |
public TwistyKilominx(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
41 | 40 |
{ |
42 |
super(numL, meshState, quat, move, scale, stream); |
|
41 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
43 | 42 |
} |
44 | 43 |
|
45 | 44 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
443 | 442 |
{ |
444 | 443 |
float A = (2*SQ3/3)*SIN54; |
445 | 444 |
float B = 0.4f; |
445 |
float h1 = isInIconMode() ? 0.001f : 0.04f; |
|
446 | 446 |
|
447 |
float[][] bands = { {0.04f,34,0.3f,0.2f, 3, 0, 0}, {0.00f,34,0.0f,0.0f, 2, 0, 0} };
|
|
447 |
float[][] bands = { {h1,34,0.3f,0.2f, 3, 0, 0}, {0.001f,34,0.0f,0.0f, 2, 0, 0} };
|
|
448 | 448 |
int[] bandIndices = { 0,0,0,1,1,1}; |
449 | 449 |
float[][] corners = { {0.04f,0.10f} }; |
450 | 450 |
int[] cornerIndices = { 0,-1,-1,-1,-1,-1,-1,-1 }; |
... | ... | |
463 | 463 |
int E = small ? 1 : 0; |
464 | 464 |
int N0 = small ? 4 : 3; |
465 | 465 |
int N1 = small ? 3 : 2; |
466 |
float h1 = isInIconMode() ? 0.001f : 0.04f; |
|
466 | 467 |
|
467 |
float[][] bands = { {0.04f,34,0.2f,0.2f,N0,E,E}, {0.00f,34,0.0f,0.0f,N1,0,0} };
|
|
468 |
float[][] bands = { {h1,34,0.2f,0.2f,N0,E,E}, {0.001f,34,0.0f,0.0f,N1,0,0} };
|
|
468 | 469 |
int[] bandIndices = { 0,0,1,1,1,1}; |
469 | 470 |
float[][] corners = { {0.04f,0.10f} }; |
470 | 471 |
int[] cornerIndices = { 0,-1,-1,-1, 0,-1,-1,-1 }; |
... | ... | |
479 | 480 |
float B = 0.4f; |
480 | 481 |
int N = small ? 4 : 3; |
481 | 482 |
int E = small ? 1 : 0; |
483 |
float h1 = isInIconMode() ? 0.001f : 0.04f; |
|
484 |
float h2 = isInIconMode() ? 0.001f : 0.01f; |
|
482 | 485 |
|
483 |
float[][] bands = { {0.04f,17,0.3f,0.2f,N,E,E},{0.01f,17,0.3f,0.2f,N,E,E} };
|
|
486 |
float[][] bands = { {h1,17,0.3f,0.2f,N,E,E},{h2,17,0.3f,0.2f,N,E,E} };
|
|
484 | 487 |
int[] bandIndices = { 0,0,0,1,1,1}; |
485 | 488 |
float[][] corners = { {0.03f,0.10f} }; |
486 | 489 |
int[] cornerIndices = { 0, 0,-1, 0, 0,-1,-1,-1 }; |
... | ... | |
537 | 540 |
{ |
538 | 541 |
float stroke = 0.25f; |
539 | 542 |
|
540 |
if( ObjectControl.isInIconMode() )
|
|
543 |
if( isInIconMode() ) |
|
541 | 544 |
{ |
542 | 545 |
int[] numLayers = getNumLayers(); |
543 | 546 |
if( numLayers[0]>3 ) stroke*=1.5f; |
src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java | ||
---|---|---|
29 | 29 |
import org.distorted.library.main.QuatHelper; |
30 | 30 |
|
31 | 31 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
32 |
import org.distorted.objectlib.main.ObjectControl; |
|
33 | 32 |
import org.distorted.objectlib.main.ObjectType; |
34 | 33 |
import org.distorted.objectlib.helpers.ObjectShape; |
35 | 34 |
|
... | ... | |
42 | 41 |
|
43 | 42 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
44 | 43 |
|
45 |
public TwistyMegaminx(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
44 |
public TwistyMegaminx(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
46 | 45 |
{ |
47 |
super(numL, meshState, quat, move, scale, stream); |
|
46 |
super(numL, meshState, iconMode, quat, move, scale, stream);
|
|
48 | 47 |
} |
49 | 48 |
|
50 | 49 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
377 | 376 |
{ |
378 | 377 |
float A = (2*SQ3/3)*SIN54; |
379 | 378 |
float B = 0.4f; |
379 |
float h1 = isInIconMode() ? 0.001f : 0.04f; |
|
380 | 380 |
|
381 |
float[][] bands = { {0.04f,34,0.3f,0.2f, 3, 0, 0}, {0.00f, 0,0.0f,0.0f, 2, 0, 0} };
|
|
381 |
float[][] bands = { {h1,34,0.3f,0.2f, 3, 0, 0}, {0.001f, 10,0.0f,0.0f, 2, 0, 0} };
|
|
382 | 382 |
int[] bandIndices = { 0,0,0,1,1,1}; |
383 | 383 |
float[][] corners = { {0.04f,0.10f} }; |
384 | 384 |
int[] cornerIndices = { 0,-1,-1,-1,-1,-1,-1,-1 }; |
... | ... | |
392 | 392 |
float height= numL*(0.5f-MEGA_D)*COS18/((numL-1)*0.5f); |
393 | 393 |
float Z = height*COS_HALFD; |
394 | 394 |
int N = small ? 5 : 3; |
395 |
float h1 = isInIconMode() ? 0.001f : 0.04f; |
|
395 | 396 |
|
396 |
float[][] bands = { {0.04f,34,0.2f,0.2f,N,0,0},{0.00f,34,0.3f,0.2f,2,0,0} };
|
|
397 |
float[][] bands = { {h1,34,0.2f,0.2f,N,0,0},{0.001f,34,0.3f,0.2f,2,0,0} };
|
|
397 | 398 |
int[] bandIndices = { 0,0,1,1,1,1}; |
398 | 399 |
float[][] corners = { {0.04f,0.10f} }; |
399 | 400 |
int[] cornerIndices = { -1,-1,-1,-1, -1,-1,-1,-1 }; |
... | ... | |
407 | 408 |
float width = 2*numL*(MEGA_D+(0.5f-MEGA_D)*SIN18); |
408 | 409 |
float R = 0.5f*width/COS54; |
409 | 410 |
int N = small ? 4 : 3; |
410 |
float h = small ? 0.04f : 0.015f;
|
|
411 |
float h1 = isInIconMode() ? 0.001f : (small ? 0.04f : 0.015f);
|
|
411 | 412 |
|
412 |
float[][] bands = { { h,45, R/3,0.2f,N,0,0},{0.00f,45, R/3,0.2f,2,0,0} };
|
|
413 |
float[][] bands = { { h1,45, R/3,0.2f,N,0,0},{0.001f,45, R/3,0.2f,2,0,0} };
|
|
413 | 414 |
int[] bandIndices = { 0,1,1,1,1,1 }; |
414 | 415 |
float[][] corners = { {0.04f,0.10f} }; |
415 | 416 |
int[] cornerIndices = { -1,-1,-1,-1, -1,-1 }; |
... | ... | |
460 | 461 |
{ |
461 | 462 |
float stroke = 0.18f; |
462 | 463 |
|
463 |
if( ObjectControl.isInIconMode() )
|
|
464 |
if( isInIconMode() ) |
|
464 | 465 |
{ |
465 | 466 |
int[] numLayers = getNumLayers(); |
466 | 467 |
stroke*= ( numLayers[0]==3 ? 1.5f : 2.2f ); |
src/main/java/org/distorted/objectlib/objects/TwistyMinx.java | ||
---|---|---|
67 | 67 |
|
68 | 68 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
69 | 69 |
|
70 |
TwistyMinx(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
70 |
TwistyMinx(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
71 | 71 |
{ |
72 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
72 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/objectlib/objects/TwistyMirror.java | ||
---|---|---|
28 | 28 |
import org.distorted.library.type.Static4D; |
29 | 29 |
|
30 | 30 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
31 |
import org.distorted.objectlib.main.ObjectControl; |
|
32 | 31 |
import org.distorted.objectlib.main.ObjectType; |
33 | 32 |
import org.distorted.objectlib.helpers.ObjectShape; |
34 | 33 |
import org.distorted.objectlib.scrambling.ScrambleState; |
... | ... | |
58 | 57 |
|
59 | 58 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
60 | 59 |
|
61 |
public TwistyMirror(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
60 |
public TwistyMirror(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
62 | 61 |
{ |
63 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
62 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
64 | 63 |
} |
65 | 64 |
|
66 | 65 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
228 | 227 |
public ObjectFaceShape getObjectFaceShape(int variant) |
229 | 228 |
{ |
230 | 229 |
int extraI, extraV, num, numL = getNumLayers()[0]; |
231 |
float height; |
|
230 |
float height = isInIconMode() ? 0.001f : 0.045f;
|
|
232 | 231 |
|
233 | 232 |
switch(numL) |
234 | 233 |
{ |
235 |
case 2 : num = 6; extraI = 2; extraV = 2; height = 0.045f; break;
|
|
236 |
case 3 : num = 5; extraI = 2; extraV = 2; height = 0.045f; break;
|
|
237 |
case 4 : num = 5; extraI = 0; extraV = 0; height = 0.045f; break;
|
|
238 |
default: num = 4; extraI = 0; extraV = 0; height = 0.045f; break;
|
|
234 |
case 2 : num = 6; extraI = 2; extraV = 2; break; |
|
235 |
case 3 : num = 5; extraI = 2; extraV = 2; break; |
|
236 |
case 4 : num = 5; extraI = 0; extraV = 0; break; |
|
237 |
default: num = 4; extraI = 0; extraV = 0; break; |
|
239 | 238 |
} |
240 | 239 |
|
241 | 240 |
float[][] bands = { {height,35,0.5f,0.7f,num,extraI,extraV} }; |
... | ... | |
343 | 342 |
{ |
344 | 343 |
float stroke = 0.08f; |
345 | 344 |
|
346 |
if( ObjectControl.isInIconMode() )
|
|
345 |
if( isInIconMode() ) |
|
347 | 346 |
{ |
348 | 347 |
int[] numLayers = getNumLayers(); |
349 | 348 |
stroke*= ( numLayers[0]==2 ? 1.8f : 2.0f ); |
src/main/java/org/distorted/objectlib/objects/TwistyMorphix.java | ||
---|---|---|
24 | 24 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
25 | 25 |
import org.distorted.objectlib.helpers.ObjectShape; |
26 | 26 |
import org.distorted.objectlib.scrambling.ScrambleState; |
27 |
import org.distorted.objectlib.main.ObjectControl; |
|
28 | 27 |
import org.distorted.objectlib.main.ObjectType; |
29 | 28 |
import org.distorted.objectlib.main.ShapeTetrahedron; |
30 | 29 |
import org.distorted.objectlib.touchcontrol.TouchControlTetrahedron; |
... | ... | |
53 | 52 |
|
54 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
55 | 54 |
|
56 |
public TwistyMorphix(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream) |
|
55 |
public TwistyMorphix(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
|
57 | 56 |
{ |
58 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
|
57 |
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
|
59 | 58 |
} |
60 | 59 |
|
61 | 60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
212 | 211 |
|
213 | 212 |
public ObjectFaceShape getObjectFaceShape(int variant) |
214 | 213 |
{ |
214 |
float height = isInIconMode() ? 0.001f : 0.03f; |
|
215 |
|
|
215 | 216 |
if( variant==0 ) |
216 | 217 |
{ |
217 |
float[][] bands = { {0.03f,30,0.15f,0.5f,5,1,2}, {0.001f,30,0.2f,0.4f,5,1,2} }; |
|
218 |
float[][] bands = { {height,30,0.15f,0.5f,5,1,2}, {0.001f,30,0.2f,0.4f,5,1,2} }; |
Also available in: Unified diff
Mode the 'iconMode' from static variable in ObjectControl to member varaible in TwistyObject (safer)