aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs63
1 files changed, 25 insertions, 38 deletions
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