aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/Meshing/Meshmerizer.cs')
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs21
1 files changed, 8 insertions, 13 deletions
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
61 public class Meshmerizer : IMesher 61 public class Meshmerizer : IMesher
62 { 62 {
63 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 63 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
64 //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
65 64
66 // 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
67 // raw files can be imported by blender so a visual inspection of the results can be done 66 // 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
160 float minZ = float.MaxValue; 159 float minZ = float.MaxValue;
161 float maxZ = float.MinValue; 160 float maxZ = float.MinValue;
162 161
163 foreach (Vertex v in meshIn.getVertexList()) 162 foreach (Vector3 v in meshIn.getVertexList())
164 { 163 {
165 if (v != null) 164 if (v != null)
166 { 165 {
@@ -185,7 +184,7 @@ namespace OpenSim.Region.Physics.Meshing
185 184
186 } 185 }
187 186
188 private ulong GetMeshKey(PrimitiveBaseShape pbs, PhysicsVector size, float lod) 187 private ulong GetMeshKey(PrimitiveBaseShape pbs, Vector3 size, float lod)
189 { 188 {
190 ulong hash = 5381; 189 ulong hash = 5381;
191 190
@@ -245,9 +244,9 @@ namespace OpenSim.Region.Physics.Meshing
245 hash = ((hash << 5) + hash) + (ulong)((byte)c); 244 hash = ((hash << 5) + hash) + (ulong)((byte)c);
246 return ((hash << 5) + hash) + (ulong)(c >> 8); 245 return ((hash << 5) + hash) + (ulong)(c >> 8);
247 } 246 }
248
249 247
250 private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod) 248
249 private Mesh CreateMeshFromPrimMesher(string primName, PrimitiveBaseShape primShape, Vector3 size, float lod)
251 { 250 {
252 PrimMesh primMesh; 251 PrimMesh primMesh;
253 PrimMesher.SculptMesh sculptMesh; 252 PrimMesher.SculptMesh sculptMesh;
@@ -289,9 +288,6 @@ namespace OpenSim.Region.Physics.Meshing
289 ManagedImage managedImage; // we never use this 288 ManagedImage managedImage; // we never use this
290 OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage, out idata); 289 OpenJPEG.DecodeToImage(primShape.SculptData, out managedImage, out idata);
291 290
292 // Remove the reference to the encoded JPEG2000 data so it can be GCed
293 primShape.SculptData = Utils.EmptyBytes;
294
295 if (cacheSculptMaps) 291 if (cacheSculptMaps)
296 { 292 {
297 try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } 293 try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); }
@@ -315,8 +311,6 @@ namespace OpenSim.Region.Physics.Meshing
315 } 311 }
316 } 312 }
317 313
318
319
320 PrimMesher.SculptMesh.SculptType sculptType; 314 PrimMesher.SculptMesh.SculptType sculptType;
321 switch ((OpenMetaverse.SculptType)primShape.SculptType) 315 switch ((OpenMetaverse.SculptType)primShape.SculptType)
322 { 316 {
@@ -351,7 +345,6 @@ namespace OpenSim.Region.Physics.Meshing
351 coords = sculptMesh.coords; 345 coords = sculptMesh.coords;
352 faces = sculptMesh.faces; 346 faces = sculptMesh.faces;
353 } 347 }
354
355 else 348 else
356 { 349 {
357 float pathShearX = primShape.PathShearX < 128 ? (float)primShape.PathShearX * 0.01f : (float)(primShape.PathShearX - 256) * 0.01f; 350 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
466 faces = primMesh.faces; 459 faces = primMesh.faces;
467 } 460 }
468 461
462 // Remove the reference to any JPEG2000 sculpt data so it can be GCed
463 primShape.SculptData = Utils.EmptyBytes;
469 464
470 int numCoords = coords.Count; 465 int numCoords = coords.Count;
471 int numFaces = faces.Count; 466 int numFaces = faces.Count;
@@ -488,12 +483,12 @@ namespace OpenSim.Region.Physics.Meshing
488 return mesh; 483 return mesh;
489 } 484 }
490 485
491 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod) 486 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod)
492 { 487 {
493 return CreateMesh(primName, primShape, size, lod, false); 488 return CreateMesh(primName, primShape, size, lod, false);
494 } 489 }
495 490
496 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size, float lod, bool isPhysical) 491 public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical)
497 { 492 {
498 Mesh mesh = null; 493 Mesh mesh = null;
499 ulong key = 0; 494 ulong key = 0;