aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2010-08-30 02:30:28 +0100
committerMelanie2010-08-30 02:30:28 +0100
commit79bfa275da6b8be03678bfa284bd205410296b6a (patch)
tree1ce2f9f2da9bb0e3a8f5628d54f44e45bfc33044 /OpenSim/Region/Framework/Scenes
parentRemove CRLF endings (diff)
parentFix a casting operation to use ToString() (diff)
downloadopensim-SC_OLD-79bfa275da6b8be03678bfa284bd205410296b6a.zip
opensim-SC_OLD-79bfa275da6b8be03678bfa284bd205410296b6a.tar.gz
opensim-SC_OLD-79bfa275da6b8be03678bfa284bd205410296b6a.tar.bz2
opensim-SC_OLD-79bfa275da6b8be03678bfa284bd205410296b6a.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs69
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs33
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs63
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs49
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs8
10 files changed, 103 insertions, 173 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index 145f9ed..3a3ec2b 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -31,7 +31,7 @@ namespace OpenSim.Region.Framework.Scenes
31 31
32 public class Prioritizer 32 public class Prioritizer
33 { 33 {
34 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 34// private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
35 35
36 /// <summary> 36 /// <summary>
37 /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the 37 /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the
@@ -75,7 +75,6 @@ namespace OpenSim.Region.Framework.Scenes
75 break; 75 break;
76 default: 76 default:
77 throw new InvalidOperationException("UpdatePrioritizationScheme not defined."); 77 throw new InvalidOperationException("UpdatePrioritizationScheme not defined.");
78 break;
79 } 78 }
80 79
81 // Adjust priority so that root prims are sent to the viewer first. This is especially important for 80 // Adjust priority so that root prims are sent to the viewer first. This is especially important for
@@ -122,9 +121,16 @@ namespace OpenSim.Region.Framework.Scenes
122 // Use group position for child prims 121 // Use group position for child prims
123 Vector3 entityPos; 122 Vector3 entityPos;
124 if (entity is SceneObjectPart) 123 if (entity is SceneObjectPart)
125 entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; 124 {
125 // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene
126 // before its scheduled update was triggered
127 //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
128 entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
129 }
126 else 130 else
131 {
127 entityPos = entity.AbsolutePosition; 132 entityPos = entity.AbsolutePosition;
133 }
128 134
129 return Vector3.DistanceSquared(presencePos, entityPos); 135 return Vector3.DistanceSquared(presencePos, entityPos);
130 } 136 }
@@ -157,7 +163,9 @@ namespace OpenSim.Region.Framework.Scenes
157 } 163 }
158 } 164 }
159 else 165 else
166 {
160 entityPos = entity.AbsolutePosition; 167 entityPos = entity.AbsolutePosition;
168 }
161 169
162 if (!presence.IsChildAgent) 170 if (!presence.IsChildAgent)
163 { 171 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 48508f8..8760c84 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1852,53 +1852,6 @@ namespace OpenSim.Region.Framework.Scenes
1852 } 1852 }
1853 } 1853 }
1854 1854
1855 public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
1856 {
1857 SceneObjectGroup objectGroup = grp;
1858 if (objectGroup != null)
1859 {
1860 if (!grp.HasGroupChanged)
1861 {
1862 m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID);
1863 return;
1864 }
1865
1866 m_log.InfoFormat(
1867 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
1868 grp.UUID, grp.GetAttachmentPoint());
1869
1870 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
1871
1872 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
1873 item = InventoryService.GetItem(item);
1874
1875 if (item != null)
1876 {
1877 AssetBase asset = CreateAsset(
1878 objectGroup.GetPartName(objectGroup.LocalId),
1879 objectGroup.GetPartDescription(objectGroup.LocalId),
1880 (sbyte)AssetType.Object,
1881 Utils.StringToBytes(sceneObjectXml),
1882 remoteClient.AgentId);
1883 AssetService.Store(asset);
1884
1885 item.AssetID = asset.FullID;
1886 item.Description = asset.Description;
1887 item.Name = asset.Name;
1888 item.AssetType = asset.Type;
1889 item.InvType = (int)InventoryType.Object;
1890
1891 InventoryService.UpdateItem(item);
1892
1893 // this gets called when the agent loggs off!
1894 if (remoteClient != null)
1895 {
1896 remoteClient.SendInventoryItemCreateUpdate(item, 0);
1897 }
1898 }
1899 }
1900 }
1901
1902 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID) 1855 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
1903 { 1856 {
1904 itemID = UUID.Zero; 1857 itemID = UUID.Zero;
@@ -2104,11 +2057,12 @@ namespace OpenSim.Region.Framework.Scenes
2104 sog.SetGroup(groupID, remoteClient); 2057 sog.SetGroup(groupID, remoteClient);
2105 sog.ScheduleGroupForFullUpdate(); 2058 sog.ScheduleGroupForFullUpdate();
2106 2059
2060 List<SceneObjectPart> partList = null;
2107 lock (sog.Children) 2061 lock (sog.Children)
2108 { 2062 partList = new List<SceneObjectPart>(sog.Children.Values);
2109 foreach (SceneObjectPart child in sog.Children.Values) 2063
2110 child.Inventory.ChangeInventoryOwner(ownerID); 2064 foreach (SceneObjectPart child in partList)
2111 } 2065 child.Inventory.ChangeInventoryOwner(ownerID);
2112 } 2066 }
2113 else 2067 else
2114 { 2068 {
@@ -2117,14 +2071,15 @@ namespace OpenSim.Region.Framework.Scenes
2117 2071
2118 if (sog.GroupID != groupID) 2072 if (sog.GroupID != groupID)
2119 continue; 2073 continue;
2120 2074
2075 List<SceneObjectPart> partList = null;
2121 lock (sog.Children) 2076 lock (sog.Children)
2077 partList = new List<SceneObjectPart>(sog.Children.Values);
2078
2079 foreach (SceneObjectPart child in partList)
2122 { 2080 {
2123 foreach (SceneObjectPart child in sog.Children.Values) 2081 child.LastOwnerID = child.OwnerID;
2124 { 2082 child.Inventory.ChangeInventoryOwner(groupID);
2125 child.LastOwnerID = child.OwnerID;
2126 child.Inventory.ChangeInventoryOwner(groupID);
2127 }
2128 } 2083 }
2129 2084
2130 sog.SetOwnerId(groupID); 2085 sog.SetOwnerId(groupID);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 9f1575d..c511774 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -164,16 +164,17 @@ namespace OpenSim.Region.Framework.Scenes
164 164
165 SceneObjectGroup sog = ent as SceneObjectGroup; 165 SceneObjectGroup sog = ent as SceneObjectGroup;
166 166
167 List<SceneObjectPart> partList = null;
167 lock (sog.Children) 168 lock (sog.Children)
169 partList = new List<SceneObjectPart>(sog.Children.Values);
170
171 foreach (SceneObjectPart part in partList)
168 { 172 {
169 foreach (KeyValuePair<UUID, SceneObjectPart> child in (sog.Children)) 173 if (part.LocalId == primLocalID)
170 { 174 {
171 if (child.Value.LocalId == primLocalID) 175 part.GetProperties(remoteClient);
172 { 176 foundPrim = true;
173 child.Value.GetProperties(remoteClient); 177 break;
174 foundPrim = true;
175 break;
176 }
177 } 178 }
178 } 179 }
179 180
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ec97d25..6a742c1 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2131,19 +2131,20 @@ namespace OpenSim.Region.Framework.Scenes
2131 group.RemoveScriptInstances(true); 2131 group.RemoveScriptInstances(true);
2132 } 2132 }
2133 2133
2134 List<SceneObjectPart> partList = null;
2134 lock (group.Children) 2135 lock (group.Children)
2136 partList = new List<SceneObjectPart>(group.Children.Values);
2137
2138 foreach (SceneObjectPart part in partList)
2135 { 2139 {
2136 foreach (SceneObjectPart part in group.Children.Values) 2140 if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0))
2137 { 2141 {
2138 if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0)) 2142 PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed?
2139 { 2143 }
2140 PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? 2144 else if (part.PhysActor != null)
2141 } 2145 {
2142 else if (part.PhysActor != null) 2146 PhysicsScene.RemovePrim(part.PhysActor);
2143 { 2147 part.PhysActor = null;
2144 PhysicsScene.RemovePrim(part.PhysActor);
2145 part.PhysActor = null;
2146 }
2147 } 2148 }
2148 } 2149 }
2149 2150
@@ -3720,18 +3721,6 @@ namespace OpenSim.Region.Framework.Scenes
3720 return true; 3721 return true;
3721 } 3722 }
3722 3723
3723 private ILandObject GetParcelAtPoint(float x, float y)
3724 {
3725 foreach (var parcel in AllParcels())
3726 {
3727 if (parcel.ContainsPoint((int)x,(int)y))
3728 {
3729 return parcel;
3730 }
3731 }
3732 return null;
3733 }
3734
3735 /// <summary> 3724 /// <summary>
3736 /// Update an AgentCircuitData object with new information 3725 /// Update an AgentCircuitData object with new information
3737 /// </summary> 3726 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 59e4037..1293d5d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes
70 /// <summary> 70 /// <summary>
71 /// A user will arrive shortly, set up appropriate credentials so it can connect 71 /// A user will arrive shortly, set up appropriate credentials so it can connect
72 /// </summary> 72 /// </summary>
73 public event ExpectUserDelegate OnExpectUser; 73// public event ExpectUserDelegate OnExpectUser;
74 74
75 /// <summary> 75 /// <summary>
76 /// A Prim will arrive shortly 76 /// A Prim will arrive shortly
@@ -80,7 +80,7 @@ namespace OpenSim.Region.Framework.Scenes
80 /// <summary> 80 /// <summary>
81 /// A new prim has arrived 81 /// A new prim has arrived
82 /// </summary> 82 /// </summary>
83 public event PrimCrossing OnPrimCrossingIntoRegion; 83// public event PrimCrossing OnPrimCrossingIntoRegion;
84 84
85 ///// <summary> 85 ///// <summary>
86 ///// A New Region is up and available 86 ///// A New Region is up and available
@@ -90,7 +90,7 @@ namespace OpenSim.Region.Framework.Scenes
90 /// <summary> 90 /// <summary>
91 /// We have a child agent for this avatar and we're getting a status update about it 91 /// We have a child agent for this avatar and we're getting a status update about it
92 /// </summary> 92 /// </summary>
93 public event ChildAgentUpdate OnChildAgentUpdate; 93// public event ChildAgentUpdate OnChildAgentUpdate;
94 //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; 94 //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar;
95 95
96 /// <summary> 96 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1d952c4..b86a564 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -402,23 +402,22 @@ namespace OpenSim.Region.Framework.Scenes
402 part.Shape.Scale = scale; 402 part.Shape.Scale = scale;
403 } 403 }
404 } 404 }
405 405
406 sceneObject.AttachToScene(m_parentScene);
407
408 if (sendClientUpdates)
409 sceneObject.ScheduleGroupForFullUpdate();
410
411 Entities.Add(sceneObject);
412 m_numPrim += sceneObject.Children.Count; 406 m_numPrim += sceneObject.Children.Count;
413
414 if (attachToBackup)
415 sceneObject.AttachToBackup();
416 } 407 }
408
409 sceneObject.AttachToScene(m_parentScene);
410
411 if (sendClientUpdates)
412 sceneObject.ScheduleGroupForFullUpdate();
413
414 Entities.Add(sceneObject);
415
416 if (attachToBackup)
417 sceneObject.AttachToBackup();
417 418
418 if (OnObjectCreate != null) 419 if (OnObjectCreate != null)
419 {
420 OnObjectCreate(sceneObject); 420 OnObjectCreate(sceneObject);
421 }
422 421
423 lock (SceneObjectGroupsByFullID) 422 lock (SceneObjectGroupsByFullID)
424 { 423 {
@@ -426,6 +425,7 @@ namespace OpenSim.Region.Framework.Scenes
426 foreach (SceneObjectPart part in sceneObject.Children.Values) 425 foreach (SceneObjectPart part in sceneObject.Children.Values)
427 SceneObjectGroupsByFullID[part.UUID] = sceneObject; 426 SceneObjectGroupsByFullID[part.UUID] = sceneObject;
428 } 427 }
428
429 lock (SceneObjectGroupsByLocalID) 429 lock (SceneObjectGroupsByLocalID)
430 { 430 {
431 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; 431 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
@@ -1348,37 +1348,21 @@ namespace OpenSim.Region.Framework.Scenes
1348 /// <param name="localID"></param> 1348 /// <param name="localID"></param>
1349 /// <param name="pos"></param> 1349 /// <param name="pos"></param>
1350 /// <param name="remoteClient"></param> 1350 /// <param name="remoteClient"></param>
1351 protected internal void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient) 1351 public void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient)
1352 { 1352 {
1353 SceneObjectGroup group = GetGroupByPrim(localID); 1353 SceneObjectGroup group = GetGroupByPrim(localID);
1354
1354 if (group != null) 1355 if (group != null)
1355 { 1356 {
1356
1357 // Vector3 oldPos = group.AbsolutePosition;
1358 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) 1357 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
1359 { 1358 {
1360 1359 if (m_parentScene.AttachmentsModule != null)
1361 // If this is an attachment, then we need to save the modified 1360 m_parentScene.AttachmentsModule.UpdateAttachmentPosition(remoteClient, group, pos);
1362 // object back into the avatar's inventory. First we save the
1363 // attachment point information, then we update the relative
1364 // positioning (which caused this method to get driven in the
1365 // first place. Then we have to mark the object as NOT an
1366 // attachment. This is necessary in order to correctly save
1367 // and retrieve GroupPosition information for the attachment.
1368 // Then we save the asset back into the appropriate inventory
1369 // entry. Finally, we restore the object's attachment status.
1370
1371 byte attachmentPoint = group.GetAttachmentPoint();
1372 group.UpdateGroupPosition(pos);
1373 group.RootPart.IsAttachment = false;
1374 group.AbsolutePosition = group.RootPart.AttachedPos;
1375 m_parentScene.UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID);
1376 group.SetAttachmentPoint(attachmentPoint);
1377
1378 } 1361 }
1379 else 1362 else
1380 { 1363 {
1381 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) 1364 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)
1365 && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos))
1382 { 1366 {
1383 group.UpdateGroupPosition(pos); 1367 group.UpdateGroupPosition(pos);
1384 } 1368 }
@@ -1387,14 +1371,19 @@ namespace OpenSim.Region.Framework.Scenes
1387 } 1371 }
1388 1372
1389 /// <summary> 1373 /// <summary>
1390 /// 1374 /// Update the texture entry of the given prim.
1391 /// </summary> 1375 /// </summary>
1376 ///
1377 /// A texture entry is an object that contains details of all the textures of the prim's face. In this case,
1378 /// the texture is given in its byte serialized form.
1379 ///
1392 /// <param name="localID"></param> 1380 /// <param name="localID"></param>
1393 /// <param name="texture"></param> 1381 /// <param name="texture"></param>
1394 /// <param name="remoteClient"></param> 1382 /// <param name="remoteClient"></param>
1395 protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) 1383 protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
1396 { 1384 {
1397 SceneObjectGroup group = GetGroupByPrim(localID); 1385 SceneObjectGroup group = GetGroupByPrim(localID);
1386
1398 if (group != null) 1387 if (group != null)
1399 { 1388 {
1400 if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId)) 1389 if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId))
@@ -1784,8 +1773,6 @@ namespace OpenSim.Region.Framework.Scenes
1784 SceneObjectPart newRoot = newSet[0]; 1773 SceneObjectPart newRoot = newSet[0];
1785 newSet.RemoveAt(0); 1774 newSet.RemoveAt(0);
1786 1775
1787 List<uint> linkIDs = new List<uint>();
1788
1789 foreach (SceneObjectPart newChild in newSet) 1776 foreach (SceneObjectPart newChild in newSet)
1790 newChild.UpdateFlag = 0; 1777 newChild.UpdateFlag = 0;
1791 1778
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e003cf8..5a586d4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -398,6 +398,8 @@ namespace OpenSim.Region.Framework.Scenes
398 398
399 /// <value> 399 /// <value>
400 /// The parts of this scene object group. You must lock this property before using it. 400 /// The parts of this scene object group. You must lock this property before using it.
401 /// If you're doing anything other than reading values, please take a copy of the values rather than locking
402 /// the dictionary for the entirety of the operation. This increases liveness and reduces the danger of deadlock
401 /// If you want to know the number of children, consider using the PrimCount property instead 403 /// If you want to know the number of children, consider using the PrimCount property instead
402 /// </value> 404 /// </value>
403 public Dictionary<UUID, SceneObjectPart> Children 405 public Dictionary<UUID, SceneObjectPart> Children
@@ -2306,29 +2308,29 @@ namespace OpenSim.Region.Framework.Scenes
2306 // return; 2308 // return;
2307 2309
2308 lockPartsForRead(true); 2310 lockPartsForRead(true);
2309 {
2310 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
2311 2311
2312 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) 2312 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0);
2313 {
2314 m_rootPart.UpdateFlag = 1;
2315 lastPhysGroupPos = AbsolutePosition;
2316 }
2317 2313
2318 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) 2314 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
2319 { 2315 {
2320 m_rootPart.UpdateFlag = 1; 2316 m_rootPart.UpdateFlag = 1;
2321 lastPhysGroupRot = GroupRotation; 2317 lastPhysGroupPos = AbsolutePosition;
2322 } 2318 }
2323 2319
2324 foreach (SceneObjectPart part in m_parts.Values) 2320 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
2325 { 2321 {
2326 if (!IsSelected) 2322 m_rootPart.UpdateFlag = 1;
2327 part.UpdateLookAt(); 2323 lastPhysGroupRot = GroupRotation;
2324 }
2328 2325
2329 part.SendScheduledUpdates(); 2326 List<SceneObjectPart> partList = null;
2330 2327 partList = new List<SceneObjectPart>(m_parts.Values);
2331 } 2328
2329 foreach (SceneObjectPart part in partList)
2330 {
2331 if (!IsSelected)
2332 part.UpdateLookAt();
2333 part.SendScheduledUpdates();
2332 } 2334 }
2333 lockPartsForRead(false); 2335 lockPartsForRead(false);
2334 } 2336 }
@@ -3161,11 +3163,12 @@ namespace OpenSim.Region.Framework.Scenes
3161 public void UpdatePermissions(UUID AgentID, byte field, uint localID, 3163 public void UpdatePermissions(UUID AgentID, byte field, uint localID,
3162 uint mask, byte addRemTF) 3164 uint mask, byte addRemTF)
3163 { 3165 {
3166 List<SceneObjectPart> partList = null;
3164 lock (m_parts) 3167 lock (m_parts)
3165 { 3168 partList = new List<SceneObjectPart>(m_parts.Values);
3166 foreach (SceneObjectPart part in m_parts.Values) 3169
3167 part.UpdatePermissions(AgentID, field, localID, mask, addRemTF); 3170 foreach (SceneObjectPart part in partList)
3168 } 3171 part.UpdatePermissions(AgentID, field, localID, mask, addRemTF);
3169 3172
3170 HasGroupChanged = true; 3173 HasGroupChanged = true;
3171 } 3174 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 9e52b00..eefe8bb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4756,20 +4756,8 @@ namespace OpenSim.Region.Framework.Scenes
4756 if (ParentGroup == null || ParentGroup.IsDeleted) 4756 if (ParentGroup == null || ParentGroup.IsDeleted)
4757 return; 4757 return;
4758 4758
4759 Vector3 lPos = OffsetPosition; 4759 if (IsAttachment && ParentGroup.RootPart != this)
4760 4760 return;
4761 if (IsAttachment)
4762 {
4763 if (ParentGroup.RootPart != this)
4764 return;
4765
4766 lPos = ParentGroup.RootPart.AttachedPos;
4767 }
4768 else
4769 {
4770 if (ParentGroup.RootPart == this)
4771 lPos = AbsolutePosition;
4772 }
4773 4761
4774 // Causes this thread to dig into the Client Thread Data. 4762 // Causes this thread to dig into the Client Thread Data.
4775 // Remember your locking here! 4763 // Remember your locking here!
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 10931b7..c5994b2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -724,8 +724,7 @@ namespace OpenSim.Region.Framework.Scenes
724 } 724 }
725 725
726 public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item) 726 public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item)
727 { 727 {
728 UUID ownerID = item.OwnerID;
729 AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); 728 AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
730 729
731 if (null == rezAsset) 730 if (null == rezAsset)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 02e60f8..cd80eb0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2668,15 +2668,15 @@ namespace OpenSim.Region.Framework.Scenes
2668 { 2668 {
2669 m_perfMonMS = Util.EnvironmentTickCount(); 2669 m_perfMonMS = Util.EnvironmentTickCount();
2670 2670
2671 PhysicsActor actor = m_physicsActor;
2672 Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero;
2673
2674 Vector3 pos = m_pos; 2671 Vector3 pos = m_pos;
2675 pos.Z += m_appearance.HipOffset; 2672 pos.Z += m_appearance.HipOffset;
2676 2673
2677 //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); 2674 //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity);
2678 2675
2679 remoteClient.SendPrimUpdate(this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); 2676 remoteClient.SendPrimUpdate(
2677 this,
2678 PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity
2679 | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity);
2680 2680
2681 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); 2681 m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
2682 m_scene.StatsReporter.AddAgentUpdates(1); 2682 m_scene.StatsReporter.AddAgentUpdates(1);