aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorTeravus Ovares2008-04-25 21:41:55 +0000
committerTeravus Ovares2008-04-25 21:41:55 +0000
commita534257b0e0861bb7656389675044fa905a11bf4 (patch)
treec879b8b46c13bd5afffb660ca3154ed8a94d51ce /OpenSim/Region/Environment/Scenes
parent* Check in odds and ends which remain as an attempt to get the item propertie... (diff)
downloadopensim-SC-a534257b0e0861bb7656389675044fa905a11bf4.zip
opensim-SC-a534257b0e0861bb7656389675044fa905a11bf4.tar.gz
opensim-SC-a534257b0e0861bb7656389675044fa905a11bf4.tar.bz2
opensim-SC-a534257b0e0861bb7656389675044fa905a11bf4.tar.xz
* Fixes prim crossing. See bug 1050.
* Causes the internal handling of attachments to put the prim group conceptually at the position of the avatar instead of 0,0,0
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs15
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs23
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs16
4 files changed, 52 insertions, 5 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 668e50f..2aa51b8 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -314,6 +314,9 @@ namespace OpenSim.Region.Environment.Scenes
314 { 314 {
315 List<EntityBase> EntityList = GetEntities(); 315 List<EntityBase> EntityList = GetEntities();
316 316
317 if (AttachmentPt == 0)
318 AttachmentPt = (uint)AttachmentPoint.LeftHand;
319
317 foreach (EntityBase obj in EntityList) 320 foreach (EntityBase obj in EntityList)
318 { 321 {
319 if (obj is SceneObjectGroup) 322 if (obj is SceneObjectGroup)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index ae914b3..ce713c5 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1368,14 +1368,19 @@ namespace OpenSim.Region.Environment.Scenes
1368 m_sceneXmlLoader.SavePrimsToXml2(fileName); 1368 m_sceneXmlLoader.SavePrimsToXml2(fileName);
1369 } 1369 }
1370 1370
1371 /// <summary>
1372 /// Locate New region Handle and offset the prim position for the new region
1373 ///
1374 /// </summary>
1375 /// <param name="position">current position of Group</param>
1376 /// <param name="grp">Scene Object Group that we're crossing</param>
1377
1371 public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp) 1378 public void CrossPrimGroupIntoNewRegion(LLVector3 position, SceneObjectGroup grp)
1372 { 1379 {
1373 m_log.Warn("Prim crossing: " + grp.UUID.ToString()); 1380 m_log.Warn("Prim crossing: " + grp.UUID.ToString());
1374 int thisx = (int)RegionInfo.RegionLocX; 1381 int thisx = (int)RegionInfo.RegionLocX;
1375 int thisy = (int)RegionInfo.RegionLocY; 1382 int thisy = (int)RegionInfo.RegionLocY;
1376 1383
1377 int primcrossingXMLmethod = 0;
1378
1379 ulong newRegionHandle = 0; 1384 ulong newRegionHandle = 0;
1380 LLVector3 pos = position; 1385 LLVector3 pos = position;
1381 1386
@@ -1410,6 +1415,12 @@ namespace OpenSim.Region.Environment.Scenes
1410 // Offset the positions for the new region across the border 1415 // Offset the positions for the new region across the border
1411 grp.OffsetForNewRegion(pos); 1416 grp.OffsetForNewRegion(pos);
1412 1417
1418 CrossPrimGroupIntoNewRegion(newRegionHandle, grp);
1419
1420 }
1421 public void CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp)
1422 {
1423 int primcrossingXMLmethod = 0;
1413 if (newRegionHandle != 0) 1424 if (newRegionHandle != 0)
1414 { 1425 {
1415 bool successYN = false; 1426 bool successYN = false;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 7251e9c..fbf0a73 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1077,7 +1077,14 @@ namespace OpenSim.Region.Environment.Scenes
1077 { 1077 {
1078 if (m_rootPart.UUID == part.UUID) 1078 if (m_rootPart.UUID == part.UUID)
1079 { 1079 {
1080 part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags); 1080 if (m_rootPart.m_IsAttachment)
1081 {
1082 part.SendFullUpdateToClient(remoteClient, m_rootPart.m_attachedPos, clientFlags);
1083 }
1084 else
1085 {
1086 part.SendFullUpdateToClient(remoteClient, AbsolutePosition, clientFlags);
1087 }
1081 } 1088 }
1082 else 1089 else
1083 { 1090 {
@@ -1094,7 +1101,14 @@ namespace OpenSim.Region.Environment.Scenes
1094 { 1101 {
1095 if (m_rootPart.UUID == part.UUID) 1102 if (m_rootPart.UUID == part.UUID)
1096 { 1103 {
1097 part.SendTerseUpdateToClient(remoteClient, AbsolutePosition); 1104 if (m_rootPart.m_IsAttachment)
1105 {
1106 part.SendTerseUpdateToClient(remoteClient, m_rootPart.m_attachedPos);
1107 }
1108 else
1109 {
1110 part.SendTerseUpdateToClient(remoteClient, AbsolutePosition);
1111 }
1098 } 1112 }
1099 else 1113 else
1100 { 1114 {
@@ -2143,6 +2157,11 @@ namespace OpenSim.Region.Environment.Scenes
2143 { 2157 {
2144 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 2158 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
2145 { 2159 {
2160 if (m_rootPart.m_IsAttachment)
2161 {
2162 m_rootPart.m_attachedPos = pos;
2163 }
2164
2146 AbsolutePosition = pos; 2165 AbsolutePosition = pos;
2147 } 2166 }
2148 //we need to do a terse update even if the move wasn't allowed 2167 //we need to do a terse update even if the move wasn't allowed
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 2357c2f..6a12fb9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -103,6 +103,7 @@ namespace OpenSim.Region.Environment.Scenes
103 [XmlIgnore] public bool m_IsAttachment = false; 103 [XmlIgnore] public bool m_IsAttachment = false;
104 [XmlIgnore] public uint m_attachmentPoint = (byte)0; 104 [XmlIgnore] public uint m_attachmentPoint = (byte)0;
105 [XmlIgnore] public LLUUID m_attachedAvatar = LLUUID.Zero; 105 [XmlIgnore] public LLUUID m_attachedAvatar = LLUUID.Zero;
106 [XmlIgnore] public LLVector3 m_attachedPos = LLVector3.Zero;
106 107
107 public Int32 CreationDate; 108 public Int32 CreationDate;
108 public uint ParentID = 0; 109 public uint ParentID = 0;
@@ -276,6 +277,15 @@ namespace OpenSim.Region.Environment.Scenes
276 m_groupPosition.Y = PhysActor.Position.Y; 277 m_groupPosition.Y = PhysActor.Position.Y;
277 m_groupPosition.Z = PhysActor.Position.Z; 278 m_groupPosition.Z = PhysActor.Position.Z;
278 } 279 }
280 if (m_IsAttachment)
281 {
282 ScenePresence sp = m_parentGroup.Scene.GetScenePresence(m_attachedAvatar);
283 if (sp != null)
284 {
285 return sp.AbsolutePosition;
286 }
287 }
288
279 return m_groupPosition; 289 return m_groupPosition;
280 } 290 }
281 set 291 set
@@ -340,7 +350,11 @@ namespace OpenSim.Region.Environment.Scenes
340 350
341 public LLVector3 AbsolutePosition 351 public LLVector3 AbsolutePosition
342 { 352 {
343 get { return m_offsetPosition + m_groupPosition; } 353 get {
354 if (m_IsAttachment)
355 return GroupPosition;
356
357 return m_offsetPosition + m_groupPosition; }
344 } 358 }
345 359
346 protected LLQuaternion m_rotationOffset; 360 protected LLQuaternion m_rotationOffset;