Revision 3ede7593
Added by Leszek Koltunski 9 months ago
src/main/java/org/distorted/objectlib/bandaged/BandagedObjectMegaminx.java | ||
---|---|---|
141 | 141 |
|
142 | 142 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
143 | 143 |
|
144 |
float[][][] getPositions() |
|
145 |
{ |
|
146 |
FactoryBandagedMegaminx factory = FactoryBandagedMegaminx.getInstance(); |
|
147 |
return factory.getPositions(mSize); |
|
148 |
} |
|
149 |
|
|
150 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
151 |
|
|
152 |
float getDist2D() |
|
153 |
{ |
|
154 |
return (SIN54/COS54)/2; |
|
155 |
} |
|
156 |
|
|
157 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
158 |
|
|
159 |
int[] getColors() |
|
160 |
{ |
|
161 |
return ShapeDodecahedron.FACE_COLORS; |
|
162 |
} |
|
163 |
|
|
164 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
165 |
|
|
166 |
boolean isAdjacent(float dx, float dy, float dz) |
|
144 |
public static boolean isAdjacent(int size, float dx, float dy, float dz) |
|
167 | 145 |
{ |
168 | 146 |
float len = dx*dx + dy*dy + dz*dz; |
169 | 147 |
float MAXERR = 0.01f; |
170 | 148 |
|
171 |
switch(mSize[0])
|
|
149 |
switch(size)
|
|
172 | 150 |
{ |
173 |
case 2: float x2_0 = 3.01f;
|
|
151 |
case 2: float x2_0 = 2.01f;
|
|
174 | 152 |
return len<=x2_0*x2_0; |
175 | 153 |
|
176 | 154 |
case 3: float x3_0 = 1.51f*(SIN54/COS54); |
177 | 155 |
return len<=x3_0*x3_0; |
178 | 156 |
|
179 |
case 4: float x4_0 = 1.00f;
|
|
157 |
case 4: float x4_0 = 1.0f; |
|
180 | 158 |
float x4_1 = 2.00f; |
181 | 159 |
float x4_2 = 2.00f*(1+SIN18); |
182 | 160 |
float d4_0 = len-x4_0*x4_0; |
... | ... | |
208 | 186 |
return false; |
209 | 187 |
} |
210 | 188 |
|
189 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
190 |
|
|
191 |
float[][][] getPositions() |
|
192 |
{ |
|
193 |
FactoryBandagedMegaminx factory = FactoryBandagedMegaminx.getInstance(); |
|
194 |
return factory.getPositions(mSize); |
|
195 |
} |
|
196 |
|
|
197 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
198 |
|
|
199 |
float getDist2D() |
|
200 |
{ |
|
201 |
return (SIN54/COS54)/2; |
|
202 |
} |
|
203 |
|
|
204 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
205 |
|
|
206 |
int[] getColors() |
|
207 |
{ |
|
208 |
return ShapeDodecahedron.FACE_COLORS; |
|
209 |
} |
|
210 |
|
|
211 |
|
|
212 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
213 |
|
|
214 |
boolean isAdjacent(float dx, float dy, float dz) |
|
215 |
{ |
|
216 |
return isAdjacent(mSize[0],dx,dy,dz); |
|
217 |
} |
|
218 |
|
|
211 | 219 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
212 | 220 |
|
213 | 221 |
MeshBase createMesh(float[] pos, boolean round) |
Also available in: Unified diff
progress with TwistyBandagedMegaminx.