Make the max sizes of physical and nonphysical prims configurable in OpenSim.ini

Defaulted to 65536 and 10, respectively
0.6.0-stable
Melanie Thielker 2008-07-20 15:19:26 +00:00
parent 212ab8c6d9
commit 8ae7dc628b
5 changed files with 81 additions and 63 deletions

View File

@ -88,6 +88,8 @@ namespace OpenSim.Region.Environment.Scenes
/// Are we applying physics to any of the prims in this scene? /// Are we applying physics to any of the prims in this scene?
/// </summary> /// </summary>
public bool m_physicalPrim; public bool m_physicalPrim;
public float m_maxNonphys = 65536;
public float m_maxPhys = 10;
public bool m_seeIntoRegionFromNeighbor; public bool m_seeIntoRegionFromNeighbor;
public int MaxUndoCount = 5; public int MaxUndoCount = 5;
@ -308,6 +310,18 @@ namespace OpenSim.Region.Environment.Scenes
m_simulatorVersion = simulatorVersion m_simulatorVersion = simulatorVersion
+ " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString() + " ChilTasks:" + m_seeIntoRegionFromNeighbor.ToString()
+ " PhysPrim:" + m_physicalPrim.ToString(); + " PhysPrim:" + m_physicalPrim.ToString();
try
{
IConfig startupConfig = m_config.Configs["Startup"];
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", 65536.0f);
m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", 10.0f);
}
catch (Exception)
{
m_log.Warn("Failed to load StartupConfig");
}
} }
#endregion #endregion
@ -1146,7 +1160,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
catch (Exception) catch (Exception)
{ {
m_log.Warn("Failed to load StarupConfg"); m_log.Warn("Failed to load StartupConfig");
} }
if (drawPrimVolume) if (drawPrimVolume)

View File

@ -2131,12 +2131,12 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="localID"></param> /// <param name="localID"></param>
public void Resize(LLVector3 scale, uint localID) public void Resize(LLVector3 scale, uint localID)
{ {
if(scale.X > 65536.0f) if(scale.X > m_scene.m_maxNonphys)
scale.X = 65536.0f; scale.X = m_scene.m_maxNonphys;
if(scale.Y > 65536.0f) if(scale.Y > m_scene.m_maxNonphys)
scale.Y = 65536.0f; scale.Y = m_scene.m_maxNonphys;
if(scale.Z > 65536.0f) if(scale.Z > m_scene.m_maxNonphys)
scale.Z = 65536.0f; scale.Z = m_scene.m_maxNonphys;
SceneObjectPart part = GetChildPart(localID); SceneObjectPart part = GetChildPart(localID);
if (part != null) if (part != null)
@ -2146,12 +2146,12 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if(part.PhysActor.IsPhysical) if(part.PhysActor.IsPhysical)
{ {
if(scale.X > 10.0f) if(scale.X > m_scene.m_maxPhys)
scale.X = 10.0f; scale.X = m_scene.m_maxPhys;
if(scale.Y > 10.0f) if(scale.Y > m_scene.m_maxPhys)
scale.Y = 10.0f; scale.Y = m_scene.m_maxPhys;
if(scale.Z > 10.0f) if(scale.Z > m_scene.m_maxPhys)
scale.Z = 10.0f; scale.Z = m_scene.m_maxPhys;
} }
part.PhysActor.Size = part.PhysActor.Size =
new PhysicsVector(scale.X, scale.Y, scale.Z); new PhysicsVector(scale.X, scale.Y, scale.Z);
@ -2179,20 +2179,20 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectPart part = GetChildPart(localID); SceneObjectPart part = GetChildPart(localID);
if (part != null) if (part != null)
{ {
if(scale.X > 65536.0f) if(scale.X > m_scene.m_maxNonphys)
scale.X = 65536.0f; scale.X = m_scene.m_maxNonphys;
if(scale.Y > 65536.0f) if(scale.Y > m_scene.m_maxNonphys)
scale.Y = 65536.0f; scale.Y = m_scene.m_maxNonphys;
if(scale.Z > 65536.0f) if(scale.Z > m_scene.m_maxNonphys)
scale.Z = 65536.0f; scale.Z = m_scene.m_maxNonphys;
if(part.PhysActor != null && part.PhysActor.IsPhysical) if(part.PhysActor != null && part.PhysActor.IsPhysical)
{ {
if(scale.X > 10.0f) if(scale.X > m_scene.m_maxPhys)
scale.X = 10.0f; scale.X = m_scene.m_maxPhys;
if(scale.Y > 10.0f) if(scale.Y > m_scene.m_maxPhys)
scale.Y = 10.0f; scale.Y = m_scene.m_maxPhys;
if(scale.Z > 10.0f) if(scale.Z > m_scene.m_maxPhys)
scale.Z = 10.0f; scale.Z = m_scene.m_maxPhys;
} }
float x = (scale.X / part.Scale.X); float x = (scale.X / part.Scale.X);
float y = (scale.Y / part.Scale.Y); float y = (scale.Y / part.Scale.Y);
@ -2213,25 +2213,25 @@ namespace OpenSim.Region.Environment.Scenes
if(part.PhysActor != null && part.PhysActor.IsPhysical) if(part.PhysActor != null && part.PhysActor.IsPhysical)
{ {
if(oldSize.X*x > 10.0f) if(oldSize.X*x > m_scene.m_maxPhys)
{ {
f = 10.0f / oldSize.X; f = m_scene.m_maxPhys / oldSize.X;
a = f / x; a = f / x;
x *= a; x *= a;
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Y*y > 10.0f) if(oldSize.Y*y > m_scene.m_maxPhys)
{ {
f = 10.0f / oldSize.Y; f = m_scene.m_maxPhys / oldSize.Y;
a = f / y; a = f / y;
x *= a; x *= a;
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Z*z > 10.0f) if(oldSize.Z*z > m_scene.m_maxPhys)
{ {
f = 10.0f / oldSize.Z; f = m_scene.m_maxPhys / oldSize.Z;
a = f / z; a = f / z;
x *= a; x *= a;
y *= a; y *= a;
@ -2240,25 +2240,25 @@ namespace OpenSim.Region.Environment.Scenes
} }
else else
{ {
if(oldSize.X*x > 65536.0f) if(oldSize.X*x > m_scene.m_maxNonphys)
{ {
f = 65536.0f / oldSize.X; f = m_scene.m_maxNonphys / oldSize.X;
a = f / x; a = f / x;
x *= a; x *= a;
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Y*y > 65536.0f) if(oldSize.Y*y > m_scene.m_maxNonphys)
{ {
f = 65536.0f / oldSize.Y; f = m_scene.m_maxNonphys / oldSize.Y;
a = f / y; a = f / y;
x *= a; x *= a;
y *= a; y *= a;
z *= a; z *= a;
} }
if(oldSize.Z*z > 65536.0f) if(oldSize.Z*z > m_scene.m_maxNonphys)
{ {
f = 65536.0f / oldSize.Z; f = m_scene.m_maxNonphys / oldSize.Z;
a = f / z; a = f / z;
x *= a; x *= a;
y *= a; y *= a;

View File

@ -933,7 +933,7 @@ namespace OpenSim.Region.ScriptEngine.Common
bool allow = true; bool allow = true;
foreach(SceneObjectPart part in group.Children.Values) foreach(SceneObjectPart part in group.Children.Values)
{ {
if(part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
{ {
allow = false; allow = false;
break; break;
@ -1066,19 +1066,19 @@ namespace OpenSim.Region.ScriptEngine.Common
if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
{ {
if(scale.x > 10.0) if(scale.x > World.m_maxPhys)
scale.x = 10.0; scale.x = World.m_maxPhys;
if(scale.y > 10.0) if(scale.y > World.m_maxPhys)
scale.y = 10.0; scale.y = World.m_maxPhys;
if(scale.z > 10.0) if(scale.z > World.m_maxPhys)
scale.z = 10.0; scale.z = World.m_maxPhys;
} }
if(scale.x > 65536.0) if(scale.x > World.m_maxNonphys)
scale.x = 65536.0; scale.x = World.m_maxNonphys;
if(scale.y > 65536.0) if(scale.y > World.m_maxNonphys)
scale.y = 65536.0; scale.y = World.m_maxNonphys;
if(scale.z > 65536.0) if(scale.z > World.m_maxNonphys)
scale.z = 65536.0; scale.z = World.m_maxNonphys;
LLVector3 tmp = part.Scale; LLVector3 tmp = part.Scale;
tmp.X = (float)scale.x; tmp.X = (float)scale.x;
tmp.Y = (float)scale.y; tmp.Y = (float)scale.y;

View File

@ -775,7 +775,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
bool allow = true; bool allow = true;
foreach(SceneObjectPart part in group.Children.Values) foreach(SceneObjectPart part in group.Children.Values)
{ {
if(part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0) if(part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
{ {
allow = false; allow = false;
break; break;
@ -922,19 +922,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
{ {
if(scale.x > 10.0) if(scale.x > World.m_maxPhys)
scale.x = 10.0; scale.x = World.m_maxPhys;
if(scale.y > 10.0) if(scale.y > World.m_maxPhys)
scale.y = 10.0; scale.y = World.m_maxPhys;
if(scale.z > 10.0) if(scale.z > World.m_maxPhys)
scale.z = 10.0; scale.z = World.m_maxPhys;
} }
if(scale.x > 65536.0) if(scale.x > World.m_maxNonphys)
scale.x = 65536.0; scale.x = World.m_maxNonphys;
if(scale.y > 65536.0) if(scale.y > World.m_maxNonphys)
scale.y = 65536.0; scale.y = World.m_maxNonphys;
if(scale.z > 65536.0) if(scale.z > World.m_maxNonphys)
scale.z = 65536.0; scale.z = World.m_maxNonphys;
LLVector3 tmp = part.Scale; LLVector3 tmp = part.Scale;
tmp.X = (float)scale.x; tmp.X = (float)scale.x;
tmp.Y = (float)scale.y; tmp.Y = (float)scale.y;

View File

@ -26,6 +26,10 @@ region_info_source = "filesystem"
; objects, so you can turn it off here if you'd like. ; objects, so you can turn it off here if you'd like.
DrawPrimOnMapTile = true DrawPrimOnMapTile = true
; Maximum total size, and maximum size where a prim can be physical
NonPhysicalPrimMax = 65536
PhysicalPrimMax = 10
; ## ; ##
; ## STORAGE ; ## STORAGE
; ## ; ##