aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorSignpostMarv2012-08-06 15:35:40 +0100
committerJustin Clark-Casey (justincc)2012-08-15 23:35:23 +0100
commitef4122213c440c55d32c097c08e52170f4b4346a (patch)
treeba7aa3047bac89053992d2539907f07d110f415e /OpenSim/Region/ScriptEngine/Shared
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-ef4122213c440c55d32c097c08e52170f4b4346a.zip
opensim-SC_OLD-ef4122213c440c55d32c097c08e52170f4b4346a.tar.gz
opensim-SC_OLD-ef4122213c440c55d32c097c08e52170f4b4346a.tar.bz2
opensim-SC_OLD-ef4122213c440c55d32c097c08e52170f4b4346a.tar.xz
enables configurable minimum sizes for physical & non-physical prims
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs28
1 files changed, 8 insertions, 20 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 55567d1..a7852ec 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1343,31 +1343,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1343 if (part == null || part.ParentGroup.IsDeleted) 1343 if (part == null || part.ParentGroup.IsDeleted)
1344 return; 1344 return;
1345 1345
1346 if (scale.x < 0.01) 1346 // First we need to check whether or not we need to clamp the size of a physics-enabled prim
1347 scale.x = 0.01;
1348 if (scale.y < 0.01)
1349 scale.y = 0.01;
1350 if (scale.z < 0.01)
1351 scale.z = 0.01;
1352
1353 PhysicsActor pa = part.ParentGroup.RootPart.PhysActor; 1347 PhysicsActor pa = part.ParentGroup.RootPart.PhysActor;
1354
1355 if (pa != null && pa.IsPhysical) 1348 if (pa != null && pa.IsPhysical)
1356 { 1349 {
1357 if (scale.x > World.m_maxPhys) 1350 scale.x = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.x));
1358 scale.x = World.m_maxPhys; 1351 scale.y = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.y));
1359 if (scale.y > World.m_maxPhys) 1352 scale.z = Math.Max(World.m_minPhys, Math.Min(World.m_maxPhys, scale.z));
1360 scale.y = World.m_maxPhys;
1361 if (scale.z > World.m_maxPhys)
1362 scale.z = World.m_maxPhys;
1363 } 1353 }
1364 1354
1365 if (scale.x > World.m_maxNonphys) 1355 // Next we clamp the scale to the non-physical min/max
1366 scale.x = World.m_maxNonphys; 1356 scale.x = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.x));
1367 if (scale.y > World.m_maxNonphys) 1357 scale.y = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.y));
1368 scale.y = World.m_maxNonphys; 1358 scale.z = Math.Max(World.m_minNonphys, Math.Min(World.m_maxNonphys, scale.z));
1369 if (scale.z > World.m_maxNonphys)
1370 scale.z = World.m_maxNonphys;
1371 1359
1372 Vector3 tmp = part.Scale; 1360 Vector3 tmp = part.Scale;
1373 tmp.X = (float)scale.x; 1361 tmp.X = (float)scale.x;