Revision 538ee7a6
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/objects/TwistyBandagedFused.java | ||
---|---|---|
24 | 24 |
import org.distorted.library.main.DistortedEffects; |
25 | 25 |
import org.distorted.library.main.DistortedTexture; |
26 | 26 |
import org.distorted.library.mesh.MeshSquare; |
27 |
import org.distorted.library.type.Static3D; |
|
28 | 27 |
import org.distorted.library.type.Static4D; |
29 | 28 |
import org.distorted.main.R; |
30 | 29 |
|
31 | 30 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
32 | 31 |
|
33 |
class TwistyBandagedFused extends TwistyBandagedCube
|
|
32 |
class TwistyBandagedFused extends TwistyBandagedAbstract
|
|
34 | 33 |
{ |
35 | 34 |
TwistyBandagedFused(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh, |
36 | 35 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth) |
... | ... | |
38 | 37 |
super(size, quat, texture, mesh, effects, moves, ObjectList.BAN1, res, scrWidth); |
39 | 38 |
} |
40 | 39 |
|
41 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
42 |
|
|
43 |
int getNumCubitVariants() |
|
44 |
{ |
|
45 |
return 2; |
|
46 |
} |
|
47 |
|
|
48 | 40 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
49 | 41 |
|
50 | 42 |
int getCubitVariant(int cubit) |
51 | 43 |
{ |
52 |
return cubit==0 ? 0:1;
|
|
44 |
return cubit==0 ? 4:0;
|
|
53 | 45 |
} |
54 | 46 |
|
55 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
61 | 53 |
|
62 | 54 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
63 | 55 |
|
64 |
int[] getCubitDimensions(int variant) |
|
65 |
{ |
|
66 |
return variant==0 ? new int[] {2,2,2} : new int[] {1,1,1}; |
|
67 |
} |
|
68 |
|
|
69 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
70 |
|
|
71 |
Static3D getCubitPosition(int cubit) |
|
56 |
float[] getCubitPosition(int cubit) |
|
72 | 57 |
{ |
73 | 58 |
switch(cubit) |
74 | 59 |
{ |
75 |
case 0: return new Static3D(-0.5f, -0.5f, +0.5f);
|
|
76 |
case 1: return new Static3D(-1.0f, +1.0f, +1.0f);
|
|
77 |
case 2: return new Static3D(-1.0f, +1.0f, +0.0f);
|
|
78 |
case 3: return new Static3D(-1.0f, +1.0f, -1.0f);
|
|
79 |
case 4: return new Static3D( 0.0f, +1.0f, +1.0f);
|
|
80 |
case 5: return new Static3D( 0.0f, +1.0f, +0.0f);
|
|
81 |
case 6: return new Static3D( 0.0f, +1.0f, -1.0f);
|
|
82 |
case 7: return new Static3D( 1.0f, +1.0f, +1.0f);
|
|
83 |
case 8: return new Static3D( 1.0f, +1.0f, +0.0f);
|
|
84 |
case 9: return new Static3D( 1.0f, +1.0f, -1.0f);
|
|
85 |
case 10: return new Static3D( 1.0f, 0.0f, +1.0f);
|
|
86 |
case 11: return new Static3D( 1.0f, 0.0f, +0.0f);
|
|
87 |
case 12: return new Static3D( 1.0f, 0.0f, -1.0f);
|
|
88 |
case 13: return new Static3D( 1.0f, -1.0f, +1.0f);
|
|
89 |
case 14: return new Static3D( 1.0f, -1.0f, +0.0f);
|
|
90 |
case 15: return new Static3D( 1.0f, -1.0f, -1.0f);
|
|
91 |
case 16: return new Static3D(-1.0f, -1.0f, -1.0f);
|
|
92 |
case 17: return new Static3D(-1.0f, 0.0f, -1.0f);
|
|
93 |
case 18: return new Static3D( 0.0f, -1.0f, -1.0f);
|
|
94 |
case 19: return new Static3D( 0.0f, 0.0f, -1.0f);
|
|
60 |
case 0: return new float[] {-0.5f, -0.5f, +0.5f};
|
|
61 |
case 1: return new float[] {-1.0f, +1.0f, +1.0f};
|
|
62 |
case 2: return new float[] {-1.0f, +1.0f, +0.0f};
|
|
63 |
case 3: return new float[] {-1.0f, +1.0f, -1.0f};
|
|
64 |
case 4: return new float[] { 0.0f, +1.0f, +1.0f};
|
|
65 |
case 5: return new float[] { 0.0f, +1.0f, +0.0f};
|
|
66 |
case 6: return new float[] { 0.0f, +1.0f, -1.0f};
|
|
67 |
case 7: return new float[] { 1.0f, +1.0f, +1.0f};
|
|
68 |
case 8: return new float[] { 1.0f, +1.0f, +0.0f};
|
|
69 |
case 9: return new float[] { 1.0f, +1.0f, -1.0f};
|
|
70 |
case 10: return new float[] { 1.0f, 0.0f, +1.0f};
|
|
71 |
case 11: return new float[] { 1.0f, 0.0f, +0.0f};
|
|
72 |
case 12: return new float[] { 1.0f, 0.0f, -1.0f};
|
|
73 |
case 13: return new float[] { 1.0f, -1.0f, +1.0f};
|
|
74 |
case 14: return new float[] { 1.0f, -1.0f, +0.0f};
|
|
75 |
case 15: return new float[] { 1.0f, -1.0f, -1.0f};
|
|
76 |
case 16: return new float[] {-1.0f, -1.0f, -1.0f};
|
|
77 |
case 17: return new float[] {-1.0f, 0.0f, -1.0f};
|
|
78 |
case 18: return new float[] { 0.0f, -1.0f, -1.0f};
|
|
79 |
case 19: return new float[] { 0.0f, 0.0f, -1.0f};
|
|
95 | 80 |
} |
96 | 81 |
|
97 | 82 |
return null; |
... | ... | |
106 | 91 |
|
107 | 92 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
108 | 93 |
// PUBLIC API |
109 |
// TODO |
|
110 | 94 |
|
111 | 95 |
public int getObjectName(int numLayers) |
112 | 96 |
{ |
113 |
switch(numLayers) |
|
114 |
{ |
|
115 |
case 2: return R.string.cube2; |
|
116 |
case 3: return R.string.cube3; |
|
117 |
case 4: return R.string.cube4; |
|
118 |
case 5: return R.string.cube5; |
|
119 |
} |
|
120 |
return R.string.cube3; |
|
97 |
return R.string.bandaged_fused; |
|
121 | 98 |
} |
122 | 99 |
|
123 | 100 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
124 |
// TODO |
|
125 | 101 |
|
126 | 102 |
public int getInventor(int numLayers) |
127 | 103 |
{ |
128 |
switch(numLayers) |
|
129 |
{ |
|
130 |
case 2: return R.string.cube2_inventor; |
|
131 |
case 3: return R.string.cube3_inventor; |
|
132 |
case 4: return R.string.cube4_inventor; |
|
133 |
case 5: return R.string.cube5_inventor; |
|
134 |
} |
|
135 |
return R.string.cube3_inventor; |
|
104 |
return R.string.bandaged_fused_inventor; |
|
136 | 105 |
} |
137 | 106 |
|
138 | 107 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Progress with bandaged cubes.