aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/Meshing')
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs21
-rw-r--r--OpenSim/Region/Physics/Meshing/PrimMesher.cs11
2 files changed, 19 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 72575e5..72dc70f 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -35,6 +35,8 @@ using OpenMetaverse.Imaging;
35using System.Drawing; 35using System.Drawing;
36using System.Drawing.Imaging; 36using System.Drawing.Imaging;
37using PrimMesher; 37using PrimMesher;
38using log4net;
39using System.Reflection;
38 40
39namespace OpenSim.Region.Physics.Meshing 41namespace OpenSim.Region.Physics.Meshing
40{ 42{
@@ -57,6 +59,7 @@ namespace OpenSim.Region.Physics.Meshing
57 59
58 public class Meshmerizer : IMesher 60 public class Meshmerizer : IMesher
59 { 61 {
62 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
60 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 63 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
61 64
62 // Setting baseDir to a path will enable the dumping of raw files 65 // Setting baseDir to a path will enable the dumping of raw files
@@ -155,9 +158,9 @@ namespace OpenSim.Region.Physics.Meshing
155 158
156 private void ReportPrimError(string message, string primName, PrimMesh primMesh) 159 private void ReportPrimError(string message, string primName, PrimMesh primMesh)
157 { 160 {
158 Console.WriteLine(message); 161 m_log.Error(message);
159 Console.WriteLine("\nPrim Name: " + primName); 162 m_log.Error("\nPrim Name: " + primName);
160 Console.WriteLine("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString()); 163 m_log.Error("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString());
161 164
162 } 165 }
163 166
@@ -185,17 +188,17 @@ namespace OpenSim.Region.Physics.Meshing
185 } 188 }
186 catch (DllNotFoundException) 189 catch (DllNotFoundException)
187 { 190 {
188 System.Console.WriteLine("[PHYSICS]: OpenJpeg is not installed correctly on this system. Physics Proxy generation failed. Often times this is because of an old version of GLIBC. You must have version 2.4 or above!"); 191 m_log.Error("[PHYSICS]: OpenJpeg is not installed correctly on this system. Physics Proxy generation failed. Often times this is because of an old version of GLIBC. You must have version 2.4 or above!");
189 return null; 192 return null;
190 } 193 }
191 catch (IndexOutOfRangeException) 194 catch (IndexOutOfRangeException)
192 { 195 {
193 System.Console.WriteLine("[PHYSICS]: OpenJpeg was unable to decode this. Physics Proxy generation failed"); 196 m_log.Error("[PHYSICS]: OpenJpeg was unable to decode this. Physics Proxy generation failed");
194 return null; 197 return null;
195 } 198 }
196 catch (Exception) 199 catch (Exception)
197 { 200 {
198 System.Console.WriteLine("[PHYSICS]: Unable to generate a Sculpty physics proxy. Sculpty texture decode failed!"); 201 m_log.Error("[PHYSICS]: Unable to generate a Sculpty physics proxy. Sculpty texture decode failed!");
199 return null; 202 return null;
200 } 203 }
201 204
@@ -285,7 +288,7 @@ namespace OpenSim.Region.Physics.Meshing
285 if (profileEnd > 1.0f) profileEnd = 1.0f; 288 if (profileEnd > 1.0f) profileEnd = 1.0f;
286 } 289 }
287#if SPAM 290#if SPAM
288 Console.WriteLine("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString()); 291 m_log.Debug("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString());
289#endif 292#endif
290 try 293 try
291 { 294 {
@@ -316,7 +319,7 @@ namespace OpenSim.Region.Physics.Meshing
316 if (profileEnd > 1.0f) profileEnd = 1.0f; 319 if (profileEnd > 1.0f) profileEnd = 1.0f;
317 } 320 }
318#if SPAM 321#if SPAM
319 Console.WriteLine("****** PrimMesh Parameters (Circular) ******\n" + primMesh.ParamsToDisplayString()); 322 m_log.Debug("****** PrimMesh Parameters (Circular) ******\n" + primMesh.ParamsToDisplayString());
320#endif 323#endif
321 try 324 try
322 { 325 {
@@ -378,7 +381,7 @@ namespace OpenSim.Region.Physics.Meshing
378 if ((!isPhysical) && size.X < minSizeForComplexMesh && size.Y < minSizeForComplexMesh && size.Z < minSizeForComplexMesh) 381 if ((!isPhysical) && size.X < minSizeForComplexMesh && size.Y < minSizeForComplexMesh && size.Z < minSizeForComplexMesh)
379 { 382 {
380#if SPAM 383#if SPAM
381 Console.WriteLine("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " + 384 m_log.Debug("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " +
382 385
383minSizeForComplexMesh.ToString() + " - creating simple bounding box" ); 386minSizeForComplexMesh.ToString() + " - creating simple bounding box" );
384#endif 387#endif
diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
index c28577d..86c9c08 100644
--- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs
+++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs
@@ -29,6 +29,8 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text; 30using System.Text;
31using System.IO; 31using System.IO;
32using log4net;
33using System.Reflection;
32 34
33namespace PrimMesher 35namespace PrimMesher
34{ 36{
@@ -576,6 +578,7 @@ namespace PrimMesher
576 /// </summary> 578 /// </summary>
577 internal class Profile 579 internal class Profile
578 { 580 {
581 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
579 private const float twoPi = 2.0f * (float)Math.PI; 582 private const float twoPi = 2.0f * (float)Math.PI;
580 583
581 internal List<Coord> coords; 584 internal List<Coord> coords;
@@ -643,8 +646,8 @@ namespace PrimMesher
643 try { angles.makeAngles(sides, startAngle, stopAngle); } 646 try { angles.makeAngles(sides, startAngle, stopAngle); }
644 catch (Exception ex) 647 catch (Exception ex)
645 { 648 {
646 Console.WriteLine("makeAngles failed: Exception: " + ex.ToString()); 649 m_log.Error("makeAngles failed: Exception: " + ex.ToString());
647 Console.WriteLine("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); 650 m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString());
648 return; 651 return;
649 } 652 }
650 653
@@ -663,8 +666,8 @@ namespace PrimMesher
663 try { hollowAngles.makeAngles(hollowSides, startAngle, stopAngle); } 666 try { hollowAngles.makeAngles(hollowSides, startAngle, stopAngle); }
664 catch (Exception ex) 667 catch (Exception ex)
665 { 668 {
666 Console.WriteLine("makeAngles failed: Exception: " + ex.ToString()); 669 m_log.Error("makeAngles failed: Exception: " + ex.ToString());
667 Console.WriteLine("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); 670 m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString());
668 return; 671 return;
669 } 672 }
670 } 673 }