aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-13 04:16:16 +0000
committerTeravus Ovares2008-05-13 04:16:16 +0000
commite70da2e174eb537015ca56aa8762707c7f6c12ca (patch)
tree106cbe4fffdbca98cbdd1c231e95fc997a1a25ee /OpenSim
parent* Refactor: Creating grid login exceptions to try and break up a large method. (diff)
downloadopensim-SC_OLD-e70da2e174eb537015ca56aa8762707c7f6c12ca.zip
opensim-SC_OLD-e70da2e174eb537015ca56aa8762707c7f6c12ca.tar.gz
opensim-SC_OLD-e70da2e174eb537015ca56aa8762707c7f6c12ca.tar.bz2
opensim-SC_OLD-e70da2e174eb537015ca56aa8762707c7f6c12ca.tar.xz
* Committing meshmerizer patch from Dahlia. Thanks Dahlia!
* 0001241: physics cylinder proxy distorted and square hollow misaligned (patch attached) * The included patch corrects the outer shell of the meshmerizer proxy for the cylinder prim to eliminate spurious vertices and shape distortion, and corrects the orientation of the square hollow. * The size and orientation of the square hollow for the prism prim has been corrected also.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs454
1 files changed, 269 insertions, 185 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 1d2f986..1d719ed 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.Physics.Meshing
56 // Setting baseDir to a path will enable the dumping of raw files 56 // Setting baseDir to a path will enable the dumping of raw files
57 // raw files can be imported by blender so a visual inspection of the results can be done 57 // raw files can be imported by blender so a visual inspection of the results can be done
58 // const string baseDir = "rawFiles"; 58 // const string baseDir = "rawFiles";
59 private const string baseDir = null; //"rawFiles"; 59 private const string baseDir = "rawFiles";
60 private const float DEG_TO_RAD = 0.01745329238f; 60 private const float DEG_TO_RAD = 0.01745329238f;
61 61
62// TODO: unused 62// TODO: unused
@@ -219,11 +219,32 @@ namespace OpenSim.Region.Physics.Meshing
219 if (hshape == HollowShape.Square) 219 if (hshape == HollowShape.Square)
220 { 220 {
221 float hollowFactorF = (float)fhollowFactor / (float)50000; 221 float hollowFactorF = (float)fhollowFactor / (float)50000;
222 Vertex IMM = new Vertex(-0.5f * hollowFactorF, -0.5f * hollowFactorF, 0.0f); 222 Vertex IMM;
223 Vertex IPM = new Vertex(+0.5f * hollowFactorF, -0.5f * hollowFactorF, 0.0f); 223 Vertex IPM;
224 Vertex IPP = new Vertex(+0.5f * hollowFactorF, +0.5f * hollowFactorF, 0.0f); 224 Vertex IPP;
225 Vertex IMP = new Vertex(-0.5f * hollowFactorF, +0.5f * hollowFactorF, 0.0f); 225 Vertex IMP;
226 226
227 if (pshape == ProfileShape.Circle)
228 { // square cutout in cylinder is 45 degress rotated
229 IMM = new Vertex(0.0f, -0.707f * hollowFactorF, 0.0f);
230 IPM = new Vertex(0.707f * hollowFactorF, 0.0f, 0.0f);
231 IPP = new Vertex(0.0f, 0.707f * hollowFactorF, 0.0f);
232 IMP = new Vertex(-0.707f * hollowFactorF, 0.0f, 0.0f);
233 }
234 else if (pshape == ProfileShape.EquilateralTriangle)
235 {
236 IMM = new Vertex(0.0f, -0.667f * hollowFactorF, 0.0f);
237 IPM = new Vertex(0.667f * hollowFactorF, 0.0f, 0.0f);
238 IPP = new Vertex(0.0f, 0.667f * hollowFactorF, 0.0f);
239 IMP = new Vertex(-0.667f * hollowFactorF, 0.0f, 0.0f);
240 }
241 else
242 {
243 IMM = new Vertex(-0.5f * hollowFactorF, -0.5f * hollowFactorF, 0.0f);
244 IPM = new Vertex(+0.5f * hollowFactorF, -0.5f * hollowFactorF, 0.0f);
245 IPP = new Vertex(+0.5f * hollowFactorF, +0.5f * hollowFactorF, 0.0f);
246 IMP = new Vertex(-0.5f * hollowFactorF, +0.5f * hollowFactorF, 0.0f);
247 }
227 248
228 holeHull = new SimpleHull(); 249 holeHull = new SimpleHull();
229 250
@@ -236,97 +257,124 @@ namespace OpenSim.Region.Physics.Meshing
236 { 257 {
237 float hollowFactorF = (float)fhollowFactor / (float)50000; 258 float hollowFactorF = (float)fhollowFactor / (float)50000;
238 259
239 Vertex IQ1Q15 = new Vertex(-0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f); 260 //Vertex IQ1Q15 = new Vertex(-0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f);
240 Vertex IQ1Q16 = new Vertex(-0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f); 261 //Vertex IQ1Q16 = new Vertex(-0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f);
241 Vertex IQ1Q17 = new Vertex(-0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f); 262 //Vertex IQ1Q17 = new Vertex(-0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f);
242 Vertex IQ1Q18 = new Vertex(-0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f); 263 //Vertex IQ1Q18 = new Vertex(-0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f);
243 Vertex IQ1Q19 = new Vertex(-0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f); 264 //Vertex IQ1Q19 = new Vertex(-0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f);
244 265
245 Vertex IQ2Q10 = new Vertex(+0.0f * hollowFactorF, -0.50f * hollowFactorF, 0.0f); 266 //Vertex IQ2Q10 = new Vertex(+0.0f * hollowFactorF, -0.50f * hollowFactorF, 0.0f);
246 Vertex IQ2Q11 = new Vertex(+0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f); 267 //Vertex IQ2Q11 = new Vertex(+0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f);
247 Vertex IQ2Q12 = new Vertex(+0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f); 268 //Vertex IQ2Q12 = new Vertex(+0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f);
248 Vertex IQ2Q13 = new Vertex(+0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f); 269 //Vertex IQ2Q13 = new Vertex(+0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f);
249 Vertex IQ2Q14 = new Vertex(+0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f); 270 //Vertex IQ2Q14 = new Vertex(+0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f);
250 Vertex IQ2Q15 = new Vertex(+0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f); 271 //Vertex IQ2Q15 = new Vertex(+0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f);
251 Vertex IQ2Q16 = new Vertex(+0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f); 272 //Vertex IQ2Q16 = new Vertex(+0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f);
252 Vertex IQ2Q17 = new Vertex(+0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f); 273 //Vertex IQ2Q17 = new Vertex(+0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f);
253 Vertex IQ2Q18 = new Vertex(+0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f); 274 //Vertex IQ2Q18 = new Vertex(+0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f);
254 Vertex IQ2Q19 = new Vertex(+0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f); 275 //Vertex IQ2Q19 = new Vertex(+0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f);
255 276
256 Vertex IQ2Q20 = new Vertex(+0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f); 277 //Vertex IQ2Q20 = new Vertex(+0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f);
257 Vertex IQ2Q21 = new Vertex(+0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f); 278 //Vertex IQ2Q21 = new Vertex(+0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f);
258 Vertex IQ2Q22 = new Vertex(+0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f); 279 //Vertex IQ2Q22 = new Vertex(+0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f);
259 Vertex IQ2Q23 = new Vertex(+0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f); 280 //Vertex IQ2Q23 = new Vertex(+0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f);
260 Vertex IQ2Q24 = new Vertex(+0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f); 281 //Vertex IQ2Q24 = new Vertex(+0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f);
261 Vertex IQ2Q25 = new Vertex(+0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f); 282 //Vertex IQ2Q25 = new Vertex(+0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f);
262 Vertex IQ2Q26 = new Vertex(+0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f); 283 //Vertex IQ2Q26 = new Vertex(+0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f);
263 Vertex IQ2Q27 = new Vertex(+0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f); 284 //Vertex IQ2Q27 = new Vertex(+0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f);
264 Vertex IQ2Q28 = new Vertex(+0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f); 285 //Vertex IQ2Q28 = new Vertex(+0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f);
265 Vertex IQ2Q29 = new Vertex(+0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f); 286 //Vertex IQ2Q29 = new Vertex(+0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f);
266 287
267 Vertex IQ1Q20 = new Vertex(+0.0f * hollowFactorF, +0.50f * hollowFactorF, 0.0f); 288 //Vertex IQ1Q20 = new Vertex(+0.0f * hollowFactorF, +0.50f * hollowFactorF, 0.0f);
268 Vertex IQ1Q21 = new Vertex(-0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f); 289 //Vertex IQ1Q21 = new Vertex(-0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f);
269 Vertex IQ1Q22 = new Vertex(-0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f); 290 //Vertex IQ1Q22 = new Vertex(-0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f);
270 Vertex IQ1Q23 = new Vertex(-0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f); 291 //Vertex IQ1Q23 = new Vertex(-0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f);
271 Vertex IQ1Q24 = new Vertex(-0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f); 292 //Vertex IQ1Q24 = new Vertex(-0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f);
272 Vertex IQ1Q25 = new Vertex(-0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f); 293 //Vertex IQ1Q25 = new Vertex(-0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f);
273 Vertex IQ1Q26 = new Vertex(-0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f); 294 //Vertex IQ1Q26 = new Vertex(-0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f);
274 Vertex IQ1Q27 = new Vertex(-0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f); 295 //Vertex IQ1Q27 = new Vertex(-0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f);
275 Vertex IQ1Q28 = new Vertex(-0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f); 296 //Vertex IQ1Q28 = new Vertex(-0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f);
276 Vertex IQ1Q29 = new Vertex(-0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f); 297 //Vertex IQ1Q29 = new Vertex(-0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f);
277 298
278 Vertex IQ1Q10 = new Vertex(-0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f); 299 //Vertex IQ1Q10 = new Vertex(-0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f);
279 Vertex IQ1Q11 = new Vertex(-0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f); 300 //Vertex IQ1Q11 = new Vertex(-0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f);
280 Vertex IQ1Q12 = new Vertex(-0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f); 301 //Vertex IQ1Q12 = new Vertex(-0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f);
281 Vertex IQ1Q13 = new Vertex(-0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f); 302 //Vertex IQ1Q13 = new Vertex(-0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f);
282 Vertex IQ1Q14 = new Vertex(-0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f); 303 //Vertex IQ1Q14 = new Vertex(-0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f);
283 304
284 //Counter clockwise around the quadrants 305 //Counter clockwise around the quadrants
285 holeHull = new SimpleHull(); 306 holeHull = new SimpleHull();
286 holeHull.AddVertex(IQ1Q15); 307 //holeHull.AddVertex(IQ1Q15);
287 holeHull.AddVertex(IQ1Q14); 308 //holeHull.AddVertex(IQ1Q14);
288 holeHull.AddVertex(IQ1Q13); 309 //holeHull.AddVertex(IQ1Q13);
289 holeHull.AddVertex(IQ1Q12); 310 //holeHull.AddVertex(IQ1Q12);
290 holeHull.AddVertex(IQ1Q11); 311 //holeHull.AddVertex(IQ1Q11);
291 holeHull.AddVertex(IQ1Q10); 312 //holeHull.AddVertex(IQ1Q10);
292 313
293 holeHull.AddVertex(IQ1Q29); 314 //holeHull.AddVertex(IQ1Q29);
294 holeHull.AddVertex(IQ1Q28); 315 //holeHull.AddVertex(IQ1Q28);
295 holeHull.AddVertex(IQ1Q27); 316 //holeHull.AddVertex(IQ1Q27);
296 holeHull.AddVertex(IQ1Q26); 317 //holeHull.AddVertex(IQ1Q26);
297 holeHull.AddVertex(IQ1Q25); 318 //holeHull.AddVertex(IQ1Q25);
298 holeHull.AddVertex(IQ1Q24); 319 //holeHull.AddVertex(IQ1Q24);
299 holeHull.AddVertex(IQ1Q23); 320 //holeHull.AddVertex(IQ1Q23);
300 holeHull.AddVertex(IQ1Q22); 321 //holeHull.AddVertex(IQ1Q22);
301 holeHull.AddVertex(IQ1Q21); 322 //holeHull.AddVertex(IQ1Q21);
302 holeHull.AddVertex(IQ1Q20); 323 //holeHull.AddVertex(IQ1Q20);
303 324
304 holeHull.AddVertex(IQ2Q29); 325 //holeHull.AddVertex(IQ2Q29);
305 holeHull.AddVertex(IQ2Q28); 326 //holeHull.AddVertex(IQ2Q28);
306 holeHull.AddVertex(IQ2Q27); 327 //holeHull.AddVertex(IQ2Q27);
307 holeHull.AddVertex(IQ2Q26); 328 //holeHull.AddVertex(IQ2Q26);
308 holeHull.AddVertex(IQ2Q25); 329 //holeHull.AddVertex(IQ2Q25);
309 holeHull.AddVertex(IQ2Q24); 330 //holeHull.AddVertex(IQ2Q24);
310 holeHull.AddVertex(IQ2Q23); 331 //holeHull.AddVertex(IQ2Q23);
311 holeHull.AddVertex(IQ2Q22); 332 //holeHull.AddVertex(IQ2Q22);
312 holeHull.AddVertex(IQ2Q21); 333 //holeHull.AddVertex(IQ2Q21);
313 holeHull.AddVertex(IQ2Q20); 334 //holeHull.AddVertex(IQ2Q20);
314 335
315 holeHull.AddVertex(IQ2Q19); 336 //holeHull.AddVertex(IQ2Q19);
316 holeHull.AddVertex(IQ2Q18); 337 //holeHull.AddVertex(IQ2Q18);
317 holeHull.AddVertex(IQ2Q17); 338 //holeHull.AddVertex(IQ2Q17);
318 holeHull.AddVertex(IQ2Q16); 339 //holeHull.AddVertex(IQ2Q16);
319 holeHull.AddVertex(IQ2Q15); 340 //holeHull.AddVertex(IQ2Q15);
320 holeHull.AddVertex(IQ2Q14); 341 //holeHull.AddVertex(IQ2Q14);
321 holeHull.AddVertex(IQ2Q13); 342 //holeHull.AddVertex(IQ2Q13);
322 holeHull.AddVertex(IQ2Q12); 343 //holeHull.AddVertex(IQ2Q12);
323 holeHull.AddVertex(IQ2Q11); 344 //holeHull.AddVertex(IQ2Q11);
324 holeHull.AddVertex(IQ2Q10); 345 //holeHull.AddVertex(IQ2Q10);
325 346
326 holeHull.AddVertex(IQ1Q19); 347 //holeHull.AddVertex(IQ1Q19);
327 holeHull.AddVertex(IQ1Q18); 348 //holeHull.AddVertex(IQ1Q18);
328 holeHull.AddVertex(IQ1Q17); 349 //holeHull.AddVertex(IQ1Q17);
329 holeHull.AddVertex(IQ1Q16); 350 //holeHull.AddVertex(IQ1Q16);
351
352 holeHull.AddVertex(new Vertex(0.353553f * hollowFactorF, 0.353553f * hollowFactorF, 0.0f)); // 45 degrees
353 holeHull.AddVertex(new Vertex(0.433013f * hollowFactorF, 0.250000f * hollowFactorF, 0.0f)); // 30 degrees
354 holeHull.AddVertex(new Vertex(0.482963f * hollowFactorF, 0.129410f * hollowFactorF, 0.0f)); // 15 degrees
355 holeHull.AddVertex(new Vertex(0.500000f * hollowFactorF, 0.000000f * hollowFactorF, 0.0f)); // 0 degrees
356 holeHull.AddVertex(new Vertex(0.482963f * hollowFactorF, -0.129410f * hollowFactorF, 0.0f)); // 345 degrees
357 holeHull.AddVertex(new Vertex(0.433013f * hollowFactorF, -0.250000f * hollowFactorF, 0.0f)); // 330 degrees
358 holeHull.AddVertex(new Vertex(0.353553f * hollowFactorF, -0.353553f * hollowFactorF, 0.0f)); // 315 degrees
359 holeHull.AddVertex(new Vertex(0.250000f * hollowFactorF, -0.433013f * hollowFactorF, 0.0f)); // 300 degrees
360 holeHull.AddVertex(new Vertex(0.129410f * hollowFactorF, -0.482963f * hollowFactorF, 0.0f)); // 285 degrees
361 holeHull.AddVertex(new Vertex(0.000000f * hollowFactorF, -0.500000f * hollowFactorF, 0.0f)); // 270 degrees
362 holeHull.AddVertex(new Vertex(-0.129410f * hollowFactorF, -0.482963f * hollowFactorF, 0.0f)); // 255 degrees
363 holeHull.AddVertex(new Vertex(-0.250000f * hollowFactorF, -0.433013f * hollowFactorF, 0.0f)); // 240 degrees
364 holeHull.AddVertex(new Vertex(-0.353553f * hollowFactorF, -0.353553f * hollowFactorF, 0.0f)); // 225 degrees
365 holeHull.AddVertex(new Vertex(-0.433013f * hollowFactorF, -0.250000f * hollowFactorF, 0.0f)); // 210 degrees
366 holeHull.AddVertex(new Vertex(-0.482963f * hollowFactorF, -0.129410f * hollowFactorF, 0.0f)); // 195 degrees
367 holeHull.AddVertex(new Vertex(-0.500000f * hollowFactorF, 0.000000f * hollowFactorF, 0.0f)); // 180 degrees
368 holeHull.AddVertex(new Vertex(-0.482963f * hollowFactorF, 0.129410f * hollowFactorF, 0.0f)); // 165 degrees
369 holeHull.AddVertex(new Vertex(-0.433013f * hollowFactorF, 0.250000f * hollowFactorF, 0.0f)); // 150 degrees
370 holeHull.AddVertex(new Vertex(-0.353553f * hollowFactorF, 0.353553f * hollowFactorF, 0.0f)); // 135 degrees
371 holeHull.AddVertex(new Vertex(-0.250000f * hollowFactorF, 0.433013f * hollowFactorF, 0.0f)); // 120 degrees
372 holeHull.AddVertex(new Vertex(-0.129410f * hollowFactorF, 0.482963f * hollowFactorF, 0.0f)); // 105 degrees
373 holeHull.AddVertex(new Vertex(0.000000f * hollowFactorF, 0.500000f * hollowFactorF, 0.0f)); // 90 degrees
374 holeHull.AddVertex(new Vertex(0.129410f * hollowFactorF, 0.482963f * hollowFactorF, 0.0f)); // 75 degrees
375 holeHull.AddVertex(new Vertex(0.250000f * hollowFactorF, 0.433013f * hollowFactorF, 0.0f)); // 60 degrees
376 holeHull.AddVertex(new Vertex(0.353553f * hollowFactorF, 0.353553f * hollowFactorF, 0.0f)); // 45 degrees
377
330 } 378 }
331 if (hshape == HollowShape.Triangle) 379 if (hshape == HollowShape.Triangle)
332 { 380 {
@@ -401,10 +449,14 @@ namespace OpenSim.Region.Physics.Meshing
401 Vertex MP = new Vertex(-0.5f, +0.5f, 0.0f); 449 Vertex MP = new Vertex(-0.5f, +0.5f, 0.0f);
402 450
403 SimpleHull outerHull = new SimpleHull(); 451 SimpleHull outerHull = new SimpleHull();
404 outerHull.AddVertex(MM); 452 //outerHull.AddVertex(MM);
405 outerHull.AddVertex(PM); 453 //outerHull.AddVertex(PM);
454 //outerHull.AddVertex(PP);
455 //outerHull.AddVertex(MP);
406 outerHull.AddVertex(PP); 456 outerHull.AddVertex(PP);
407 outerHull.AddVertex(MP); 457 outerHull.AddVertex(MP);
458 outerHull.AddVertex(MM);
459 outerHull.AddVertex(PM);
408 460
409 // Deal with cuts now 461 // Deal with cuts now
410 if ((profileBegin != 0) || (profileEnd != 0)) 462 if ((profileBegin != 0) || (profileEnd != 0))
@@ -617,97 +669,126 @@ namespace OpenSim.Region.Physics.Meshing
617 669
618 // Base 670 // Base
619 // Q1Q15 = Quadrant 1, Quadrant1, Vertex 5 671 // Q1Q15 = Quadrant 1, Quadrant1, Vertex 5
620 Vertex Q1Q15 = new Vertex(-0.35f, -0.35f, 0.0f); 672 //Vertex Q1Q15 = new Vertex(-0.35f, -0.35f, 0.0f);
621 Vertex Q1Q16 = new Vertex(-0.30f, -0.40f, 0.0f); 673 //Vertex Q1Q16 = new Vertex(-0.30f, -0.40f, 0.0f);
622 Vertex Q1Q17 = new Vertex(-0.24f, -0.43f, 0.0f); 674 //Vertex Q1Q17 = new Vertex(-0.24f, -0.43f, 0.0f);
623 Vertex Q1Q18 = new Vertex(-0.18f, -0.46f, 0.0f); 675 //Vertex Q1Q18 = new Vertex(-0.18f, -0.46f, 0.0f);
624 Vertex Q1Q19 = new Vertex(-0.11f, -0.48f, 0.0f); 676 //Vertex Q1Q19 = new Vertex(-0.11f, -0.48f, 0.0f);
625 677
626 Vertex Q2Q10 = new Vertex(+0.0f, -0.50f, 0.0f); 678 //Vertex Q2Q10 = new Vertex(+0.0f, -0.50f, 0.0f);
627 Vertex Q2Q11 = new Vertex(+0.11f, -0.48f, 0.0f); 679 //Vertex Q2Q11 = new Vertex(+0.11f, -0.48f, 0.0f);
628 Vertex Q2Q12 = new Vertex(+0.18f, -0.46f, 0.0f); 680 //Vertex Q2Q12 = new Vertex(+0.18f, -0.46f, 0.0f);
629 Vertex Q2Q13 = new Vertex(+0.24f, -0.43f, 0.0f); 681 //Vertex Q2Q13 = new Vertex(+0.24f, -0.43f, 0.0f);
630 Vertex Q2Q14 = new Vertex(+0.30f, -0.40f, 0.0f); 682 //Vertex Q2Q14 = new Vertex(+0.30f, -0.40f, 0.0f);
631 Vertex Q2Q15 = new Vertex(+0.35f, -0.35f, 0.0f); 683 //Vertex Q2Q15 = new Vertex(+0.35f, -0.35f, 0.0f);
632 Vertex Q2Q16 = new Vertex(+0.40f, -0.30f, 0.0f); 684 //Vertex Q2Q16 = new Vertex(+0.40f, -0.30f, 0.0f);
633 Vertex Q2Q17 = new Vertex(+0.43f, -0.24f, 0.0f); 685 //Vertex Q2Q17 = new Vertex(+0.43f, -0.24f, 0.0f);
634 Vertex Q2Q18 = new Vertex(+0.46f, -0.18f, 0.0f); 686 //Vertex Q2Q18 = new Vertex(+0.46f, -0.18f, 0.0f);
635 Vertex Q2Q19 = new Vertex(+0.48f, -0.11f, 0.0f); 687 //Vertex Q2Q19 = new Vertex(+0.48f, -0.11f, 0.0f);
636 688
637 Vertex Q2Q20 = new Vertex(+0.50f, +0.0f, 0.0f); 689 //Vertex Q2Q20 = new Vertex(+0.50f, +0.0f, 0.0f);
638 Vertex Q2Q21 = new Vertex(+0.48f, +0.11f, 0.0f); 690 //Vertex Q2Q21 = new Vertex(+0.48f, +0.11f, 0.0f);
639 Vertex Q2Q22 = new Vertex(+0.46f, +0.18f, 0.0f); 691 //Vertex Q2Q22 = new Vertex(+0.46f, +0.18f, 0.0f);
640 Vertex Q2Q23 = new Vertex(+0.43f, +0.24f, 0.0f); 692 //Vertex Q2Q23 = new Vertex(+0.43f, +0.24f, 0.0f);
641 Vertex Q2Q24 = new Vertex(+0.40f, +0.30f, 0.0f); 693 //Vertex Q2Q24 = new Vertex(+0.40f, +0.30f, 0.0f);
642 Vertex Q2Q25 = new Vertex(+0.35f, +0.35f, 0.0f); 694 //Vertex Q2Q25 = new Vertex(+0.35f, +0.35f, 0.0f);
643 Vertex Q2Q26 = new Vertex(+0.30f, +0.40f, 0.0f); 695 //Vertex Q2Q26 = new Vertex(+0.30f, +0.40f, 0.0f);
644 Vertex Q2Q27 = new Vertex(+0.24f, +0.43f, 0.0f); 696 //Vertex Q2Q27 = new Vertex(+0.24f, +0.43f, 0.0f);
645 Vertex Q2Q28 = new Vertex(+0.18f, +0.46f, 0.0f); 697 //Vertex Q2Q28 = new Vertex(+0.18f, +0.46f, 0.0f);
646 Vertex Q2Q29 = new Vertex(+0.11f, +0.48f, 0.0f); 698 //Vertex Q2Q29 = new Vertex(+0.11f, +0.48f, 0.0f);
647 699
648 Vertex Q1Q20 = new Vertex(+0.0f, +0.50f, 0.0f); 700 //Vertex Q1Q20 = new Vertex(+0.0f, +0.50f, 0.0f);
649 Vertex Q1Q21 = new Vertex(-0.11f, +0.48f, 0.0f); 701 //Vertex Q1Q21 = new Vertex(-0.11f, +0.48f, 0.0f);
650 Vertex Q1Q22 = new Vertex(-0.18f, +0.46f, 0.0f); 702 //Vertex Q1Q22 = new Vertex(-0.18f, +0.46f, 0.0f);
651 Vertex Q1Q23 = new Vertex(-0.24f, +0.43f, 0.0f); 703 //Vertex Q1Q23 = new Vertex(-0.24f, +0.43f, 0.0f);
652 Vertex Q1Q24 = new Vertex(-0.30f, +0.40f, 0.0f); 704 //Vertex Q1Q24 = new Vertex(-0.30f, +0.40f, 0.0f);
653 Vertex Q1Q25 = new Vertex(-0.35f, +0.35f, 0.0f); 705 //Vertex Q1Q25 = new Vertex(-0.35f, +0.35f, 0.0f);
654 Vertex Q1Q26 = new Vertex(-0.40f, +0.30f, 0.0f); 706 //Vertex Q1Q26 = new Vertex(-0.40f, +0.30f, 0.0f);
655 Vertex Q1Q27 = new Vertex(-0.43f, +0.24f, 0.0f); 707 //Vertex Q1Q27 = new Vertex(-0.43f, +0.24f, 0.0f);
656 Vertex Q1Q28 = new Vertex(-0.46f, +0.18f, 0.0f); 708 //Vertex Q1Q28 = new Vertex(-0.46f, +0.18f, 0.0f);
657 Vertex Q1Q29 = new Vertex(-0.48f, +0.11f, 0.0f); 709 //Vertex Q1Q29 = new Vertex(-0.48f, +0.11f, 0.0f);
658 710
659 Vertex Q1Q10 = new Vertex(-0.50f, +0.0f, 0.0f); 711 //Vertex Q1Q10 = new Vertex(-0.50f, +0.0f, 0.0f);
660 Vertex Q1Q11 = new Vertex(-0.48f, -0.11f, 0.0f); 712 //Vertex Q1Q11 = new Vertex(-0.48f, -0.11f, 0.0f);
661 Vertex Q1Q12 = new Vertex(-0.46f, -0.18f, 0.0f); 713 //Vertex Q1Q12 = new Vertex(-0.46f, -0.18f, 0.0f);
662 Vertex Q1Q13 = new Vertex(-0.43f, -0.24f, 0.0f); 714 //Vertex Q1Q13 = new Vertex(-0.43f, -0.24f, 0.0f);
663 Vertex Q1Q14 = new Vertex(-0.40f, -0.30f, 0.0f); 715 //Vertex Q1Q14 = new Vertex(-0.40f, -0.30f, 0.0f);
664 716
665 SimpleHull outerHull = new SimpleHull(); 717 SimpleHull outerHull = new SimpleHull();
666 //Clockwise around the quadrants 718 //Clockwise around the quadrants
667 outerHull.AddVertex(Q1Q15); 719 //outerHull.AddVertex(Q1Q15);
668 outerHull.AddVertex(Q1Q16); 720 //outerHull.AddVertex(Q1Q16);
669 outerHull.AddVertex(Q1Q17); 721 //outerHull.AddVertex(Q1Q17);
670 outerHull.AddVertex(Q1Q18); 722 //outerHull.AddVertex(Q1Q18);
671 outerHull.AddVertex(Q1Q19); 723 //outerHull.AddVertex(Q1Q19);
672 724
673 outerHull.AddVertex(Q2Q10); 725 //outerHull.AddVertex(Q2Q10);
674 outerHull.AddVertex(Q2Q11); 726 //outerHull.AddVertex(Q2Q11);
675 outerHull.AddVertex(Q2Q12); 727 //outerHull.AddVertex(Q2Q12);
676 outerHull.AddVertex(Q2Q13); 728 //outerHull.AddVertex(Q2Q13);
677 outerHull.AddVertex(Q2Q14); 729 //outerHull.AddVertex(Q2Q14);
678 outerHull.AddVertex(Q2Q15); 730 //outerHull.AddVertex(Q2Q15);
679 outerHull.AddVertex(Q2Q16); 731 //outerHull.AddVertex(Q2Q16);
680 outerHull.AddVertex(Q2Q17); 732 //outerHull.AddVertex(Q2Q17);
681 outerHull.AddVertex(Q2Q18); 733 //outerHull.AddVertex(Q2Q18);
682 outerHull.AddVertex(Q2Q19); 734 //outerHull.AddVertex(Q2Q19);
683 735
684 outerHull.AddVertex(Q2Q20); 736 //outerHull.AddVertex(Q2Q20);
685 outerHull.AddVertex(Q2Q21); 737 //outerHull.AddVertex(Q2Q21);
686 outerHull.AddVertex(Q2Q22); 738 //outerHull.AddVertex(Q2Q22);
687 outerHull.AddVertex(Q2Q23); 739 //outerHull.AddVertex(Q2Q23);
688 outerHull.AddVertex(Q2Q24); 740 //outerHull.AddVertex(Q2Q24);
689 outerHull.AddVertex(Q2Q25); 741 //outerHull.AddVertex(Q2Q25);
690 outerHull.AddVertex(Q2Q26); 742 //outerHull.AddVertex(Q2Q26);
691 outerHull.AddVertex(Q2Q27); 743 //outerHull.AddVertex(Q2Q27);
692 outerHull.AddVertex(Q2Q28); 744 //outerHull.AddVertex(Q2Q28);
693 outerHull.AddVertex(Q2Q29); 745 //outerHull.AddVertex(Q2Q29);
694 746
695 outerHull.AddVertex(Q1Q20); 747 //outerHull.AddVertex(Q1Q20);
696 outerHull.AddVertex(Q1Q21); 748 //outerHull.AddVertex(Q1Q21);
697 outerHull.AddVertex(Q1Q22); 749 //outerHull.AddVertex(Q1Q22);
698 outerHull.AddVertex(Q1Q23); 750 //outerHull.AddVertex(Q1Q23);
699 outerHull.AddVertex(Q1Q24); 751 //outerHull.AddVertex(Q1Q24);
700 outerHull.AddVertex(Q1Q25); 752 //outerHull.AddVertex(Q1Q25);
701 outerHull.AddVertex(Q1Q26); 753 //outerHull.AddVertex(Q1Q26);
702 outerHull.AddVertex(Q1Q27); 754 //outerHull.AddVertex(Q1Q27);
703 outerHull.AddVertex(Q1Q28); 755 //outerHull.AddVertex(Q1Q28);
704 outerHull.AddVertex(Q1Q29); 756 //outerHull.AddVertex(Q1Q29);
705 757
706 outerHull.AddVertex(Q1Q10); 758 //outerHull.AddVertex(Q1Q10);
707 outerHull.AddVertex(Q1Q11); 759 //outerHull.AddVertex(Q1Q11);
708 outerHull.AddVertex(Q1Q12); 760 //outerHull.AddVertex(Q1Q12);
709 outerHull.AddVertex(Q1Q13); 761 //outerHull.AddVertex(Q1Q13);
710 outerHull.AddVertex(Q1Q14); 762 //outerHull.AddVertex(Q1Q14);
763
764 // counter-clockwise around the quadrants, start at 45 degrees
765
766 outerHull.AddVertex(new Vertex(0.353553f, 0.353553f, 0.0f)); // 45 degrees
767 outerHull.AddVertex(new Vertex(0.250000f, 0.433013f, 0.0f)); // 60 degrees
768 outerHull.AddVertex(new Vertex(0.129410f, 0.482963f, 0.0f)); // 75 degrees
769 outerHull.AddVertex(new Vertex(0.000000f, 0.500000f, 0.0f)); // 90 degrees
770 outerHull.AddVertex(new Vertex(-0.129410f, 0.482963f, 0.0f)); // 105 degrees
771 outerHull.AddVertex(new Vertex(-0.250000f, 0.433013f, 0.0f)); // 120 degrees
772 outerHull.AddVertex(new Vertex(-0.353553f, 0.353553f, 0.0f)); // 135 degrees
773 outerHull.AddVertex(new Vertex(-0.433013f, 0.250000f, 0.0f)); // 150 degrees
774 outerHull.AddVertex(new Vertex(-0.482963f, 0.129410f, 0.0f)); // 165 degrees
775 outerHull.AddVertex(new Vertex(-0.500000f, 0.000000f, 0.0f)); // 180 degrees
776 outerHull.AddVertex(new Vertex(-0.482963f, -0.129410f, 0.0f)); // 195 degrees
777 outerHull.AddVertex(new Vertex(-0.433013f, -0.250000f, 0.0f)); // 210 degrees
778 outerHull.AddVertex(new Vertex(-0.353553f, -0.353553f, 0.0f)); // 225 degrees
779 outerHull.AddVertex(new Vertex(-0.250000f, -0.433013f, 0.0f)); // 240 degrees
780 outerHull.AddVertex(new Vertex(-0.129410f, -0.482963f, 0.0f)); // 255 degrees
781 outerHull.AddVertex(new Vertex(0.000000f, -0.500000f, 0.0f)); // 270 degrees
782 outerHull.AddVertex(new Vertex(0.129410f, -0.482963f, 0.0f)); // 285 degrees
783 outerHull.AddVertex(new Vertex(0.250000f, -0.433013f, 0.0f)); // 300 degrees
784 outerHull.AddVertex(new Vertex(0.353553f, -0.353553f, 0.0f)); // 315 degrees
785 outerHull.AddVertex(new Vertex(0.433013f, -0.250000f, 0.0f)); // 330 degrees
786 outerHull.AddVertex(new Vertex(0.482963f, -0.129410f, 0.0f)); // 345 degrees
787 outerHull.AddVertex(new Vertex(0.500000f, 0.000000f, 0.0f)); // 0 degrees
788 outerHull.AddVertex(new Vertex(0.482963f, 0.129410f, 0.0f)); // 15 degrees
789 outerHull.AddVertex(new Vertex(0.433013f, 0.250000f, 0.0f)); // 30 degrees
790
791
711 792
712 // Deal with cuts now 793 // Deal with cuts now
713 if ((profileBegin != 0) || (profileEnd != 0)) 794 if ((profileBegin != 0) || (profileEnd != 0))
@@ -933,9 +1014,12 @@ namespace OpenSim.Region.Physics.Meshing
933 1014
934 1015
935 SimpleHull outerHull = new SimpleHull(); 1016 SimpleHull outerHull = new SimpleHull();
1017 //outerHull.AddVertex(MM);
1018 //outerHull.AddVertex(PM);
1019 //outerHull.AddVertex(PP);
1020 outerHull.AddVertex(PP);
936 outerHull.AddVertex(MM); 1021 outerHull.AddVertex(MM);
937 outerHull.AddVertex(PM); 1022 outerHull.AddVertex(PM);
938 outerHull.AddVertex(PP);
939 1023
940 // Deal with cuts now 1024 // Deal with cuts now
941 if ((profileBegin != 0) || (profileEnd != 0)) 1025 if ((profileBegin != 0) || (profileEnd != 0))