aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
index 62f1d06..ece40ac 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ClientStack.Linden
73 const int bytesPerCoord = 6; // 3 coords, 2 bytes per each 73 const int bytesPerCoord = 6; // 3 coords, 2 bytes per each
74 74
75 // control prims dimensions 75 // control prims dimensions
76 public float PrimScaleMin = 0.01f; 76 public float PrimScaleMin = 0.001f;
77 public float NonPhysicalPrimScaleMax = 256f; 77 public float NonPhysicalPrimScaleMax = 256f;
78 public float PhysicalPrimScaleMax = 10f; 78 public float PhysicalPrimScaleMax = 10f;
79 public int ObjectLinkedPartsMax = 512; 79 public int ObjectLinkedPartsMax = 512;
@@ -171,6 +171,7 @@ namespace OpenSim.Region.ClientStack.Linden
171 171
172 172
173 int mesh; 173 int mesh;
174 int skipedSmall = 0;
174 for (int i = 0; i < numberInstances; i++) 175 for (int i = 0; i < numberInstances; i++)
175 { 176 {
176 Hashtable inst = (Hashtable)resources.instance_list.Array[i]; 177 Hashtable inst = (Hashtable)resources.instance_list.Array[i];
@@ -187,8 +188,10 @@ namespace OpenSim.Region.ClientStack.Linden
187 188
188 if (scale.X < PrimScaleMin || scale.Y < PrimScaleMin || scale.Z < PrimScaleMin) 189 if (scale.X < PrimScaleMin || scale.Y < PrimScaleMin || scale.Z < PrimScaleMin)
189 { 190 {
190 error = " upload fail: Model contains parts with a dimension lower than 0.01. Please adjust scaling"; 191// error = " upload fail: Model contains parts with a dimension lower than 0.001. Please adjust scaling";
191 return false; 192// return false;
193 skipedSmall++;
194 continue;
192 } 195 }
193 196
194 if (scale.X > NonPhysicalPrimScaleMax || scale.Y > NonPhysicalPrimScaleMax || scale.Z > NonPhysicalPrimScaleMax) 197 if (scale.X > NonPhysicalPrimScaleMax || scale.Y > NonPhysicalPrimScaleMax || scale.Z > NonPhysicalPrimScaleMax)
@@ -229,7 +232,13 @@ namespace OpenSim.Region.ClientStack.Linden
229 // charge for prims creation 232 // charge for prims creation
230 meshsfee += primCreationCost; 233 meshsfee += primCreationCost;
231 } 234 }
232 235
236 if (skipedSmall >0 && skipedSmall > numberInstances / 2)
237 {
238 error = "Upload failed: Model contains too much prims smaller than minimum size to ignore";
239 return false;
240 }
241
233 if (meshcostdata.physics_cost <= meshcostdata.model_streaming_cost) 242 if (meshcostdata.physics_cost <= meshcostdata.model_streaming_cost)
234 meshcostdata.resource_cost = meshcostdata.model_streaming_cost; 243 meshcostdata.resource_cost = meshcostdata.model_streaming_cost;
235 else 244 else