From 8afad46d100131e98a4358da8b97da3b15359ce9 Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Tue, 24 Feb 2009 06:02:44 +0000 Subject: remove log4net dependency and from PrimMesher.cs sync PrimMesher.cs with PrimMesher.dll version 29 on forge --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 4 ++++ OpenSim/Region/Physics/Meshing/PrimMesher.cs | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 72dc70f..306eab4 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -269,6 +269,10 @@ namespace OpenSim.Region.Physics.Meshing primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides); + if (primMesh.errorMessage != null) + if (primMesh.errorMessage.Length > 0) + m_log.Error("[ERROR] " + primMesh.errorMessage); + primMesh.topShearX = pathShearX; primMesh.topShearY = pathShearY; primMesh.pathCutBegin = pathBegin; diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index 86c9c08..962041b 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs @@ -29,8 +29,6 @@ using System; using System.Collections.Generic; using System.Text; using System.IO; -using log4net; -using System.Reflection; namespace PrimMesher { @@ -578,9 +576,10 @@ namespace PrimMesher /// internal class Profile { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private const float twoPi = 2.0f * (float)Math.PI; + internal string errorMessage = null; + internal List coords; internal List faces; internal List vertexNormals; @@ -646,8 +645,10 @@ namespace PrimMesher try { angles.makeAngles(sides, startAngle, stopAngle); } catch (Exception ex) { - m_log.Error("makeAngles failed: Exception: " + ex.ToString()); - m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); + + errorMessage = "makeAngles failed: Exception: " + ex.ToString() + + "\nsides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString(); + return; } @@ -666,8 +667,9 @@ namespace PrimMesher try { hollowAngles.makeAngles(hollowSides, startAngle, stopAngle); } catch (Exception ex) { - m_log.Error("makeAngles failed: Exception: " + ex.ToString()); - m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); + errorMessage = "makeAngles failed: Exception: " + ex.ToString() + + "\nsides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString(); + return; } } @@ -1127,6 +1129,7 @@ namespace PrimMesher public class PrimMesh { + public string errorMessage = ""; private const float twoPi = 2.0f * (float)Math.PI; public List coords; @@ -1314,6 +1317,8 @@ namespace PrimMesher hollow *= 1.414f; Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, true, calcVertexNormals); + this.errorMessage = profile.errorMessage; + this.numPrimFaces = profile.numPrimFaces; int cut1Vert = -1; @@ -1694,6 +1699,8 @@ namespace PrimMesher needEndFaces = true; Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, needEndFaces, calcVertexNormals); + this.errorMessage = profile.errorMessage; + this.numPrimFaces = profile.numPrimFaces; int cut1Vert = -1; -- cgit v1.1