aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs70
1 files changed, 23 insertions, 47 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c86e4a1..1b541c4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -447,22 +447,22 @@ namespace OpenSim.Region.Framework.Scenes
447 } 447 }
448 } 448 }
449 449
450 public void SetFromAssetID(UUID AssetId) 450 public void SetFromItemID(UUID AssetId)
451 { 451 {
452 lock (m_parts) 452 lock (m_parts)
453 { 453 {
454 foreach (SceneObjectPart part in m_parts.Values) 454 foreach (SceneObjectPart part in m_parts.Values)
455 { 455 {
456 part.FromAssetID = AssetId; 456 part.FromItemID = AssetId;
457 } 457 }
458 } 458 }
459 } 459 }
460 460
461 public UUID GetFromAssetID() 461 public UUID GetFromItemID()
462 { 462 {
463 if (m_rootPart != null) 463 if (m_rootPart != null)
464 { 464 {
465 return m_rootPart.FromAssetID; 465 return m_rootPart.FromItemID;
466 } 466 }
467 return UUID.Zero; 467 return UUID.Zero;
468 } 468 }
@@ -555,7 +555,7 @@ namespace OpenSim.Region.Framework.Scenes
555 // If we get a result, we're going to find the closest result to the origin of the ray 555 // If we get a result, we're going to find the closest result to the origin of the ray
556 // and send back the intersection information back to the innerscene. 556 // and send back the intersection information back to the innerscene.
557 557
558 EntityIntersection returnresult = new EntityIntersection(); 558 EntityIntersection result = new EntityIntersection();
559 559
560 lock (m_parts) 560 lock (m_parts)
561 { 561 {
@@ -576,26 +576,23 @@ namespace OpenSim.Region.Framework.Scenes
576 // when the camera crosses the border. 576 // when the camera crosses the border.
577 float idist = Constants.RegionSize; 577 float idist = Constants.RegionSize;
578 578
579
580 if (inter.HitTF) 579 if (inter.HitTF)
581 { 580 {
582 // We need to find the closest prim to return to the testcaller along the ray 581 // We need to find the closest prim to return to the testcaller along the ray
583 if (inter.distance < idist) 582 if (inter.distance < idist)
584 { 583 {
585 returnresult.HitTF = true; 584 result.HitTF = true;
586 returnresult.ipoint = inter.ipoint; 585 result.ipoint = inter.ipoint;
587 returnresult.obj = part; 586 result.obj = part;
588 returnresult.normal = inter.normal; 587 result.normal = inter.normal;
589 returnresult.distance = inter.distance; 588 result.distance = inter.distance;
590 } 589 }
591 } 590 }
592 } 591 }
593 } 592 }
594 return returnresult; 593 return result;
595 } 594 }
596 595
597
598
599 /// <summary> 596 /// <summary>
600 /// Gets a vector representing the size of the bounding box containing all the prims in the group 597 /// Gets a vector representing the size of the bounding box containing all the prims in the group
601 /// Treats all prims as rectangular, so no shape (cut etc) is taken into account 598 /// Treats all prims as rectangular, so no shape (cut etc) is taken into account
@@ -652,7 +649,6 @@ namespace OpenSim.Region.Framework.Scenes
652 frontBottomRight.Y = orig.Y + (part.Scale.Y / 2); 649 frontBottomRight.Y = orig.Y + (part.Scale.Y / 2);
653 frontBottomRight.Z = orig.Z - (part.Scale.Z / 2); 650 frontBottomRight.Z = orig.Z - (part.Scale.Z / 2);
654 651
655
656 backTopLeft.X = orig.X + (part.Scale.X / 2); 652 backTopLeft.X = orig.X + (part.Scale.X / 2);
657 backTopLeft.Y = orig.Y - (part.Scale.Y / 2); 653 backTopLeft.Y = orig.Y - (part.Scale.Y / 2);
658 backTopLeft.Z = orig.Z + (part.Scale.Z / 2); 654 backTopLeft.Z = orig.Z + (part.Scale.Z / 2);
@@ -839,7 +835,6 @@ namespace OpenSim.Region.Framework.Scenes
839 if (backBottomLeft.Z < minZ) 835 if (backBottomLeft.Z < minZ)
840 minZ = backBottomLeft.Z; 836 minZ = backBottomLeft.Z;
841 } 837 }
842
843 } 838 }
844 839
845 Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ); 840 Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ);
@@ -860,6 +855,7 @@ namespace OpenSim.Region.Framework.Scenes
860 // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z); 855 // m_log.InfoFormat("BoundingBox is {0} , {1} , {2} ", boundingBox.X, boundingBox.Y, boundingBox.Z);
861 return boundingBox; 856 return boundingBox;
862 } 857 }
858
863 #endregion 859 #endregion
864 860
865 public void SaveScriptedState(XmlTextWriter writer) 861 public void SaveScriptedState(XmlTextWriter writer)
@@ -939,6 +935,7 @@ namespace OpenSim.Region.Framework.Scenes
939 SetAttachmentPoint(Convert.ToByte(attachmentpoint)); 935 SetAttachmentPoint(Convert.ToByte(attachmentpoint));
940 936
941 avatar.AddAttachment(this); 937 avatar.AddAttachment(this);
938 m_log.DebugFormat("[SOG]: Added att {0} to avie {1}", UUID, avatar.UUID);
942 939
943 if (!silent) 940 if (!silent)
944 { 941 {
@@ -1029,8 +1026,8 @@ namespace OpenSim.Region.Framework.Scenes
1029 //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim); 1026 //m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_scene.m_physicalPrim);
1030 //AttachToBackup(); 1027 //AttachToBackup();
1031 //m_rootPart.ScheduleFullUpdate(); 1028 //m_rootPart.ScheduleFullUpdate();
1032
1033 } 1029 }
1030
1034 /// <summary> 1031 /// <summary>
1035 /// 1032 ///
1036 /// </summary> 1033 /// </summary>
@@ -1130,6 +1127,7 @@ namespace OpenSim.Region.Framework.Scenes
1130 } 1127 }
1131 } 1128 }
1132 } 1129 }
1130
1133 // helper provided for parts. 1131 // helper provided for parts.
1134 public int GetSceneMaxUndo() 1132 public int GetSceneMaxUndo()
1135 { 1133 {
@@ -1183,7 +1181,6 @@ namespace OpenSim.Region.Framework.Scenes
1183 { 1181 {
1184 SceneObjectPart part = GetChildPart(localId); 1182 SceneObjectPart part = GetChildPart(localId);
1185 OnGrabPart(part, offsetPos, remoteClient); 1183 OnGrabPart(part, offsetPos, remoteClient);
1186
1187 } 1184 }
1188 } 1185 }
1189 1186
@@ -1267,28 +1264,10 @@ namespace OpenSim.Region.Framework.Scenes
1267 } 1264 }
1268 } 1265 }
1269 1266
1270 if ((aggregateScriptEvents & scriptEvents.at_target) != 0) 1267 m_scriptListens_atTarget = ((aggregateScriptEvents & scriptEvents.at_target) != 0);
1271 { 1268 m_scriptListens_notAtTarget = ((aggregateScriptEvents & scriptEvents.not_at_target) != 0);
1272 m_scriptListens_atTarget = true;
1273 }
1274 else
1275 {
1276 m_scriptListens_atTarget = false;
1277 }
1278
1279 if ((aggregateScriptEvents & scriptEvents.not_at_target) != 0)
1280 {
1281 m_scriptListens_notAtTarget = true;
1282 }
1283 else
1284 {
1285 m_scriptListens_notAtTarget = false;
1286 }
1287 1269
1288 if (m_scriptListens_atTarget || m_scriptListens_notAtTarget) 1270 if (!m_scriptListens_atTarget && !m_scriptListens_notAtTarget)
1289 {
1290 }
1291 else
1292 { 1271 {
1293 lock (m_targets) 1272 lock (m_targets)
1294 m_targets.Clear(); 1273 m_targets.Clear();
@@ -1787,9 +1766,6 @@ namespace OpenSim.Region.Framework.Scenes
1787 } 1766 }
1788 } 1767 }
1789 1768
1790
1791
1792
1793 /// <summary> 1769 /// <summary>
1794 /// Set the owner of the root part. 1770 /// Set the owner of the root part.
1795 /// </summary> 1771 /// </summary>
@@ -3374,19 +3350,19 @@ namespace OpenSim.Region.Framework.Scenes
3374 3350
3375 public virtual string ExtraToXmlString() 3351 public virtual string ExtraToXmlString()
3376 { 3352 {
3377 return "<ExtraFromAssetID>" + GetFromAssetID().ToString() + "</ExtraFromAssetID>"; 3353 return "<ExtraFromItemID>" + GetFromItemID().ToString() + "</ExtraFromItemID>";
3378 } 3354 }
3379 3355
3380 public virtual void ExtraFromXmlString(string xmlstr) 3356 public virtual void ExtraFromXmlString(string xmlstr)
3381 { 3357 {
3382 string id = xmlstr.Substring(xmlstr.IndexOf("<ExtraFromAssetID>")); 3358 string id = xmlstr.Substring(xmlstr.IndexOf("<ExtraFromItemID>"));
3383 id = xmlstr.Replace("<ExtraFromAssetID>", ""); 3359 id = xmlstr.Replace("<ExtraFromItemID>", "");
3384 id = id.Replace("</ExtraFromAssetID>", ""); 3360 id = id.Replace("</ExtraFromItemID>", "");
3385 3361
3386 UUID uuid = UUID.Zero; 3362 UUID uuid = UUID.Zero;
3387 UUID.TryParse(id, out uuid); 3363 UUID.TryParse(id, out uuid);
3388 3364
3389 SetFromAssetID(uuid); 3365 SetFromItemID(uuid);
3390 } 3366 }
3391 #endregion 3367 #endregion
3392 3368