aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorCharles Krinke2008-07-10 03:13:29 +0000
committerCharles Krinke2008-07-10 03:13:29 +0000
commit38da8960e98c12a16bf8a25e9fe7e03ee251933c (patch)
tree2e54441d2bedee44a3a9f0a083dc56e9a290349a /OpenSim/Region/ScriptEngine/Shared/Api
parentMantis#1673. Thank you kindly, Matth for a patch that: (diff)
downloadopensim-SC-38da8960e98c12a16bf8a25e9fe7e03ee251933c.zip
opensim-SC-38da8960e98c12a16bf8a25e9fe7e03ee251933c.tar.gz
opensim-SC-38da8960e98c12a16bf8a25e9fe7e03ee251933c.tar.bz2
opensim-SC-38da8960e98c12a16bf8a25e9fe7e03ee251933c.tar.xz
Mantis#1707. Thank you, Melanie for a patch that:
This patch limits the maximum size of prims that can be created using libsl bots or modified clients to 65536mper side. It also limits LSL functions to that size. If a prim is already physical, the enforced constraint is 10m. A prim that is larger than 10m cannot be turned physical, either via script or UI. Linksets are handled correctly, so scaling of physical linksets is constrained by the size of it's largest component prim. Also, turning linksets physical is based on the size of it's largest ptim.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 57f9141..4bf3e93 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -671,7 +671,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
671 if ((status & ScriptBaseClass.STATUS_PHYSICS) == ScriptBaseClass.STATUS_PHYSICS) 671 if ((status & ScriptBaseClass.STATUS_PHYSICS) == ScriptBaseClass.STATUS_PHYSICS)
672 { 672 {
673 if (value == 1) 673 if (value == 1)
674 {
675 SceneObjectGroup group = m_host.ParentGroup;
676 if(group == null)
677 return;
678 bool allow = true;
679 foreach(SceneObjectPart part in group.Children.Values)
680 {
681 if(part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0)
682 {
683 allow = false;
684 break;
685 }
686 }
687
688 if(!allow)
689 return;
674 m_host.ScriptSetPhysicsStatus(true); 690 m_host.ScriptSetPhysicsStatus(true);
691 }
675 else 692 else
676 m_host.ScriptSetPhysicsStatus(false); 693 m_host.ScriptSetPhysicsStatus(false);
677 } 694 }
@@ -802,6 +819,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
802 private void SetScale(SceneObjectPart part, LSL_Types.Vector3 scale) 819 private void SetScale(SceneObjectPart part, LSL_Types.Vector3 scale)
803 { 820 {
804 // TODO: this needs to trigger a persistance save as well 821 // TODO: this needs to trigger a persistance save as well
822
823 if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null)
824 return;
825
826 if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
827 {
828 if(scale.x > 10.0)
829 scale.x = 10.0;
830 if(scale.y > 10.0)
831 scale.y = 10.0;
832 if(scale.z > 10.0)
833 scale.z = 10.0;
834 }
835 if(scale.x > 65536.0)
836 scale.x = 65536.0;
837 if(scale.y > 65536.0)
838 scale.y = 65536.0;
839 if(scale.z > 65536.0)
840 scale.z = 65536.0;
805 LLVector3 tmp = part.Scale; 841 LLVector3 tmp = part.Scale;
806 tmp.X = (float)scale.x; 842 tmp.X = (float)scale.x;
807 tmp.Y = (float)scale.y; 843 tmp.Y = (float)scale.y;