From 2e41294da969cd124a013070aaf6ce5dd9f01a5c Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Wed, 21 Mar 2012 01:24:30 +0000
Subject: add convex state to mesh key, so a change is detected.

---
 OpenSim/Framework/PrimitiveBaseShape.cs           | 8 ++++++++
 OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index 9cfc7ed..c6ccc9e 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -881,6 +881,11 @@ namespace OpenSim.Framework
 
         public ulong GetMeshKey(Vector3 size, float lod)
         {
+            return GetMeshKey(size, lod, false);
+        }
+
+        public ulong GetMeshKey(Vector3 size, float lod, bool convex)
+        {
             ulong hash = 5381;
 
             hash = djb2(hash, this.PathCurve);
@@ -926,6 +931,9 @@ namespace OpenSim.Framework
                     hash = djb2(hash, scaleBytes[i]);
             }
 
+            if(convex)
+                hash = djb2(hash, 0xa5);
+
             return hash;
         }
 
diff --git a/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs b/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs
index 7667e91..df08381 100644
--- a/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/UbitMeshing/Meshmerizer.cs
@@ -995,7 +995,7 @@ namespace OpenSim.Region.Physics.Meshing
 
             // If this mesh has been created already, return it instead of creating another copy
             // For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory
-            key = primShape.GetMeshKey(size, lod);
+            key = primShape.GetMeshKey(size, lod, convex);
             if (m_uniqueMeshes.TryGetValue(key, out mesh))
                 return mesh;
 
-- 
cgit v1.1