diff options
Diffstat (limited to 'OpenSim/Region/Physics/Meshing')
-rw-r--r-- | OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 42b6a90..045a25d 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs | |||
@@ -2178,30 +2178,32 @@ namespace OpenSim.Region.Physics.Meshing | |||
2178 | //} | 2178 | //} |
2179 | 2179 | ||
2180 | if (mesh != null) | 2180 | if (mesh != null) |
2181 | if (size.X < minSizeForComplexMesh && size.Y < minSizeForComplexMesh && size.Z < minSizeForComplexMesh) | 2181 | { |
2182 | if ((!isPhysical) && size.X < minSizeForComplexMesh && size.Y < minSizeForComplexMesh && size.Z < minSizeForComplexMesh) | ||
2182 | { | 2183 | { |
2183 | #if SPAM | 2184 | #if SPAM |
2184 | Console.WriteLine("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " + minSizeForComplexMesh.ToString() + " - creating simple bounding box" ); | 2185 | Console.WriteLine("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " + minSizeForComplexMesh.ToString() + " - creating simple bounding box" ); |
2185 | #endif | 2186 | #endif |
2186 | mesh = CreateBoundingBoxMesh(mesh); | 2187 | mesh = CreateBoundingBoxMesh(mesh); |
2187 | mesh.DumpRaw(baseDir, primName, "Z extruded"); | 2188 | mesh.DumpRaw(baseDir, primName, "Z extruded"); |
2189 | } | ||
2188 | 2190 | ||
2189 | // trim the vertex and triangle lists to free up memory | 2191 | // trim the vertex and triangle lists to free up memory |
2190 | //mesh.vertices.TrimExcess(); | 2192 | mesh.vertices.TrimExcess(); |
2191 | //mesh.triangles.TrimExcess(); | 2193 | mesh.triangles.TrimExcess(); |
2192 | 2194 | ||
2193 | int vertCount = 0; | 2195 | //int vertCount = 0; |
2194 | foreach (Vertex v in mesh.vertices) | 2196 | //foreach (Vertex v in mesh.vertices) |
2195 | if (v != null) | 2197 | // if (v != null) |
2196 | vertCount++; | 2198 | // vertCount++; |
2197 | mesh.vertices.Capacity = vertCount; | 2199 | //mesh.vertices.Capacity = vertCount; |
2198 | 2200 | ||
2199 | int triCount = 0; | 2201 | //int triCount = 0; |
2200 | foreach (Triangle t in mesh.triangles) | 2202 | //foreach (Triangle t in mesh.triangles) |
2201 | if ( t != null ) | 2203 | // if (t != null) |
2202 | triCount++; | 2204 | // triCount++; |
2203 | mesh.triangles.Capacity = triCount; | 2205 | //mesh.triangles.Capacity = triCount; |
2204 | } | 2206 | } |
2205 | 2207 | ||
2206 | return mesh; | 2208 | return mesh; |
2207 | } | 2209 | } |