aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorMelanie Thielker2008-07-20 15:19:26 +0000
committerMelanie Thielker2008-07-20 15:19:26 +0000
commit8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e (patch)
tree33f604591d56737cd417975911612efa0fac3bd3 /OpenSim/Region/Environment
parentChange SQLite argument marker from the more standard '@' to the ':' supported (diff)
downloadopensim-SC-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.zip
opensim-SC-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.tar.gz
opensim-SC-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.tar.bz2
opensim-SC-8ae7dc628b2681b02c43a5acd1e1bdf4f33b1f3e.tar.xz
Make the max sizes of physical and nonphysical prims configurable in OpenSim.ini
Defaulted to 65536 and 10, respectively
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs72
2 files changed, 51 insertions, 37 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 0ab729d..f602e9f 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -88,6 +88,8 @@ namespace OpenSim.Region.Environment.Scenes
88 /// Are we applying physics to any of the prims in this scene? 88 /// Are we applying physics to any of the prims in this scene?
89 /// </summary> 89 /// </summary>
90 public bool m_physicalPrim; 90 public bool m_physicalPrim;
91 public float m_maxNonphys = 65536;
92 public float m_maxPhys = 10;
91 93
92 public bool m_seeIntoRegionFromNeighbor; 94 public bool m_seeIntoRegionFromNeighbor;
93 public int MaxUndoCount = 5; 95 public int MaxUndoCount = 5;
@@ -308,6 +310,18 @@ namespace OpenSim.Region.Environment.Scenes
308 m_simulatorVersion = simulatorVersion 310 m_simulatorVersion = simulatorVersion
309 + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString() 311 + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
310 + " PhysPrim:" + m_physicalPrim.ToString(); 312 + " PhysPrim:" + m_physicalPrim.ToString();
313
314 try
315 {
316 IConfig startupConfig = m_config.Configs["Startup"];
317 m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f);
318 m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f);
319 }
320 catch (Exception)
321 {
322 m_log.Warn("Failed to load StartupConfig");
323 }
324
311 } 325 }
312 326
313 #endregion 327 #endregion
@@ -1146,7 +1160,7 @@ namespace OpenSim.Region.Environment.Scenes
1146 } 1160 }
1147 catch (Exception) 1161 catch (Exception)
1148 { 1162 {
1149 m_log.Warn("Failed to load StarupConfg"); 1163 m_log.Warn("Failed to load StartupConfig");
1150 } 1164 }
1151 1165
1152 if (drawPrimVolume) 1166 if (drawPrimVolume)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 82e395d..c2ce9d8 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -2131,12 +2131,12 @@ namespace OpenSim.Region.Environment.Scenes
2131 /// <param name="localID"></param> 2131 /// <param name="localID"></param>
2132 public void Resize(LLVector3 scale, uint localID) 2132 public void Resize(LLVector3 scale, uint localID)
2133 { 2133 {
2134 if(scale.X > 65536.0f) 2134 if(scale.X > m_scene.m_maxNonphys)
2135 scale.X = 65536.0f; 2135 scale.X = m_scene.m_maxNonphys;
2136 if(scale.Y > 65536.0f) 2136 if(scale.Y > m_scene.m_maxNonphys)
2137 scale.Y = 65536.0f; 2137 scale.Y = m_scene.m_maxNonphys;
2138 if(scale.Z > 65536.0f) 2138 if(scale.Z > m_scene.m_maxNonphys)
2139 scale.Z = 65536.0f; 2139 scale.Z = m_scene.m_maxNonphys;
2140 2140
2141 SceneObjectPart part = GetChildPart(localID); 2141 SceneObjectPart part = GetChildPart(localID);
2142 if (part != null) 2142 if (part != null)
@@ -2146,12 +2146,12 @@ namespace OpenSim.Region.Environment.Scenes
2146 { 2146 {
2147 if(part.PhysActor.IsPhysical) 2147 if(part.PhysActor.IsPhysical)
2148 { 2148 {
2149 if(scale.X > 10.0f) 2149 if(scale.X > m_scene.m_maxPhys)
2150 scale.X = 10.0f; 2150 scale.X = m_scene.m_maxPhys;
2151 if(scale.Y > 10.0f) 2151 if(scale.Y > m_scene.m_maxPhys)
2152 scale.Y = 10.0f; 2152 scale.Y = m_scene.m_maxPhys;
2153 if(scale.Z > 10.0f) 2153 if(scale.Z > m_scene.m_maxPhys)
2154 scale.Z = 10.0f; 2154 scale.Z = m_scene.m_maxPhys;
2155 } 2155 }
2156 part.PhysActor.Size = 2156 part.PhysActor.Size =
2157 new PhysicsVector(scale.X, scale.Y, scale.Z); 2157 new PhysicsVector(scale.X, scale.Y, scale.Z);
@@ -2179,20 +2179,20 @@ namespace OpenSim.Region.Environment.Scenes
2179 SceneObjectPart part = GetChildPart(localID); 2179 SceneObjectPart part = GetChildPart(localID);
2180 if (part != null) 2180 if (part != null)
2181 { 2181 {
2182 if(scale.X > 65536.0f) 2182 if(scale.X > m_scene.m_maxNonphys)
2183 scale.X = 65536.0f; 2183 scale.X = m_scene.m_maxNonphys;
2184 if(scale.Y > 65536.0f) 2184 if(scale.Y > m_scene.m_maxNonphys)
2185 scale.Y = 65536.0f; 2185 scale.Y = m_scene.m_maxNonphys;
2186 if(scale.Z > 65536.0f) 2186 if(scale.Z > m_scene.m_maxNonphys)
2187 scale.Z = 65536.0f; 2187 scale.Z = m_scene.m_maxNonphys;
2188 if(part.PhysActor != null && part.PhysActor.IsPhysical) 2188 if(part.PhysActor != null && part.PhysActor.IsPhysical)
2189 { 2189 {
2190 if(scale.X > 10.0f) 2190 if(scale.X > m_scene.m_maxPhys)
2191 scale.X = 10.0f; 2191 scale.X = m_scene.m_maxPhys;
2192 if(scale.Y > 10.0f) 2192 if(scale.Y > m_scene.m_maxPhys)
2193 scale.Y = 10.0f; 2193 scale.Y = m_scene.m_maxPhys;
2194 if(scale.Z > 10.0f) 2194 if(scale.Z > m_scene.m_maxPhys)
2195 scale.Z = 10.0f; 2195 scale.Z = m_scene.m_maxPhys;
2196 } 2196 }
2197 float x = (scale.X / part.Scale.X); 2197 float x = (scale.X / part.Scale.X);
2198 float y = (scale.Y / part.Scale.Y); 2198 float y = (scale.Y / part.Scale.Y);
@@ -2213,25 +2213,25 @@ namespace OpenSim.Region.Environment.Scenes
2213 2213
2214 if(part.PhysActor != null && part.PhysActor.IsPhysical) 2214 if(part.PhysActor != null && part.PhysActor.IsPhysical)
2215 { 2215 {
2216 if(oldSize.X*x > 10.0f) 2216 if(oldSize.X*x > m_scene.m_maxPhys)
2217 { 2217 {
2218 f = 10.0f / oldSize.X; 2218 f = m_scene.m_maxPhys / oldSize.X;
2219 a = f / x; 2219 a = f / x;
2220 x *= a; 2220 x *= a;
2221 y *= a; 2221 y *= a;
2222 z *= a; 2222 z *= a;
2223 } 2223 }
2224 if(oldSize.Y*y > 10.0f) 2224 if(oldSize.Y*y > m_scene.m_maxPhys)
2225 { 2225 {
2226 f = 10.0f / oldSize.Y; 2226 f = m_scene.m_maxPhys / oldSize.Y;
2227 a = f / y; 2227 a = f / y;
2228 x *= a; 2228 x *= a;
2229 y *= a; 2229 y *= a;
2230 z *= a; 2230 z *= a;
2231 } 2231 }
2232 if(oldSize.Z*z > 10.0f) 2232 if(oldSize.Z*z > m_scene.m_maxPhys)
2233 { 2233 {
2234 f = 10.0f / oldSize.Z; 2234 f = m_scene.m_maxPhys / oldSize.Z;
2235 a = f / z; 2235 a = f / z;
2236 x *= a; 2236 x *= a;
2237 y *= a; 2237 y *= a;
@@ -2240,25 +2240,25 @@ namespace OpenSim.Region.Environment.Scenes
2240 } 2240 }
2241 else 2241 else
2242 { 2242 {
2243 if(oldSize.X*x > 65536.0f) 2243 if(oldSize.X*x > m_scene.m_maxNonphys)
2244 { 2244 {
2245 f = 65536.0f / oldSize.X; 2245 f = m_scene.m_maxNonphys / oldSize.X;
2246 a = f / x; 2246 a = f / x;
2247 x *= a; 2247 x *= a;
2248 y *= a; 2248 y *= a;
2249 z *= a; 2249 z *= a;
2250 } 2250 }
2251 if(oldSize.Y*y > 65536.0f) 2251 if(oldSize.Y*y > m_scene.m_maxNonphys)
2252 { 2252 {
2253 f = 65536.0f / oldSize.Y; 2253 f = m_scene.m_maxNonphys / oldSize.Y;
2254 a = f / y; 2254 a = f / y;
2255 x *= a; 2255 x *= a;
2256 y *= a; 2256 y *= a;
2257 z *= a; 2257 z *= a;
2258 } 2258 }
2259 if(oldSize.Z*z > 65536.0f) 2259 if(oldSize.Z*z > m_scene.m_maxNonphys)
2260 { 2260 {
2261 f = 65536.0f / oldSize.Z; 2261 f = m_scene.m_maxNonphys / oldSize.Z;
2262 a = f / z; 2262 a = f / z;
2263 x *= a; 2263 x *= a;
2264 y *= a; 2264 y *= a;