Revision 09ec03a8
Added by Leszek Koltunski 11 months ago
src/main/java/org/distorted/objectlib/objects/TwistyPenrose.java | ||
---|---|---|
106 | 106 |
|
107 | 107 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
108 | 108 |
// here we cannot automatically detect the outer monochromatic walls -> use the old way. |
109 |
/* |
|
109 |
|
|
110 | 110 |
@Override |
111 | 111 |
public int getSolvedFunctionIndex() |
112 | 112 |
{ |
113 | 113 |
return 0; |
114 | 114 |
} |
115 |
*/ |
|
116 |
|
|
117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
118 |
// here we define 3 artificial monochromatic 'surfaces' - one each for one of the external colors. |
|
119 |
|
|
120 |
private static final float[][] mMonoSurfaces = |
|
121 |
{ |
|
122 |
{ 0, 1, 1, 1 }, |
|
123 |
{ 1, 0,-1, 1 }, |
|
124 |
{-1,-1, 0, 1 }, |
|
125 |
}; |
|
126 |
|
|
127 |
@Override |
|
128 |
public float[] getMonochromaticSurface(int variant, int cubitIndex, int faceIndex, float px, float py, float pz) |
|
129 |
{ |
|
130 |
int color = getCubitFaceMap(cubitIndex,faceIndex); |
|
131 |
|
|
132 |
switch(color) |
|
133 |
{ |
|
134 |
case 0: return mMonoSurfaces[1]; // yellow |
|
135 |
case 2: return mMonoSurfaces[2]; // blue |
|
136 |
case 4: return mMonoSurfaces[0]; // red |
|
137 |
} |
|
138 |
|
|
139 |
return null; |
|
140 |
} |
|
141 | 115 |
|
142 | 116 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
143 | 117 |
|
Also available in: Unified diff
Come back to the old, 3-way solved state detection.