diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 316 |
1 files changed, 192 insertions, 124 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index f2ab01d..ec13564 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -175,6 +175,178 @@ namespace OpenSim.Region.Physics.Meshing | |||
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | private static SimpleHull BuildHoleHull(PrimitiveBaseShape pbs, ProfileShape pshape, HollowShape hshape, UInt16 hollowFactor) | ||
179 | { | ||
180 | // Tackle HollowShape.Same | ||
181 | float fhollowFactor = (float)hollowFactor; | ||
182 | |||
183 | switch (pshape) | ||
184 | { | ||
185 | case ProfileShape.Square: | ||
186 | if (hshape == HollowShape.Same) | ||
187 | hshape= HollowShape.Square; | ||
188 | break; | ||
189 | case ProfileShape.EquilateralTriangle: | ||
190 | fhollowFactor = ((float)hollowFactor / 1.9f); | ||
191 | if (hshape == HollowShape.Same) | ||
192 | { | ||
193 | hshape = HollowShape.Triangle; | ||
194 | } | ||
195 | |||
196 | break; | ||
197 | |||
198 | case ProfileShape.Circle: | ||
199 | if (pbs.PathCurve == (byte)Extrusion.Straight) | ||
200 | { | ||
201 | if (hshape == HollowShape.Same) | ||
202 | { | ||
203 | hshape = HollowShape.Circle; | ||
204 | } | ||
205 | } | ||
206 | break; | ||
207 | default: | ||
208 | if (hshape == HollowShape.Same) | ||
209 | hshape= HollowShape.Square; | ||
210 | break; | ||
211 | } | ||
212 | |||
213 | |||
214 | SimpleHull holeHull = null; | ||
215 | |||
216 | if (hshape == HollowShape.Square) | ||
217 | { | ||
218 | float hollowFactorF = (float)fhollowFactor / (float)50000; | ||
219 | Vertex IMM = new Vertex(-0.5f * hollowFactorF, -0.5f * hollowFactorF, 0.0f); | ||
220 | Vertex IPM = new Vertex(+0.5f * hollowFactorF, -0.5f * hollowFactorF, 0.0f); | ||
221 | Vertex IPP = new Vertex(+0.5f * hollowFactorF, +0.5f * hollowFactorF, 0.0f); | ||
222 | Vertex IMP = new Vertex(-0.5f * hollowFactorF, +0.5f * hollowFactorF, 0.0f); | ||
223 | |||
224 | |||
225 | holeHull = new SimpleHull(); | ||
226 | |||
227 | holeHull.AddVertex(IMM); | ||
228 | holeHull.AddVertex(IMP); | ||
229 | holeHull.AddVertex(IPP); | ||
230 | holeHull.AddVertex(IPM); | ||
231 | } | ||
232 | if (hshape == HollowShape.Circle && pbs.PathCurve == (byte)Extrusion.Straight) | ||
233 | { | ||
234 | float hollowFactorF = (float)fhollowFactor / (float)50000; | ||
235 | |||
236 | Vertex IQ1Q15 = new Vertex(-0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f); | ||
237 | Vertex IQ1Q16 = new Vertex(-0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f); | ||
238 | Vertex IQ1Q17 = new Vertex(-0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f); | ||
239 | Vertex IQ1Q18 = new Vertex(-0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f); | ||
240 | Vertex IQ1Q19 = new Vertex(-0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f); | ||
241 | |||
242 | Vertex IQ2Q10 = new Vertex(+0.0f * hollowFactorF, -0.50f * hollowFactorF, 0.0f); | ||
243 | Vertex IQ2Q11 = new Vertex(+0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f); | ||
244 | Vertex IQ2Q12 = new Vertex(+0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f); | ||
245 | Vertex IQ2Q13 = new Vertex(+0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f); | ||
246 | Vertex IQ2Q14 = new Vertex(+0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f); | ||
247 | Vertex IQ2Q15 = new Vertex(+0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f); | ||
248 | Vertex IQ2Q16 = new Vertex(+0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f); | ||
249 | Vertex IQ2Q17 = new Vertex(+0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f); | ||
250 | Vertex IQ2Q18 = new Vertex(+0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f); | ||
251 | Vertex IQ2Q19 = new Vertex(+0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f); | ||
252 | |||
253 | Vertex IQ2Q20 = new Vertex(+0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f); | ||
254 | Vertex IQ2Q21 = new Vertex(+0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f); | ||
255 | Vertex IQ2Q22 = new Vertex(+0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f); | ||
256 | Vertex IQ2Q23 = new Vertex(+0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f); | ||
257 | Vertex IQ2Q24 = new Vertex(+0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f); | ||
258 | Vertex IQ2Q25 = new Vertex(+0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f); | ||
259 | Vertex IQ2Q26 = new Vertex(+0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f); | ||
260 | Vertex IQ2Q27 = new Vertex(+0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f); | ||
261 | Vertex IQ2Q28 = new Vertex(+0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f); | ||
262 | Vertex IQ2Q29 = new Vertex(+0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f); | ||
263 | |||
264 | Vertex IQ1Q20 = new Vertex(+0.0f * hollowFactorF, +0.50f * hollowFactorF, 0.0f); | ||
265 | Vertex IQ1Q21 = new Vertex(-0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f); | ||
266 | Vertex IQ1Q22 = new Vertex(-0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f); | ||
267 | Vertex IQ1Q23 = new Vertex(-0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f); | ||
268 | Vertex IQ1Q24 = new Vertex(-0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f); | ||
269 | Vertex IQ1Q25 = new Vertex(-0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f); | ||
270 | Vertex IQ1Q26 = new Vertex(-0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f); | ||
271 | Vertex IQ1Q27 = new Vertex(-0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f); | ||
272 | Vertex IQ1Q28 = new Vertex(-0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f); | ||
273 | Vertex IQ1Q29 = new Vertex(-0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f); | ||
274 | |||
275 | Vertex IQ1Q10 = new Vertex(-0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f); | ||
276 | Vertex IQ1Q11 = new Vertex(-0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f); | ||
277 | Vertex IQ1Q12 = new Vertex(-0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f); | ||
278 | Vertex IQ1Q13 = new Vertex(-0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f); | ||
279 | Vertex IQ1Q14 = new Vertex(-0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f); | ||
280 | |||
281 | //Counter clockwise around the quadrants | ||
282 | holeHull = new SimpleHull(); | ||
283 | holeHull.AddVertex(IQ1Q15); | ||
284 | holeHull.AddVertex(IQ1Q14); | ||
285 | holeHull.AddVertex(IQ1Q13); | ||
286 | holeHull.AddVertex(IQ1Q12); | ||
287 | holeHull.AddVertex(IQ1Q11); | ||
288 | holeHull.AddVertex(IQ1Q10); | ||
289 | |||
290 | holeHull.AddVertex(IQ1Q29); | ||
291 | holeHull.AddVertex(IQ1Q28); | ||
292 | holeHull.AddVertex(IQ1Q27); | ||
293 | holeHull.AddVertex(IQ1Q26); | ||
294 | holeHull.AddVertex(IQ1Q25); | ||
295 | holeHull.AddVertex(IQ1Q24); | ||
296 | holeHull.AddVertex(IQ1Q23); | ||
297 | holeHull.AddVertex(IQ1Q22); | ||
298 | holeHull.AddVertex(IQ1Q21); | ||
299 | holeHull.AddVertex(IQ1Q20); | ||
300 | |||
301 | holeHull.AddVertex(IQ2Q29); | ||
302 | holeHull.AddVertex(IQ2Q28); | ||
303 | holeHull.AddVertex(IQ2Q27); | ||
304 | holeHull.AddVertex(IQ2Q26); | ||
305 | holeHull.AddVertex(IQ2Q25); | ||
306 | holeHull.AddVertex(IQ2Q24); | ||
307 | holeHull.AddVertex(IQ2Q23); | ||
308 | holeHull.AddVertex(IQ2Q22); | ||
309 | holeHull.AddVertex(IQ2Q21); | ||
310 | holeHull.AddVertex(IQ2Q20); | ||
311 | |||
312 | holeHull.AddVertex(IQ2Q19); | ||
313 | holeHull.AddVertex(IQ2Q18); | ||
314 | holeHull.AddVertex(IQ2Q17); | ||
315 | holeHull.AddVertex(IQ2Q16); | ||
316 | holeHull.AddVertex(IQ2Q15); | ||
317 | holeHull.AddVertex(IQ2Q14); | ||
318 | holeHull.AddVertex(IQ2Q13); | ||
319 | holeHull.AddVertex(IQ2Q12); | ||
320 | holeHull.AddVertex(IQ2Q11); | ||
321 | holeHull.AddVertex(IQ2Q10); | ||
322 | |||
323 | holeHull.AddVertex(IQ1Q19); | ||
324 | holeHull.AddVertex(IQ1Q18); | ||
325 | holeHull.AddVertex(IQ1Q17); | ||
326 | holeHull.AddVertex(IQ1Q16); | ||
327 | } | ||
328 | if (hshape == HollowShape.Triangle) | ||
329 | { | ||
330 | float hollowFactorF = (float)fhollowFactor / (float)50000; | ||
331 | Vertex IMM = new Vertex(-0.25f * hollowFactorF, -0.45f * hollowFactorF, 0.0f); | ||
332 | Vertex IPM = new Vertex(+0.5f * hollowFactorF, +0f * hollowFactorF, 0.0f); | ||
333 | Vertex IPP = new Vertex(-0.25f * hollowFactorF, +0.45f * hollowFactorF, 0.0f); | ||
334 | |||
335 | |||
336 | |||
337 | holeHull = new SimpleHull(); | ||
338 | |||
339 | holeHull.AddVertex(IMM); | ||
340 | holeHull.AddVertex(IPP); | ||
341 | holeHull.AddVertex(IPM); | ||
342 | |||
343 | } | ||
344 | |||
345 | return holeHull; | ||
346 | |||
347 | |||
348 | } | ||
349 | |||
178 | private static Mesh CreateBoxMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) | 350 | private static Mesh CreateBoxMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) |
179 | // Builds the z (+ and -) surfaces of a box shaped prim | 351 | // Builds the z (+ and -) surfaces of a box shaped prim |
180 | { | 352 | { |
@@ -185,6 +357,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
185 | UInt16 taperY = primShape.PathScaleY; | 357 | UInt16 taperY = primShape.PathScaleY; |
186 | UInt16 pathShearX = primShape.PathShearX; | 358 | UInt16 pathShearX = primShape.PathShearX; |
187 | UInt16 pathShearY = primShape.PathShearY; | 359 | UInt16 pathShearY = primShape.PathShearY; |
360 | |||
188 | 361 | ||
189 | //m_log.Error("pathShear:" + primShape.PathShearX.ToString() + "," + primShape.PathShearY.ToString()); | 362 | //m_log.Error("pathShear:" + primShape.PathShearX.ToString() + "," + primShape.PathShearY.ToString()); |
190 | //m_log.Error("pathTaper:" + primShape.PathTaperX.ToString() + "," + primShape.PathTaperY.ToString()); | 363 | //m_log.Error("pathTaper:" + primShape.PathTaperX.ToString() + "," + primShape.PathTaperY.ToString()); |
@@ -254,23 +427,14 @@ namespace OpenSim.Region.Physics.Meshing | |||
254 | // Deal with the hole here | 427 | // Deal with the hole here |
255 | if (hollowFactor > 0) | 428 | if (hollowFactor > 0) |
256 | { | 429 | { |
257 | float hollowFactorF = (float) hollowFactor/(float) 50000; | ||
258 | Vertex IMM = new Vertex(-0.5f*hollowFactorF, -0.5f*hollowFactorF, 0.0f); | ||
259 | Vertex IPM = new Vertex(+0.5f*hollowFactorF, -0.5f*hollowFactorF, 0.0f); | ||
260 | Vertex IPP = new Vertex(+0.5f*hollowFactorF, +0.5f*hollowFactorF, 0.0f); | ||
261 | Vertex IMP = new Vertex(-0.5f*hollowFactorF, +0.5f*hollowFactorF, 0.0f); | ||
262 | |||
263 | |||
264 | SimpleHull holeHull = new SimpleHull(); | ||
265 | |||
266 | holeHull.AddVertex(IMM); | ||
267 | holeHull.AddVertex(IMP); | ||
268 | holeHull.AddVertex(IPP); | ||
269 | holeHull.AddVertex(IPM); | ||
270 | 430 | ||
271 | SimpleHull hollowedHull = SimpleHull.SubtractHull(outerHull, holeHull); | 431 | SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); |
432 | if (holeHull != null) | ||
433 | { | ||
434 | SimpleHull hollowedHull = SimpleHull.SubtractHull(outerHull, holeHull); | ||
272 | 435 | ||
273 | outerHull = hollowedHull; | 436 | outerHull = hollowedHull; |
437 | } | ||
274 | } | 438 | } |
275 | 439 | ||
276 | Mesh m = new Mesh(); | 440 | Mesh m = new Mesh(); |
@@ -529,103 +693,14 @@ namespace OpenSim.Region.Physics.Meshing | |||
529 | // Deal with the hole here | 693 | // Deal with the hole here |
530 | if (hollowFactor > 0) | 694 | if (hollowFactor > 0) |
531 | { | 695 | { |
532 | float hollowFactorF = (float)hollowFactor / (float)50000; | 696 | |
533 | 697 | SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); | |
534 | Vertex IQ1Q15 = new Vertex(-0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f); | 698 | if (holeHull != null) |
535 | Vertex IQ1Q16 = new Vertex(-0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f); | 699 | { |
536 | Vertex IQ1Q17 = new Vertex(-0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f); | 700 | SimpleHull hollowedHull = SimpleHull.SubtractHull(outerHull, holeHull); |
537 | Vertex IQ1Q18 = new Vertex(-0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f); | ||
538 | Vertex IQ1Q19 = new Vertex(-0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f); | ||
539 | |||
540 | Vertex IQ2Q10 = new Vertex(+0.0f * hollowFactorF, -0.50f * hollowFactorF, 0.0f); | ||
541 | Vertex IQ2Q11 = new Vertex(+0.11f * hollowFactorF, -0.48f * hollowFactorF, 0.0f); | ||
542 | Vertex IQ2Q12 = new Vertex(+0.18f * hollowFactorF, -0.46f * hollowFactorF, 0.0f); | ||
543 | Vertex IQ2Q13 = new Vertex(+0.24f * hollowFactorF, -0.43f * hollowFactorF, 0.0f); | ||
544 | Vertex IQ2Q14 = new Vertex(+0.30f * hollowFactorF, -0.40f * hollowFactorF, 0.0f); | ||
545 | Vertex IQ2Q15 = new Vertex(+0.35f * hollowFactorF, -0.35f * hollowFactorF, 0.0f); | ||
546 | Vertex IQ2Q16 = new Vertex(+0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f); | ||
547 | Vertex IQ2Q17 = new Vertex(+0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f); | ||
548 | Vertex IQ2Q18 = new Vertex(+0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f); | ||
549 | Vertex IQ2Q19 = new Vertex(+0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f); | ||
550 | |||
551 | Vertex IQ2Q20 = new Vertex(+0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f); | ||
552 | Vertex IQ2Q21 = new Vertex(+0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f); | ||
553 | Vertex IQ2Q22 = new Vertex(+0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f); | ||
554 | Vertex IQ2Q23 = new Vertex(+0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f); | ||
555 | Vertex IQ2Q24 = new Vertex(+0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f); | ||
556 | Vertex IQ2Q25 = new Vertex(+0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f); | ||
557 | Vertex IQ2Q26 = new Vertex(+0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f); | ||
558 | Vertex IQ2Q27 = new Vertex(+0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f); | ||
559 | Vertex IQ2Q28 = new Vertex(+0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f); | ||
560 | Vertex IQ2Q29 = new Vertex(+0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f); | ||
561 | |||
562 | Vertex IQ1Q20 = new Vertex(+0.0f * hollowFactorF, +0.50f * hollowFactorF, 0.0f); | ||
563 | Vertex IQ1Q21 = new Vertex(-0.11f * hollowFactorF, +0.48f * hollowFactorF, 0.0f); | ||
564 | Vertex IQ1Q22 = new Vertex(-0.18f * hollowFactorF, +0.46f * hollowFactorF, 0.0f); | ||
565 | Vertex IQ1Q23 = new Vertex(-0.24f * hollowFactorF, +0.43f * hollowFactorF, 0.0f); | ||
566 | Vertex IQ1Q24 = new Vertex(-0.30f * hollowFactorF, +0.40f * hollowFactorF, 0.0f); | ||
567 | Vertex IQ1Q25 = new Vertex(-0.35f * hollowFactorF, +0.35f * hollowFactorF, 0.0f); | ||
568 | Vertex IQ1Q26 = new Vertex(-0.40f * hollowFactorF, +0.30f * hollowFactorF, 0.0f); | ||
569 | Vertex IQ1Q27 = new Vertex(-0.43f * hollowFactorF, +0.24f * hollowFactorF, 0.0f); | ||
570 | Vertex IQ1Q28 = new Vertex(-0.46f * hollowFactorF, +0.18f * hollowFactorF, 0.0f); | ||
571 | Vertex IQ1Q29 = new Vertex(-0.48f * hollowFactorF, +0.11f * hollowFactorF, 0.0f); | ||
572 | |||
573 | Vertex IQ1Q10 = new Vertex(-0.50f * hollowFactorF, +0.0f * hollowFactorF, 0.0f); | ||
574 | Vertex IQ1Q11 = new Vertex(-0.48f * hollowFactorF, -0.11f * hollowFactorF, 0.0f); | ||
575 | Vertex IQ1Q12 = new Vertex(-0.46f * hollowFactorF, -0.18f * hollowFactorF, 0.0f); | ||
576 | Vertex IQ1Q13 = new Vertex(-0.43f * hollowFactorF, -0.24f * hollowFactorF, 0.0f); | ||
577 | Vertex IQ1Q14 = new Vertex(-0.40f * hollowFactorF, -0.30f * hollowFactorF, 0.0f); | ||
578 | |||
579 | //Counter clockwise around the quadrants | ||
580 | SimpleHull holeHull = new SimpleHull(); | ||
581 | holeHull.AddVertex(IQ1Q15); | ||
582 | holeHull.AddVertex(IQ1Q14); | ||
583 | holeHull.AddVertex(IQ1Q13); | ||
584 | holeHull.AddVertex(IQ1Q12); | ||
585 | holeHull.AddVertex(IQ1Q11); | ||
586 | holeHull.AddVertex(IQ1Q10); | ||
587 | |||
588 | holeHull.AddVertex(IQ1Q29); | ||
589 | holeHull.AddVertex(IQ1Q28); | ||
590 | holeHull.AddVertex(IQ1Q27); | ||
591 | holeHull.AddVertex(IQ1Q26); | ||
592 | holeHull.AddVertex(IQ1Q25); | ||
593 | holeHull.AddVertex(IQ1Q24); | ||
594 | holeHull.AddVertex(IQ1Q23); | ||
595 | holeHull.AddVertex(IQ1Q22); | ||
596 | holeHull.AddVertex(IQ1Q21); | ||
597 | holeHull.AddVertex(IQ1Q20); | ||
598 | |||
599 | holeHull.AddVertex(IQ2Q29); | ||
600 | holeHull.AddVertex(IQ2Q28); | ||
601 | holeHull.AddVertex(IQ2Q27); | ||
602 | holeHull.AddVertex(IQ2Q26); | ||
603 | holeHull.AddVertex(IQ2Q25); | ||
604 | holeHull.AddVertex(IQ2Q24); | ||
605 | holeHull.AddVertex(IQ2Q23); | ||
606 | holeHull.AddVertex(IQ2Q22); | ||
607 | holeHull.AddVertex(IQ2Q21); | ||
608 | holeHull.AddVertex(IQ2Q20); | ||
609 | |||
610 | holeHull.AddVertex(IQ2Q19); | ||
611 | holeHull.AddVertex(IQ2Q18); | ||
612 | holeHull.AddVertex(IQ2Q17); | ||
613 | holeHull.AddVertex(IQ2Q16); | ||
614 | holeHull.AddVertex(IQ2Q15); | ||
615 | holeHull.AddVertex(IQ2Q14); | ||
616 | holeHull.AddVertex(IQ2Q13); | ||
617 | holeHull.AddVertex(IQ2Q12); | ||
618 | holeHull.AddVertex(IQ2Q11); | ||
619 | holeHull.AddVertex(IQ2Q10); | ||
620 | |||
621 | holeHull.AddVertex(IQ1Q19); | ||
622 | holeHull.AddVertex(IQ1Q18); | ||
623 | holeHull.AddVertex(IQ1Q17); | ||
624 | holeHull.AddVertex(IQ1Q16); | ||
625 | |||
626 | SimpleHull hollowedHull = SimpleHull.SubtractHull(outerHull, holeHull); | ||
627 | 701 | ||
628 | outerHull = hollowedHull; | 702 | outerHull = hollowedHull; |
703 | } | ||
629 | } | 704 | } |
630 | 705 | ||
631 | Mesh m = new Mesh(); | 706 | Mesh m = new Mesh(); |
@@ -807,22 +882,15 @@ namespace OpenSim.Region.Physics.Meshing | |||
807 | // Deal with the hole here | 882 | // Deal with the hole here |
808 | if (hollowFactor > 0) | 883 | if (hollowFactor > 0) |
809 | { | 884 | { |
810 | float hollowFactorF = (float)hollowFactor / (float)50000; | ||
811 | Vertex IMM = new Vertex(-0.25f * (float)(hollowFactorF / 1.9), -0.45f * (float)(hollowFactorF / 1.9), 0.0f); | ||
812 | Vertex IPM = new Vertex(+0.5f * (float)(hollowFactorF / 1.9), +0f * (float)(hollowFactorF / 1.9), 0.0f); | ||
813 | Vertex IPP = new Vertex(-0.25f * (float)(hollowFactorF / 1.9), +0.45f * (float)(hollowFactorF / 1.9), 0.0f); | ||
814 | |||
815 | 885 | ||
816 | 886 | ||
817 | SimpleHull holeHull = new SimpleHull(); | 887 | SimpleHull holeHull = BuildHoleHull(primShape, primShape.ProfileShape, primShape.HollowShape, hollowFactor); |
818 | 888 | if (holeHull != null) | |
819 | holeHull.AddVertex(IMM); | 889 | { |
820 | holeHull.AddVertex(IPP); | 890 | SimpleHull hollowedHull = SimpleHull.SubtractHull(outerHull, holeHull); |
821 | holeHull.AddVertex(IPM); | ||
822 | |||
823 | SimpleHull hollowedHull = SimpleHull.SubtractHull(outerHull, holeHull); | ||
824 | 891 | ||
825 | outerHull = hollowedHull; | 892 | outerHull = hollowedHull; |
893 | } | ||
826 | } | 894 | } |
827 | 895 | ||
828 | Mesh m = new Mesh(); | 896 | Mesh m = new Mesh(); |