diff options
Diffstat (limited to 'OpenSim/Region/Physics/Meshing')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Mesh.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs | 4 |
3 files changed, 23 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs index 6970553..e6b32e7 100644 --- a/OpenSim/Region/Physics/Meshing/Mesh.cs +++ b/OpenSim/Region/Physics/Meshing/Mesh.cs | |||
@@ -226,7 +226,7 @@ namespace OpenSim.Region.Physics.Meshing | |||
226 | return result; | 226 | return result; |
227 | } | 227 | } |
228 | 228 | ||
229 | private float[] getVertexListAsFloat() | 229 | public float[] getVertexListAsFloat() |
230 | { | 230 | { |
231 | if (m_vertices == null) | 231 | if (m_vertices == null) |
232 | throw new NotSupportedException(); | 232 | throw new NotSupportedException(); |
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index f629c4d..d181b78 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -321,6 +321,9 @@ namespace OpenSim.Region.Physics.Meshing | |||
321 | 321 | ||
322 | if (primShape.SculptData.Length <= 0) | 322 | if (primShape.SculptData.Length <= 0) |
323 | { | 323 | { |
324 | // XXX: At the moment we can not log here since ODEPrim, for instance, ends up triggering this | ||
325 | // method twice - once before it has loaded sculpt data from the asset service and once afterwards. | ||
326 | // The first time will always call with unloaded SculptData if this needs to be uploaded. | ||
324 | // m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName); | 327 | // m_log.ErrorFormat("[MESH]: asset data for {0} is zero length", primName); |
325 | return false; | 328 | return false; |
326 | } | 329 | } |
@@ -699,16 +702,21 @@ namespace OpenSim.Region.Physics.Meshing | |||
699 | 702 | ||
700 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) | 703 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod) |
701 | { | 704 | { |
702 | return CreateMesh(primName, primShape, size, lod, false); | 705 | return CreateMesh(primName, primShape, size, lod, false, true); |
703 | } | 706 | } |
704 | 707 | ||
705 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool convex, bool forOde) | 708 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool shouldCache, bool convex, bool forOde) |
706 | { | 709 | { |
707 | return CreateMesh(primName, primShape, size, lod, false); | 710 | return CreateMesh(primName, primShape, size, lod, false); |
708 | } | 711 | } |
709 | 712 | ||
710 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) | 713 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical) |
711 | { | 714 | { |
715 | return CreateMesh(primName, primShape, size, lod, isPhysical, true); | ||
716 | } | ||
717 | |||
718 | public IMesh CreateMesh(String primName, PrimitiveBaseShape primShape, Vector3 size, float lod, bool isPhysical, bool shouldCache) | ||
719 | { | ||
712 | #if SPAM | 720 | #if SPAM |
713 | m_log.DebugFormat("[MESH]: Creating mesh for {0}", primName); | 721 | m_log.DebugFormat("[MESH]: Creating mesh for {0}", primName); |
714 | #endif | 722 | #endif |
@@ -718,9 +726,12 @@ namespace OpenSim.Region.Physics.Meshing | |||
718 | 726 | ||
719 | // If this mesh has been created already, return it instead of creating another copy | 727 | // If this mesh has been created already, return it instead of creating another copy |
720 | // For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory | 728 | // For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory |
721 | key = primShape.GetMeshKey(size, lod); | 729 | if (shouldCache) |
722 | if (m_uniqueMeshes.TryGetValue(key, out mesh)) | 730 | { |
723 | return mesh; | 731 | key = primShape.GetMeshKey(size, lod); |
732 | if (m_uniqueMeshes.TryGetValue(key, out mesh)) | ||
733 | return mesh; | ||
734 | } | ||
724 | 735 | ||
725 | if (size.X < 0.01f) size.X = 0.01f; | 736 | if (size.X < 0.01f) size.X = 0.01f; |
726 | if (size.Y < 0.01f) size.Y = 0.01f; | 737 | if (size.Y < 0.01f) size.Y = 0.01f; |
@@ -743,7 +754,10 @@ namespace OpenSim.Region.Physics.Meshing | |||
743 | // trim the vertex and triangle lists to free up memory | 754 | // trim the vertex and triangle lists to free up memory |
744 | mesh.TrimExcess(); | 755 | mesh.TrimExcess(); |
745 | 756 | ||
746 | m_uniqueMeshes.Add(key, mesh); | 757 | if (shouldCache) |
758 | { | ||
759 | m_uniqueMeshes.Add(key, mesh); | ||
760 | } | ||
747 | } | 761 | } |
748 | 762 | ||
749 | return mesh; | 763 | return mesh; |
diff --git a/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs b/OpenSim/Region/Physics/Meshing/Properties/AssemblyInfo.cs index 4cc1731..3de061a 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.7.5.*")] | 32 | [assembly: AssemblyVersion("0.7.6.*")] |
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | 33 | |