diff options
author | UbitUmarov | 2019-02-05 01:45:04 +0000 |
---|---|---|
committer | UbitUmarov | 2019-02-05 01:45:04 +0000 |
commit | 175817fe55b387369ad9f461bddcbe1c8d65e986 (patch) | |
tree | 2801eba6d5fcc697748f8c7b403d572138b2edf9 | |
parent | prevent freswitch from messing global cert validation, more work is need on r... (diff) | |
download | opensim-SC-175817fe55b387369ad9f461bddcbe1c8d65e986.zip opensim-SC-175817fe55b387369ad9f461bddcbe1c8d65e986.tar.gz opensim-SC-175817fe55b387369ad9f461bddcbe1c8d65e986.tar.bz2 opensim-SC-175817fe55b387369ad9f461bddcbe1c8d65e986.tar.xz |
enforce prim size restrictions on physical state change; Place restrictions on ini values
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 25 |
2 files changed, 32 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 58f3b61..785b4c3 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -951,18 +951,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
951 | { | 951 | { |
952 | m_minNonphys = RegionInfo.NonphysPrimMin; | 952 | m_minNonphys = RegionInfo.NonphysPrimMin; |
953 | } | 953 | } |
954 | // don't allow nonsense values | ||
955 | if(m_minNonphys < 0.001f) | ||
956 | m_minNonphys = 0.001f; | ||
954 | 957 | ||
955 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); | 958 | m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); |
956 | if (RegionInfo.NonphysPrimMax > 0) | 959 | if (RegionInfo.NonphysPrimMax > 0) |
957 | { | 960 | { |
958 | m_maxNonphys = RegionInfo.NonphysPrimMax; | 961 | m_maxNonphys = RegionInfo.NonphysPrimMax; |
959 | } | 962 | } |
963 | if (m_maxNonphys > 2048) | ||
964 | m_maxNonphys = 2048; | ||
960 | 965 | ||
961 | m_minPhys = startupConfig.GetFloat("PhysicalPrimMin", m_minPhys); | 966 | m_minPhys = startupConfig.GetFloat("PhysicalPrimMin", m_minPhys); |
962 | if (RegionInfo.PhysPrimMin > 0) | 967 | if (RegionInfo.PhysPrimMin > 0) |
963 | { | 968 | { |
964 | m_minPhys = RegionInfo.PhysPrimMin; | 969 | m_minPhys = RegionInfo.PhysPrimMin; |
965 | } | 970 | } |
971 | if(m_minPhys < 0.01f) | ||
972 | m_minPhys = 0.01f; | ||
966 | 973 | ||
967 | m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys); | 974 | m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys); |
968 | 975 | ||
@@ -970,6 +977,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
970 | { | 977 | { |
971 | m_maxPhys = RegionInfo.PhysPrimMax; | 978 | m_maxPhys = RegionInfo.PhysPrimMax; |
972 | } | 979 | } |
980 | if (m_maxPhys > 2048) | ||
981 | m_maxPhys = 2048; | ||
973 | 982 | ||
974 | m_linksetCapacity = startupConfig.GetInt("LinksetPrims", m_linksetCapacity); | 983 | m_linksetCapacity = startupConfig.GetInt("LinksetPrims", m_linksetCapacity); |
975 | if (RegionInfo.LinksetCapacity > 0) | 984 | if (RegionInfo.LinksetCapacity > 0) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a7d1809..a23ebbf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2319,6 +2319,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2319 | 2319 | ||
2320 | if (pa != null) | 2320 | if (pa != null) |
2321 | { | 2321 | { |
2322 | if (UsePhysics != pa.IsPhysical) | ||
2323 | { | ||
2324 | float minsize = UsePhysics ? ParentGroup.Scene.m_minPhys : ParentGroup.Scene.m_minNonphys; | ||
2325 | float maxsize = UsePhysics ? ParentGroup.Scene.m_maxPhys : ParentGroup.Scene.m_maxNonphys; | ||
2326 | Vector3 scale = Scale; | ||
2327 | scale.X = Util.Clamp(scale.X, minsize, maxsize); | ||
2328 | scale.Y = Util.Clamp(scale.Y, minsize, maxsize); | ||
2329 | scale.Z = Util.Clamp(scale.Z, minsize, maxsize); | ||
2330 | Scale = scale; | ||
2331 | } | ||
2332 | |||
2322 | if (UsePhysics != pa.IsPhysical || isNew) | 2333 | if (UsePhysics != pa.IsPhysical || isNew) |
2323 | { | 2334 | { |
2324 | if (pa.IsPhysical) // implies UsePhysics==false for this block | 2335 | if (pa.IsPhysical) // implies UsePhysics==false for this block |
@@ -4776,10 +4787,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
4776 | /// <param name="applyDynamics">applies velocities, force and torque</param> | 4787 | /// <param name="applyDynamics">applies velocities, force and torque</param> |
4777 | private void AddToPhysics(bool isPhysical, bool isPhantom, bool building, bool applyDynamics) | 4788 | private void AddToPhysics(bool isPhysical, bool isPhantom, bool building, bool applyDynamics) |
4778 | { | 4789 | { |
4779 | PhysicsActor pa; | 4790 | if (ParentGroup.Scene != null) |
4791 | { | ||
4792 | float minsize = isPhysical ? ParentGroup.Scene.m_minPhys : ParentGroup.Scene.m_minNonphys; | ||
4793 | float maxsize = isPhysical ? ParentGroup.Scene.m_maxPhys : ParentGroup.Scene.m_maxNonphys; | ||
4794 | Vector3 scale = Scale; | ||
4795 | scale.X = Util.Clamp(scale.X, minsize, maxsize); | ||
4796 | scale.Y = Util.Clamp(scale.Y, minsize, maxsize); | ||
4797 | scale.Z = Util.Clamp(scale.Z, minsize, maxsize); | ||
4798 | Scale = scale; | ||
4799 | } | ||
4780 | 4800 | ||
4801 | PhysicsActor pa; | ||
4781 | Vector3 velocity = Velocity; | 4802 | Vector3 velocity = Velocity; |
4782 | Vector3 rotationalVelocity = AngularVelocity;; | 4803 | Vector3 rotationalVelocity = AngularVelocity; ; |
4783 | 4804 | ||
4784 | try | 4805 | try |
4785 | { | 4806 | { |