diff options
Diffstat (limited to 'OpenSim/Region/Physics/Meshing')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 15 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index d67d4d2..ef6482a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -84,7 +84,8 @@ namespace OpenSim.Region.Physics.Meshing | |||
84 | private List<List<Vector3>> mConvexHulls = null; | 84 | private List<List<Vector3>> mConvexHulls = null; |
85 | private List<Vector3> mBoundingHull = null; | 85 | private List<Vector3> mBoundingHull = null; |
86 | 86 | ||
87 | private Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); | 87 | // Mesh cache. Static so it can be shared across instances of this class |
88 | private static Dictionary<ulong, Mesh> m_uniqueMeshes = new Dictionary<ulong, Mesh>(); | ||
88 | 89 | ||
89 | public Meshmerizer(IConfigSource config) | 90 | public Meshmerizer(IConfigSource config) |
90 | { | 91 | { |
@@ -937,8 +938,11 @@ namespace OpenSim.Region.Physics.Meshing | |||
937 | if (shouldCache) | 938 | if (shouldCache) |
938 | { | 939 | { |
939 | key = primShape.GetMeshKey(size, lod); | 940 | key = primShape.GetMeshKey(size, lod); |
940 | if (m_uniqueMeshes.TryGetValue(key, out mesh)) | 941 | lock (m_uniqueMeshes) |
941 | return mesh; | 942 | { |
943 | if (m_uniqueMeshes.TryGetValue(key, out mesh)) | ||
944 | return mesh; | ||
945 | } | ||
942 | } | 946 | } |
943 | 947 | ||
944 | if (size.X < 0.01f) size.X = 0.01f; | 948 | if (size.X < 0.01f) size.X = 0.01f; |
@@ -964,7 +968,10 @@ namespace OpenSim.Region.Physics.Meshing | |||
964 | 968 | ||
965 | if (shouldCache) | 969 | if (shouldCache) |
966 | { | 970 | { |
967 | m_uniqueMeshes.Add(key, mesh); | 971 | lock (m_uniqueMeshes) |
972 | { | ||
973 | m_uniqueMeshes.Add(key, mesh); | ||
974 | } | ||
968 | } | 975 | } |
969 | } | 976 | } |
970 | 977 | ||
diff --git a/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs b/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs index 8542753..ec968c0 100644 --- a/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs | |||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices; | |||
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | [assembly: AssemblyVersion("0.8.0.*")] | 32 | [assembly: AssemblyVersion("0.8.2.*")] |
33 | 33 | ||