From d199767e6991d6f368661fce9c5a072e564b8a4b Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Sun, 25 Oct 2009 23:16:12 -0700 Subject: Experimental change of PhysicsVector to Vector3. Untested --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Physics/Meshing/Meshmerizer.cs') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 01093e2..a90a89a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -61,7 +61,6 @@ namespace OpenSim.Region.Physics.Meshing public class Meshmerizer : IMesher { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Setting baseDir to a path will enable the dumping of raw files // raw files can be imported by blender so a visual inspection of the results can be done @@ -160,7 +159,7 @@ namespace OpenSim.Region.Physics.Meshing float minZ = float.MaxValue; float maxZ = float.MinValue; - foreach (Vertex v in meshIn.getVertexList()) + foreach (Vector3 v in meshIn.getVertexList()) { if (v != null) { @@ -185,7 +184,7 @@ namespace OpenSim.Region.Physics.Meshing } - private ulong GetMeshKey(PrimitiveBaseShape pbs, PhysicsVector size, float lod) + private ulong GetMeshKey(PrimitiveBaseShape pbs, Vector3 size, float lod) { ulong hash = 5381; @@ -245,9 +244,9 @@ namespace OpenSim.Region.Physics.Meshing hash = ((hash << 5) + hash) + (ulong)((byte)c); return ((hash << 5) + hash) + (ulong)(c >> 8); } - - private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod) + + private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod) { PrimMesh primMesh; PrimMesher.SculptMesh sculptMesh; @@ -289,9 +288,6 @@ namespace OpenSim.Region.Physics.Meshing ManagedImage managedImage; // we never use this OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage, out idata); - // Remove the reference to the encoded JPEG2000 data so it can be GCed - primShape.SculptData = Utils.EmptyBytes; - if (cacheSculptMaps) { try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } @@ -315,8 +311,6 @@ namespace OpenSim.Region.Physics.Meshing } } - - PrimMesher.SculptMesh.SculptType sculptType; switch ((OpenMetaverse.SculptType)primShape.SculptType) { @@ -351,7 +345,6 @@ namespace OpenSim.Region.Physics.Meshing coords = sculptMesh.coords; faces = sculptMesh.faces; } - else { float pathShearX = primShape.PathShearX < 128 ? (float)primShape.PathShearX * 0.01f : (float)(primShape.PathShearX - 256) * 0.01f; @@ -466,6 +459,8 @@ namespace OpenSim.Region.Physics.Meshing faces = primMesh.faces; } + // Remove the reference to any JPEG2000 sculpt data so it can be GCed + primShape.SculptData = Utils.EmptyBytes; int numCoords = coords.Count; int numFaces = faces.Count; @@ -488,12 +483,12 @@ namespace OpenSim.Region.Physics.Meshing return mesh; } - public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod) + public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) { return CreateMesh(primName, primShape, size, lod, false); } - public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod, bool isPhysical) + public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) { Mesh mesh = null; ulong key = 0; -- cgit v1.1