aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs35
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs54
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs83
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs11
8 files changed, 162 insertions, 47 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 2c7cd40..3ae0dea 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -701,22 +701,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
701 sp.RemoveAttachment(so); 701 sp.RemoveAttachment(so);
702 so.FromItemID = UUID.Zero; 702 so.FromItemID = UUID.Zero;
703 703
704 so.AttachedAvatar = UUID.Zero;
705 so.ClearPartAttachmentData();
706
704 SceneObjectPart rootPart = so.RootPart; 707 SceneObjectPart rootPart = so.RootPart;
708
709 rootPart.SetParentLocalId(0);
705 so.AbsolutePosition = absolutePos; 710 so.AbsolutePosition = absolutePos;
706 if (absoluteRot != Quaternion.Identity) 711 if (absoluteRot != Quaternion.Identity)
707 { 712 {
708 so.UpdateGroupRotationR(absoluteRot); 713 so.UpdateGroupRotationR(absoluteRot);
709 } 714 }
710 so.AttachedAvatar = UUID.Zero; 715
711 rootPart.SetParentLocalId(0); 716 rootPart.RemFlag(PrimFlags.TemporaryOnRez);
712 so.ClearPartAttachmentData(); 717
713 rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false); 718 // not physical, not temporary, phaton, not volume detector
719// so.UpdatePrimFlags(rootPart.LocalId,false,false,true,rootPart.VolumeDetectActive);
720
721 // restore full physical state instead
722 so.ApplyPhysics();
723
714 so.HasGroupChanged = true; 724 so.HasGroupChanged = true;
715 rootPart.Rezzed = DateTime.Now; 725 rootPart.Rezzed = DateTime.Now;
716 rootPart.RemFlag(PrimFlags.TemporaryOnRez);
717 so.AttachToBackup(); 726 so.AttachToBackup();
718 m_scene.EventManager.TriggerParcelPrimCountTainted(); 727 m_scene.EventManager.TriggerParcelPrimCountTainted();
719 rootPart.ScheduleFullUpdate(); 728
720 rootPart.ClearUndoState(); 729 rootPart.ClearUndoState();
721 730
722 List<UUID> uuids = new List<UUID>(); 731 List<UUID> uuids = new List<UUID>();
@@ -729,6 +738,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
729 738
730 // Attach (NULL) stops scripts. We don't want that. Resume them. 739 // Attach (NULL) stops scripts. We don't want that. Resume them.
731 so.ResumeScripts(); 740 so.ResumeScripts();
741 so.ScheduleGroupForTerseUpdate();
742 so.RootPart.ScheduleFullUpdate();
732 } 743 }
733 744
734 public void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup so) 745 public void DetachSingleAttachmentToInv(IScenePresence sp, SceneObjectGroup so)
@@ -907,8 +918,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
907 918
908 so.AttachedAvatar = sp.UUID; 919 so.AttachedAvatar = sp.UUID;
909 920
910 if (so.RootPart.PhysActor != null) 921 foreach (SceneObjectPart part in so.Parts)
911 so.RootPart.RemoveFromPhysics(); 922 {
923// if (part.KeyframeMotion != null)
924// part.KeyframeMotion.Suspend();
925
926 if (part.PhysActor != null)
927 {
928 part.RemoveFromPhysics();
929 }
930 }
912 931
913 so.AbsolutePosition = attachOffset; 932 so.AbsolutePosition = attachOffset;
914 so.RootPart.AttachedPos = attachOffset; 933 so.RootPart.AttachedPos = attachOffset;
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 7b13e0b..e8ad0f2 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -908,7 +908,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
908 908
909 if (attachment) 909 if (attachment)
910 { 910 {
911 group.RootPart.Flags |= PrimFlags.Phantom; 911// group.RootPart.Flags |= PrimFlags.Phantom;
912 group.IsAttachment = true; 912 group.IsAttachment = true;
913 } 913 }
914 914
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 8634a3a..e003a59 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -2705,12 +2705,17 @@ namespace OpenSim.Region.Framework.Scenes
2705 return; 2705 return;
2706 } 2706 }
2707 2707
2708 bool oldUsePhysics = (root.Flags & PrimFlags.Physics) != 0;
2708 m_sceneGraph.LinkObjects(root, children); 2709 m_sceneGraph.LinkObjects(root, children);
2709 2710
2710 ScenePresence sp; 2711 ScenePresence sp;
2711 if (TryGetScenePresence(agentId, out sp)) 2712 if (TryGetScenePresence(agentId, out sp))
2712 { 2713 {
2713 root.SendPropertiesToClient(sp.ControllingClient); 2714 root.SendPropertiesToClient(sp.ControllingClient);
2715 if (oldUsePhysics && (root.Flags & PrimFlags.Physics) == 0)
2716 {
2717 sp.ControllingClient.SendAlertMessage("Object physics canceled");
2718 }
2714 } 2719 }
2715 } 2720 }
2716 2721
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index aa81000..7275c15 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -204,6 +204,12 @@ namespace OpenSim.Region.Framework.Scenes
204 /// </summary> 204 /// </summary>
205 public int m_linksetCapacity = 0; 205 public int m_linksetCapacity = 0;
206 206
207 /// <summary>
208 /// Max prims an Physical object will hold
209 /// </summary>
210 ///
211 public int m_linksetPhysCapacity = 0;
212
207 public bool m_clampPrimSize; 213 public bool m_clampPrimSize;
208 public bool m_trustBinaries; 214 public bool m_trustBinaries;
209 public bool m_allowScriptCrossings; 215 public bool m_allowScriptCrossings;
@@ -901,6 +907,9 @@ namespace OpenSim.Region.Framework.Scenes
901 m_linksetCapacity = RegionInfo.LinksetCapacity; 907 m_linksetCapacity = RegionInfo.LinksetCapacity;
902 } 908 }
903 909
910 m_linksetPhysCapacity = startupConfig.GetInt("LinksetPhysPrims", m_linksetPhysCapacity);
911
912
904 SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest"); 913 SpawnPointRouting = startupConfig.GetString("SpawnPointRouting", "closest");
905 TelehubAllowLandmarks = startupConfig.GetBoolean("TelehubAllowLandmark", false); 914 TelehubAllowLandmarks = startupConfig.GetBoolean("TelehubAllowLandmark", false);
906 915
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b0f8991..973891b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1547,6 +1547,7 @@ namespace OpenSim.Region.Framework.Scenes
1547 // VolumeDetect can't be set via UI and will always be off when a change is made there 1547 // VolumeDetect can't be set via UI and will always be off when a change is made there
1548 // now only change volume dtc if phantom off 1548 // now only change volume dtc if phantom off
1549 1549
1550 bool wantedPhys = UsePhysics;
1550 if (PhysData.PhysShapeType == PhysShapeType.invalid) // check for extraPhysics data 1551 if (PhysData.PhysShapeType == PhysShapeType.invalid) // check for extraPhysics data
1551 { 1552 {
1552 bool vdtc; 1553 bool vdtc;
@@ -1563,10 +1564,17 @@ namespace OpenSim.Region.Framework.Scenes
1563 if (part != null) 1564 if (part != null)
1564 { 1565 {
1565 part.UpdateExtraPhysics(PhysData); 1566 part.UpdateExtraPhysics(PhysData);
1566 if (part.UpdatePhysRequired) 1567 if (part.UpdatePhysRequired && remoteClient != null)
1567 remoteClient.SendPartPhysicsProprieties(part); 1568 remoteClient.SendPartPhysicsProprieties(part);
1568 } 1569 }
1569 } 1570 }
1571
1572 if (wantedPhys != group.UsesPhysics && remoteClient != null)
1573 {
1574 remoteClient.SendAlertMessage("Object physics canceled because exceeds the limit of " +
1575 m_parentScene.m_linksetPhysCapacity + " physical prims with shape type not set to None");
1576 group.RootPart.ScheduleFullUpdate();
1577 }
1570 } 1578 }
1571 } 1579 }
1572 } 1580 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d3dd5d7..15349e3 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -907,10 +907,10 @@ namespace OpenSim.Region.Framework.Scenes
907 return; 907 return;
908 } 908 }
909 IsSelected = partSelect; 909 IsSelected = partSelect;
910 if (!IsAttachment) 910// if (!IsAttachment)
911 { 911// {
912 ScheduleGroupForFullUpdate(); 912// ScheduleGroupForFullUpdate();
913 } 913// }
914 } 914 }
915 } 915 }
916 // PlaySoundMasterPrim no longer in use to remove 916 // PlaySoundMasterPrim no longer in use to remove
@@ -1712,7 +1712,9 @@ namespace OpenSim.Region.Framework.Scenes
1712 m_rootPart.SetParentLocalId(0); 1712 m_rootPart.SetParentLocalId(0);
1713 AttachmentPoint = (byte)0; 1713 AttachmentPoint = (byte)0;
1714 // must check if buildind should be true or false here 1714 // must check if buildind should be true or false here
1715 m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false); 1715// m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive,false);
1716 ApplyPhysics();
1717
1716 HasGroupChanged = true; 1718 HasGroupChanged = true;
1717 RootPart.Rezzed = DateTime.Now; 1719 RootPart.Rezzed = DateTime.Now;
1718 RootPart.RemFlag(PrimFlags.TemporaryOnRez); 1720 RootPart.RemFlag(PrimFlags.TemporaryOnRez);
@@ -2879,6 +2881,33 @@ namespace OpenSim.Region.Framework.Scenes
2879 return; 2881 return;
2880 } 2882 }
2881 2883
2884 // physical prims count limit
2885 // not very eficient :(
2886
2887 if (UsesPhysics && m_scene.m_linksetPhysCapacity > 0 && (PrimCount + objectGroup.PrimCount) >
2888 m_scene.m_linksetPhysCapacity)
2889 {
2890 int cntr = 0;
2891 foreach (SceneObjectPart part in Parts)
2892 {
2893 if (part.PhysicsShapeType != (byte)PhysicsShapeType.None)
2894 cntr++;
2895 }
2896 foreach (SceneObjectPart part in objectGroup.Parts)
2897 {
2898 if (part.PhysicsShapeType != (byte)PhysicsShapeType.None)
2899 cntr++;
2900 }
2901
2902 if (cntr > m_scene.m_linksetPhysCapacity)
2903 {
2904 // cancel physics
2905 RootPart.Flags &= ~PrimFlags.Physics;
2906 ApplyPhysics();
2907 }
2908 }
2909
2910
2882 // 'linkPart' == the root of the group being linked into this group 2911 // 'linkPart' == the root of the group being linked into this group
2883 SceneObjectPart linkPart = objectGroup.m_rootPart; 2912 SceneObjectPart linkPart = objectGroup.m_rootPart;
2884 2913
@@ -3477,8 +3506,12 @@ namespace OpenSim.Region.Framework.Scenes
3477 { 3506 {
3478 SceneObjectPart[] parts = m_parts.GetArray(); 3507 SceneObjectPart[] parts = m_parts.GetArray();
3479 3508
3480 if (Scene != null) 3509 if (Scene != null && UsePhysics)
3481 { 3510 {
3511 int maxprims = m_scene.m_linksetPhysCapacity;
3512 bool checkShape = (maxprims > 0 &&
3513 parts.Length > maxprims);
3514
3482 for (int i = 0; i < parts.Length; i++) 3515 for (int i = 0; i < parts.Length; i++)
3483 { 3516 {
3484 SceneObjectPart part = parts[i]; 3517 SceneObjectPart part = parts[i];
@@ -3489,6 +3522,15 @@ namespace OpenSim.Region.Framework.Scenes
3489 UsePhysics = false; // Reset physics 3522 UsePhysics = false; // Reset physics
3490 break; 3523 break;
3491 } 3524 }
3525
3526 if (checkShape && part.PhysicsShapeType != (byte)PhysicsShapeType.None)
3527 {
3528 if (--maxprims < 0)
3529 {
3530 UsePhysics = false;
3531 break;
3532 }
3533 }
3492 } 3534 }
3493 } 3535 }
3494 3536
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 8f6b41b..4aa38be 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -4851,17 +4851,24 @@ namespace OpenSim.Region.Framework.Scenes
4851 4851
4852 int nparts = j; 4852 int nparts = j;
4853 4853
4854 bool priv = sog.HasPrivateAttachmentPoint; 4854 ControllingClient.SendEntityUpdate(rootpart, rootflag);
4855
4856 for (int i = 0; i < nparts; i++)
4857 {
4858 ControllingClient.SendEntityUpdate(parts[i], flags[i]);
4859 }
4860
4861 if (sog.HasPrivateAttachmentPoint)
4862 return;
4855 4863
4856 List<ScenePresence> allPresences = m_scene.GetScenePresences(); 4864 List<ScenePresence> allPresences = m_scene.GetScenePresences();
4857 foreach (ScenePresence p in allPresences) 4865 foreach (ScenePresence p in allPresences)
4858 { 4866 {
4859 if (p != this) 4867 if (p == this)
4860 { 4868 continue;
4861 if (priv || 4869
4862 (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) 4870 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
4863 continue; 4871 continue;
4864 }
4865 4872
4866 p.ControllingClient.SendEntityUpdate(rootpart, rootflag); 4873 p.ControllingClient.SendEntityUpdate(rootpart, rootflag);
4867 4874
@@ -4896,19 +4903,31 @@ namespace OpenSim.Region.Framework.Scenes
4896 SceneObjectPart[] parts = sog.Parts; 4903 SceneObjectPart[] parts = sog.Parts;
4897 SceneObjectPart rootpart = sog.RootPart; 4904 SceneObjectPart rootpart = sog.RootPart;
4898 4905
4899 rootpart.UpdateFlag = 0; 4906// rootpart.UpdateFlag = 0;
4907
4908 ControllingClient.SendEntityUpdate(rootpart, flag);
4909
4910 for (int i = 0; i < parts.Length; i++)
4911 {
4912 SceneObjectPart part = parts[i];
4913 if (part == rootpart)
4914 continue;
4915 ControllingClient.SendEntityUpdate(part, flag);
4916// part.UpdateFlag = 0;
4917 }
4918
4919 if (sog.HasPrivateAttachmentPoint)
4920 return;
4900 4921
4901 bool priv = sog.HasPrivateAttachmentPoint;
4902 4922
4903 List<ScenePresence> allPresences = m_scene.GetScenePresences(); 4923 List<ScenePresence> allPresences = m_scene.GetScenePresences();
4904 foreach (ScenePresence p in allPresences) 4924 foreach (ScenePresence p in allPresences)
4905 { 4925 {
4906 if (p != this) 4926 if (p == this)
4907 { 4927 continue;
4908 if (priv || 4928
4909 (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) 4929 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
4910 continue; 4930 continue;
4911 }
4912 4931
4913 p.ControllingClient.SendEntityUpdate(rootpart, flag); 4932 p.ControllingClient.SendEntityUpdate(rootpart, flag);
4914 4933
@@ -4918,7 +4937,6 @@ namespace OpenSim.Region.Framework.Scenes
4918 if (part == rootpart) 4937 if (part == rootpart)
4919 continue; 4938 continue;
4920 p.ControllingClient.SendEntityUpdate(part, flag); 4939 p.ControllingClient.SendEntityUpdate(part, flag);
4921 part.UpdateFlag = 0;
4922 } 4940 }
4923 } 4941 }
4924 } 4942 }
@@ -4947,23 +4965,25 @@ namespace OpenSim.Region.Framework.Scenes
4947 4965
4948 part.UpdateFlag = 0; 4966 part.UpdateFlag = 0;
4949 4967
4950 bool priv = part.ParentGroup.HasPrivateAttachmentPoint; 4968 ControllingClient.SendEntityUpdate(part, flag);
4969
4970 if (part.ParentGroup.HasPrivateAttachmentPoint)
4971 return;
4951 4972
4952 List<ScenePresence> allPresences = m_scene.GetScenePresences(); 4973 List<ScenePresence> allPresences = m_scene.GetScenePresences();
4953 foreach (ScenePresence p in allPresences) 4974 foreach (ScenePresence p in allPresences)
4954 { 4975 {
4955 if (p != this) 4976 if (p == this)
4956 { 4977 continue;
4957 4978
4958 if (priv || 4979 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
4959 (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) 4980 continue;
4960 continue;
4961 }
4962 4981
4963 p.ControllingClient.SendEntityUpdate(part, flag); 4982 p.ControllingClient.SendEntityUpdate(part, flag);
4964 } 4983 }
4965 } 4984 }
4966 4985
4986
4967 public void SendAttachmentUpdate(SceneObjectPart part, UpdateRequired UpdateFlag) 4987 public void SendAttachmentUpdate(SceneObjectPart part, UpdateRequired UpdateFlag)
4968 { 4988 {
4969 if (IsChildAgent || IsInTransit) 4989 if (IsChildAgent || IsInTransit)
@@ -4985,19 +5005,20 @@ namespace OpenSim.Region.Framework.Scenes
4985 return; 5005 return;
4986 } 5006 }
4987 5007
4988 part.UpdateFlag = 0; 5008// part.UpdateFlag = 0;
4989 5009
4990 bool priv = part.ParentGroup.HasPrivateAttachmentPoint; 5010 ControllingClient.SendEntityUpdate(part, flag);
5011
5012 if (part.ParentGroup.HasPrivateAttachmentPoint)
5013 return;
4991 5014
4992 List<ScenePresence> allPresences = m_scene.GetScenePresences(); 5015 List<ScenePresence> allPresences = m_scene.GetScenePresences();
4993 foreach (ScenePresence p in allPresences) 5016 foreach (ScenePresence p in allPresences)
4994 { 5017 {
4995 if (p != this) 5018 if (p == this)
4996 { 5019 continue;
4997 if ( priv || 5020 if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)
4998 (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200)) 5021 continue;
4999 continue;
5000 }
5001 5022
5002 p.ControllingClient.SendEntityUpdate(part, flag); 5023 p.ControllingClient.SendEntityUpdate(part, flag);
5003 } 5024 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 1536959..ef8f0ed 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1400,6 +1400,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1400 SceneObjectGroup group = m_host.ParentGroup; 1400 SceneObjectGroup group = m_host.ParentGroup;
1401 bool allow = true; 1401 bool allow = true;
1402 1402
1403 int maxprims = World.m_linksetPhysCapacity;
1404 bool checkShape = (maxprims > 0 && group.PrimCount > maxprims);
1405
1403 foreach (SceneObjectPart part in group.Parts) 1406 foreach (SceneObjectPart part in group.Parts)
1404 { 1407 {
1405 if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) 1408 if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
@@ -1407,6 +1410,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1407 allow = false; 1410 allow = false;
1408 break; 1411 break;
1409 } 1412 }
1413 if (checkShape && part.PhysicsShapeType != (byte)PhysicsShapeType.None)
1414 {
1415 if (--maxprims < 0)
1416 {
1417 allow = false;
1418 break;
1419 }
1420 }
1410 } 1421 }
1411 1422
1412 if (!allow) 1423 if (!allow)