diff options
author | Teravus Ovares | 2008-02-08 23:28:38 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-08 23:28:38 +0000 |
commit | fadf5b479fea038f129cf85e1fb02857d19ac38f (patch) | |
tree | 11ccf094156ee3a166239a75bb1ba97ffb656cea /OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |
parent | Still chasing logout memory leak. Putting in small changes and temporary lig... (diff) | |
download | opensim-SC-fadf5b479fea038f129cf85e1fb02857d19ac38f.zip opensim-SC-fadf5b479fea038f129cf85e1fb02857d19ac38f.tar.gz opensim-SC-fadf5b479fea038f129cf85e1fb02857d19ac38f.tar.bz2 opensim-SC-fadf5b479fea038f129cf85e1fb02857d19ac38f.tar.xz |
* Added Taper support to the Meshmerizer for Cube and Cylinder.
* Removed the hull verbosity
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 2d80287..a2bbd3a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
58 | // Setting baseDir to a path will enable the dumping of raw files | 58 | // Setting baseDir to a path will enable the dumping of raw files |
59 | // raw files can be imported by blender so a visual inspection of the results can be done | 59 | // raw files can be imported by blender so a visual inspection of the results can be done |
60 | // const string baseDir = "rawFiles"; | 60 | // const string baseDir = "rawFiles"; |
61 | private const string baseDir = null; | 61 | private const string baseDir = null; //"rawFiles"; |
62 | 62 | ||
63 | private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2, | 63 | private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2, |
64 | PhysicsVector r2, ref float lambda, ref float mu) | 64 | PhysicsVector r2, ref float lambda, ref float mu) |
@@ -181,7 +181,13 @@ namespace OpenSim.Region.Physics.Meshing | |||
181 | UInt16 hollowFactor = primShape.ProfileHollow; | 181 | UInt16 hollowFactor = primShape.ProfileHollow; |
182 | UInt16 profileBegin = primShape.ProfileBegin; | 182 | UInt16 profileBegin = primShape.ProfileBegin; |
183 | UInt16 profileEnd = primShape.ProfileEnd; | 183 | UInt16 profileEnd = primShape.ProfileEnd; |
184 | UInt16 taperX = primShape.PathScaleX; | ||
185 | UInt16 taperY = primShape.PathScaleY; | ||
184 | 186 | ||
187 | //m_log.Error("pathShear:" + primShape.PathShearX.ToString() + "," + primShape.PathShearY.ToString()); | ||
188 | //m_log.Error("pathTaper:" + primShape.PathTaperX.ToString() + "," + primShape.PathTaperY.ToString()); | ||
189 | //m_log.Error("ProfileBegin:" + primShape.ProfileBegin.ToString() + "," + primShape.ProfileBegin.ToString()); | ||
190 | //m_log.Error("PathScale:" + primShape.PathScaleX.ToString() + "," + primShape.PathScaleY.ToString()); | ||
185 | // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface | 191 | // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface |
186 | // of a block are basically the same | 192 | // of a block are basically the same |
187 | // They may be warped differently but the shape is identical | 193 | // They may be warped differently but the shape is identical |
@@ -299,6 +305,35 @@ namespace OpenSim.Region.Physics.Meshing | |||
299 | 305 | ||
300 | extr.size = size; | 306 | extr.size = size; |
301 | 307 | ||
308 | if (taperX != 100) | ||
309 | { | ||
310 | if (taperX > 100) | ||
311 | { | ||
312 | extr.taperTopFactorX = 1.0f - ((float)taperX / 200); | ||
313 | //m_log.Warn("taperTopFactorX: " + extr.taperTopFactorX.ToString()); | ||
314 | } | ||
315 | else | ||
316 | { | ||
317 | extr.taperBotFactorX = 1.0f - ((100 - (float)taperX) / 100); | ||
318 | //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString()); | ||
319 | } | ||
320 | |||
321 | } | ||
322 | |||
323 | if (taperY != 100) | ||
324 | { | ||
325 | if (taperY > 100) | ||
326 | { | ||
327 | extr.taperTopFactorY = 1.0f - ((float)taperY / 200); | ||
328 | //m_log.Warn("taperTopFactorY: " + extr.taperTopFactorY.ToString()); | ||
329 | } | ||
330 | else | ||
331 | { | ||
332 | extr.taperBotFactorY = 1.0f - ((100 - (float)taperY) / 100); | ||
333 | //m_log.Warn("taperBotFactorY: " + extr.taperBotFactorY.ToString()); | ||
334 | } | ||
335 | } | ||
336 | |||
302 | Mesh result = extr.Extrude(m); | 337 | Mesh result = extr.Extrude(m); |
303 | result.DumpRaw(baseDir, primName, "Z extruded"); | 338 | result.DumpRaw(baseDir, primName, "Z extruded"); |
304 | return result; | 339 | return result; |
@@ -309,7 +344,8 @@ namespace OpenSim.Region.Physics.Meshing | |||
309 | UInt16 hollowFactor = primShape.ProfileHollow; | 344 | UInt16 hollowFactor = primShape.ProfileHollow; |
310 | UInt16 profileBegin = primShape.ProfileBegin; | 345 | UInt16 profileBegin = primShape.ProfileBegin; |
311 | UInt16 profileEnd = primShape.ProfileEnd; | 346 | UInt16 profileEnd = primShape.ProfileEnd; |
312 | 347 | UInt16 taperX = primShape.PathScaleX; | |
348 | UInt16 taperY = primShape.PathScaleY; | ||
313 | // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface | 349 | // Procedure: This is based on the fact that the upper (plus) and lower (minus) Z-surface |
314 | // of a block are basically the same | 350 | // of a block are basically the same |
315 | // They may be warped differently but the shape is identical | 351 | // They may be warped differently but the shape is identical |
@@ -589,7 +625,35 @@ namespace OpenSim.Region.Physics.Meshing | |||
589 | Extruder extr = new Extruder(); | 625 | Extruder extr = new Extruder(); |
590 | 626 | ||
591 | extr.size = size; | 627 | extr.size = size; |
628 | if (taperX != 100) | ||
629 | { | ||
630 | if (taperX > 100) | ||
631 | { | ||
632 | extr.taperTopFactorX = 1.0f - ((float)taperX / 200); | ||
633 | //m_log.Warn("taperTopFactorX: " + extr.taperTopFactorX.ToString()); | ||
634 | } | ||
635 | else | ||
636 | { | ||
637 | extr.taperBotFactorX = 1.0f - ((100 - (float)taperX) / 100); | ||
638 | //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString()); | ||
639 | } | ||
640 | |||
641 | } | ||
592 | 642 | ||
643 | if (taperY != 100) | ||
644 | { | ||
645 | if (taperY > 100) | ||
646 | { | ||
647 | extr.taperTopFactorY = 1.0f - ((float)taperY / 200); | ||
648 | //m_log.Warn("taperTopFactorY: " + extr.taperTopFactorY.ToString()); | ||
649 | } | ||
650 | else | ||
651 | { | ||
652 | extr.taperBotFactorY = 1.0f - ((100 - (float)taperY) / 100); | ||
653 | //m_log.Warn("taperBotFactorY: " + extr.taperBotFactorY.ToString()); | ||
654 | } | ||
655 | } | ||
656 | |||
593 | Mesh result = extr.Extrude(m); | 657 | Mesh result = extr.Extrude(m); |
594 | result.DumpRaw(baseDir, primName, "Z extruded"); | 658 | result.DumpRaw(baseDir, primName, "Z extruded"); |
595 | return result; | 659 | return result; |