aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/Tests/RegionTests.cs5
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs101
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs15
11 files changed, 77 insertions, 92 deletions
diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs
index cac8cac..1b93176 100644
--- a/OpenSim/Data/Tests/RegionTests.cs
+++ b/OpenSim/Data/Tests/RegionTests.cs
@@ -297,7 +297,6 @@ namespace OpenSim.Data.Tests
297 pbshap.ProfileEnd = ushort.MaxValue; 297 pbshap.ProfileEnd = ushort.MaxValue;
298 pbshap.ProfileHollow = ushort.MaxValue; 298 pbshap.ProfileHollow = ushort.MaxValue;
299 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); 299 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
300 byte updatef = (byte) random.Next(127);
301 300
302 RegionInfo regionInfo = new RegionInfo(); 301 RegionInfo regionInfo = new RegionInfo();
303 regionInfo.RegionID = region3; 302 regionInfo.RegionID = region3;
@@ -336,7 +335,6 @@ namespace OpenSim.Data.Tests
336 sop.LinkNum = linknum; 335 sop.LinkNum = linknum;
337 sop.ClickAction = clickaction; 336 sop.ClickAction = clickaction;
338 sop.Scale = scale; 337 sop.Scale = scale;
339 sop.UpdateFlag = updatef;
340 338
341 //Tests if local part accepted the parameters: 339 //Tests if local part accepted the parameters:
342 Assert.That(regionh,Is.EqualTo(sop.RegionHandle), "Assert.That(regionh,Is.EqualTo(sop.RegionHandle))"); 340 Assert.That(regionh,Is.EqualTo(sop.RegionHandle), "Assert.That(regionh,Is.EqualTo(sop.RegionHandle))");
@@ -369,7 +367,6 @@ namespace OpenSim.Data.Tests
369 Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))"); 367 Assert.That(linknum,Is.EqualTo(sop.LinkNum), "Assert.That(linknum,Is.EqualTo(sop.LinkNum))");
370 Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))"); 368 Assert.That(clickaction,Is.EqualTo(sop.ClickAction), "Assert.That(clickaction,Is.EqualTo(sop.ClickAction))");
371 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))"); 369 Assert.That(scale,Is.EqualTo(sop.Scale), "Assert.That(scale,Is.EqualTo(sop.Scale))");
372 Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))");
373 370
374 // This is necessary or object will not be inserted in DB 371 // This is necessary or object will not be inserted in DB
375 sop.Flags = PrimFlags.None; 372 sop.Flags = PrimFlags.None;
@@ -469,7 +466,6 @@ namespace OpenSim.Data.Tests
469 PrimitiveBaseShape pbshap = new PrimitiveBaseShape(); 466 PrimitiveBaseShape pbshap = new PrimitiveBaseShape();
470 pbshap = PrimitiveBaseShape.Default; 467 pbshap = PrimitiveBaseShape.Default;
471 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next()); 468 Vector3 scale = new Vector3(random.Next(),random.Next(),random.Next());
472 byte updatef = (byte) random.Next(127);
473 469
474 // Updates the region with new values 470 // Updates the region with new values
475 SceneObjectGroup sog2 = FindSOG("Adam West", region3); 471 SceneObjectGroup sog2 = FindSOG("Adam West", region3);
@@ -499,7 +495,6 @@ namespace OpenSim.Data.Tests
499 sog2.RootPart.LinkNum = linknum; 495 sog2.RootPart.LinkNum = linknum;
500 sog2.RootPart.ClickAction = clickaction; 496 sog2.RootPart.ClickAction = clickaction;
501 sog2.RootPart.Scale = scale; 497 sog2.RootPart.Scale = scale;
502 sog2.RootPart.UpdateFlag = updatef;
503 498
504 db.StoreObject(sog2, region3); 499 db.StoreObject(sog2, region3);
505 List<SceneObjectGroup> sogs = db.LoadObjects(region3); 500 List<SceneObjectGroup> sogs = db.LoadObjects(region3);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
index c07fc73..e4bacd4 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
@@ -332,7 +332,7 @@ namespace OpenSim.Region.ClientStack.Linden
332 332
333 grp.IsAttachment = false; 333 grp.IsAttachment = false;
334 // Required for linking 334 // Required for linking
335 grp.RootPart.UpdateFlag = 0; 335 grp.RootPart.ClearUpdateSchedule();
336 336
337 if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos)) 337 if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos))
338 { 338 {
@@ -345,8 +345,9 @@ namespace OpenSim.Region.ClientStack.Linden
345 345
346 for (int j = 1; j < allparts.Length; j++) 346 for (int j = 1; j < allparts.Length; j++)
347 { 347 {
348 rootGroup.RootPart.UpdateFlag = 0; 348 // Required for linking
349 allparts[j].RootPart.UpdateFlag = 0; 349 rootGroup.RootPart.ClearUpdateSchedule();
350 allparts[j].RootPart.ClearUpdateSchedule();
350 rootGroup.LinkToGroup(allparts[j]); 351 rootGroup.LinkToGroup(allparts[j]);
351 } 352 }
352 353
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 7324b26..7251bd8 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1714,7 +1714,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1714 //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); 1714 //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
1715 1715
1716 bool successYN = false; 1716 bool successYN = false;
1717 grp.RootPart.UpdateFlag = 0; 1717 grp.RootPart.ClearUpdateSchedule();
1718 //int primcrossingXMLmethod = 0; 1718 //int primcrossingXMLmethod = 0;
1719 1719
1720 if (destination != null) 1720 if (destination != null)
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1af18e7..82ded28 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1799,7 +1799,7 @@ namespace OpenSim.Region.Framework.Scenes
1799 newSet.RemoveAt(0); 1799 newSet.RemoveAt(0);
1800 1800
1801 foreach (SceneObjectPart newChild in newSet) 1801 foreach (SceneObjectPart newChild in newSet)
1802 newChild.UpdateFlag = 0; 1802 newChild.ClearUpdateSchedule();
1803 1803
1804 LinkObjects(newRoot, newSet); 1804 LinkObjects(newRoot, newSet);
1805 if (!affectedGroups.Contains(newRoot.ParentGroup)) 1805 if (!affectedGroups.Contains(newRoot.ParentGroup))
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 2ea9854..a0a7344 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1157,7 +1157,7 @@ namespace OpenSim.Region.Framework.Scenes
1157 1157
1158 if (!silent) 1158 if (!silent)
1159 { 1159 {
1160 part.UpdateFlag = 0; 1160 part.ClearUpdateSchedule();
1161 if (part == m_rootPart) 1161 if (part == m_rootPart)
1162 { 1162 {
1163 if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || 1163 if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) ||
@@ -1735,13 +1735,13 @@ namespace OpenSim.Region.Framework.Scenes
1735 1735
1736 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) 1736 if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f))
1737 { 1737 {
1738 m_rootPart.UpdateFlag = 1; 1738 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
1739 lastPhysGroupPos = AbsolutePosition; 1739 lastPhysGroupPos = AbsolutePosition;
1740 } 1740 }
1741 1741
1742 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) 1742 if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f))
1743 { 1743 {
1744 m_rootPart.UpdateFlag = 1; 1744 m_rootPart.UpdateFlag = UpdateRequired.TERSE;
1745 lastPhysGroupRot = GroupRotation; 1745 lastPhysGroupRot = GroupRotation;
1746 } 1746 }
1747 1747
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b68cc9f..44f822c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -106,6 +106,13 @@ namespace OpenSim.Region.Framework.Scenes
106 SCULPT = 7 106 SCULPT = 7
107 } 107 }
108 108
109 public enum UpdateRequired : byte
110 {
111 NONE = 0,
112 TERSE = 1,
113 FULL = 2
114 }
115
109 #endregion Enumerations 116 #endregion Enumerations
110 117
111 public class SceneObjectPart : IScriptHost, ISceneEntity 118 public class SceneObjectPart : IScriptHost, ISceneEntity
@@ -254,15 +261,7 @@ namespace OpenSim.Region.Framework.Scenes
254 261
255 private bool m_passTouches; 262 private bool m_passTouches;
256 263
257 /// <summary> 264 private UpdateRequired m_updateFlag;
258 /// Only used internally to schedule client updates.
259 /// 0 - no update is scheduled
260 /// 1 - terse update scheduled
261 /// 2 - full update scheduled
262 ///
263 /// TODO - This should be an enumeration
264 /// </summary>
265 private byte m_updateFlag;
266 265
267 private PhysicsActor m_physActor; 266 private PhysicsActor m_physActor;
268 protected Vector3 m_acceleration; 267 protected Vector3 m_acceleration;
@@ -884,7 +883,15 @@ namespace OpenSim.Region.Framework.Scenes
884 } 883 }
885 } 884 }
886 885
887 /// <summary></summary> 886 /// <summary>Update angular velocity and schedule terse update.</summary>
887 public void UpdateAngularVelocity(Vector3 avel)
888 {
889 AngularVelocity = avel;
890 ScheduleTerseUpdate();
891 ParentGroup.HasGroupChanged = true;
892 }
893
894 /// <summary>Get or set angular velocity. Does not schedule update.</summary>
888 public Vector3 AngularVelocity 895 public Vector3 AngularVelocity
889 { 896 {
890 get 897 get
@@ -1023,8 +1030,8 @@ namespace OpenSim.Region.Framework.Scenes
1023 TriggerScriptChangedEvent(Changed.SCALE); 1030 TriggerScriptChangedEvent(Changed.SCALE);
1024 } 1031 }
1025 } 1032 }
1026 1033
1027 public byte UpdateFlag 1034 public UpdateRequired UpdateFlag
1028 { 1035 {
1029 get { return m_updateFlag; } 1036 get { return m_updateFlag; }
1030 set { m_updateFlag = value; } 1037 set { m_updateFlag = value; }
@@ -1309,9 +1316,9 @@ namespace OpenSim.Region.Framework.Scenes
1309 /// <summary> 1316 /// <summary>
1310 /// Clear all pending updates of parts to clients 1317 /// Clear all pending updates of parts to clients
1311 /// </summary> 1318 /// </summary>
1312 private void ClearUpdateSchedule() 1319 public void ClearUpdateSchedule()
1313 { 1320 {
1314 m_updateFlag = 0; 1321 UpdateFlag = UpdateRequired.NONE;
1315 } 1322 }
1316 1323
1317 /// <summary> 1324 /// <summary>
@@ -2829,7 +2836,7 @@ namespace OpenSim.Region.Framework.Scenes
2829 TimeStampFull = (uint)timeNow; 2836 TimeStampFull = (uint)timeNow;
2830 } 2837 }
2831 2838
2832 m_updateFlag = 2; 2839 UpdateFlag = UpdateRequired.FULL;
2833 2840
2834 // m_log.DebugFormat( 2841 // m_log.DebugFormat(
2835 // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", 2842 // "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
@@ -2845,13 +2852,13 @@ namespace OpenSim.Region.Framework.Scenes
2845 if (m_parentGroup == null) 2852 if (m_parentGroup == null)
2846 return; 2853 return;
2847 2854
2848 if (m_updateFlag < 1) 2855 if (UpdateFlag == UpdateRequired.NONE)
2849 { 2856 {
2850 m_parentGroup.HasGroupChanged = true; 2857 m_parentGroup.HasGroupChanged = true;
2851 m_parentGroup.QueueForUpdateCheck(); 2858 m_parentGroup.QueueForUpdateCheck();
2852 2859
2853 TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); 2860 TimeStampTerse = (uint) Util.UnixTimeSinceEpoch();
2854 m_updateFlag = 1; 2861 UpdateFlag = UpdateRequired.TERSE;
2855 2862
2856 // m_log.DebugFormat( 2863 // m_log.DebugFormat(
2857 // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", 2864 // "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
@@ -3018,45 +3025,39 @@ namespace OpenSim.Region.Framework.Scenes
3018 const float POSITION_TOLERANCE = 0.05f; 3025 const float POSITION_TOLERANCE = 0.05f;
3019 const int TIME_MS_TOLERANCE = 3000; 3026 const int TIME_MS_TOLERANCE = 3000;
3020 3027
3021 if (m_updateFlag == 1) 3028 switch (UpdateFlag)
3022 { 3029 {
3023 // Throw away duplicate or insignificant updates 3030 case UpdateRequired.TERSE:
3024 if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
3025 !Acceleration.Equals(m_lastAcceleration) ||
3026 !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
3027 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) ||
3028 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
3029 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
3030 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
3031 { 3031 {
3032 AddTerseUpdateToAllAvatars(); 3032 // Throw away duplicate or insignificant updates
3033 ClearUpdateSchedule(); 3033 if (!RotationOffset.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) ||
3034 3034 !Acceleration.Equals(m_lastAcceleration) ||
3035 // This causes the Scene to 'poll' physical objects every couple of frames 3035 !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) ||
3036 // bad, so it's been replaced by an event driven method. 3036 Velocity.ApproxEquals(Vector3.Zero, VELOCITY_TOLERANCE) ||
3037 //if ((ObjectFlags & (uint)PrimFlags.Physics) != 0) 3037 !AngularVelocity.ApproxEquals(m_lastAngularVelocity, VELOCITY_TOLERANCE) ||
3038 //{ 3038 !OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
3039 // Only send the constant terse updates on physical objects! 3039 Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
3040 //ScheduleTerseUpdate(); 3040 {
3041 //} 3041 AddTerseUpdateToAllAvatars();
3042 3042 ClearUpdateSchedule();
3043 // Update the "last" values 3043
3044 m_lastPosition = OffsetPosition; 3044 // Update the "last" values
3045 m_lastRotation = RotationOffset; 3045 m_lastPosition = OffsetPosition;
3046 m_lastVelocity = Velocity; 3046 m_lastRotation = RotationOffset;
3047 m_lastAcceleration = Acceleration; 3047 m_lastVelocity = Velocity;
3048 m_lastAngularVelocity = AngularVelocity; 3048 m_lastAcceleration = Acceleration;
3049 m_lastTerseSent = Environment.TickCount; 3049 m_lastAngularVelocity = AngularVelocity;
3050 m_lastTerseSent = Environment.TickCount;
3051 }
3052 break;
3050 } 3053 }
3051 } 3054 case UpdateRequired.FULL:
3052 else
3053 {
3054 if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
3055 { 3055 {
3056 AddFullUpdateToAllAvatars(); 3056 AddFullUpdateToAllAvatars();
3057 ClearUpdateSchedule(); 3057 break;
3058 } 3058 }
3059 } 3059 }
3060
3060 ClearUpdateSchedule(); 3061 ClearUpdateSchedule();
3061 } 3062 }
3062 3063
@@ -3436,7 +3437,7 @@ namespace OpenSim.Region.Framework.Scenes
3436 _groupID = groupID; 3437 _groupID = groupID;
3437 if (client != null) 3438 if (client != null)
3438 SendPropertiesToClient(client); 3439 SendPropertiesToClient(client);
3439 m_updateFlag = 2; 3440 UpdateFlag = UpdateRequired.FULL;
3440 } 3441 }
3441 3442
3442 /// <summary> 3443 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 29966f9..71c39b2 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3211,7 +3211,7 @@ namespace OpenSim.Region.Framework.Scenes
3211 foreach (ISceneObject so in cAgent.AttachmentObjects) 3211 foreach (ISceneObject so in cAgent.AttachmentObjects)
3212 { 3212 {
3213 ((SceneObjectGroup)so).LocalId = 0; 3213 ((SceneObjectGroup)so).LocalId = 0;
3214 ((SceneObjectGroup)so).RootPart.UpdateFlag = 0; 3214 ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();
3215 so.SetState(cAgent.AttachmentObjectStates[i++], m_scene); 3215 so.SetState(cAgent.AttachmentObjectStates[i++], m_scene);
3216 m_scene.IncomingCreateObject(so); 3216 m_scene.IncomingCreateObject(so);
3217 } 3217 }
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index e06a222..60cc788 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -316,7 +316,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
316 m_SOPXmlProcessors.Add("ClickAction", ProcessClickAction); 316 m_SOPXmlProcessors.Add("ClickAction", ProcessClickAction);
317 m_SOPXmlProcessors.Add("Shape", ProcessShape); 317 m_SOPXmlProcessors.Add("Shape", ProcessShape);
318 m_SOPXmlProcessors.Add("Scale", ProcessScale); 318 m_SOPXmlProcessors.Add("Scale", ProcessScale);
319 m_SOPXmlProcessors.Add("UpdateFlag", ProcessUpdateFlag);
320 m_SOPXmlProcessors.Add("SitTargetOrientation", ProcessSitTargetOrientation); 319 m_SOPXmlProcessors.Add("SitTargetOrientation", ProcessSitTargetOrientation);
321 m_SOPXmlProcessors.Add("SitTargetPosition", ProcessSitTargetPosition); 320 m_SOPXmlProcessors.Add("SitTargetPosition", ProcessSitTargetPosition);
322 m_SOPXmlProcessors.Add("SitTargetPositionLL", ProcessSitTargetPositionLL); 321 m_SOPXmlProcessors.Add("SitTargetPositionLL", ProcessSitTargetPositionLL);
@@ -584,11 +583,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
584 obj.Scale = Util.ReadVector(reader, "Scale"); 583 obj.Scale = Util.ReadVector(reader, "Scale");
585 } 584 }
586 585
587 private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader)
588 {
589 obj.UpdateFlag = (byte)reader.ReadElementContentAsInt("UpdateFlag", String.Empty);
590 }
591
592 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader) 586 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader)
593 { 587 {
594 obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation"); 588 obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation");
@@ -1187,7 +1181,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1187 WriteShape(writer, sop.Shape, options); 1181 WriteShape(writer, sop.Shape, options);
1188 1182
1189 WriteVector(writer, "Scale", sop.Scale); 1183 WriteVector(writer, "Scale", sop.Scale);
1190 writer.WriteElementString("UpdateFlag", sop.UpdateFlag.ToString());
1191 WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); 1184 WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation);
1192 WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); 1185 WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition);
1193 WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); 1186 WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL);
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index 90cdd7b..a2332bb 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -70,8 +70,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
70 grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0)); 70 grp2.UpdateGroupRotationR(Quaternion.CreateFromEulers(180 * Utils.DEG_TO_RAD, 0, 0));
71 71
72 // Required for linking 72 // Required for linking
73 grp1.RootPart.UpdateFlag = 0; 73 grp1.RootPart.ClearUpdateSchedule();
74 grp2.RootPart.UpdateFlag = 0; 74 grp2.RootPart.ClearUpdateSchedule();
75 75
76 // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. 76 // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated.
77 grp1.LinkToGroup(grp2); 77 grp1.LinkToGroup(grp2);
@@ -164,10 +164,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
164 grp4.UpdateGroupRotationR(Quaternion.CreateFromEulers(0, 90 * Utils.DEG_TO_RAD, 0)); 164 grp4.UpdateGroupRotationR(Quaternion.CreateFromEulers(0, 90 * Utils.DEG_TO_RAD, 0));
165 165
166 // Required for linking 166 // Required for linking
167 grp1.RootPart.UpdateFlag = 0; 167 grp1.RootPart.ClearUpdateSchedule();
168 grp2.RootPart.UpdateFlag = 0; 168 grp2.RootPart.ClearUpdateSchedule();
169 grp3.RootPart.UpdateFlag = 0; 169 grp3.RootPart.ClearUpdateSchedule();
170 grp4.RootPart.UpdateFlag = 0; 170 grp4.RootPart.ClearUpdateSchedule();
171 171
172 // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. 172 // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated.
173 grp1.LinkToGroup(grp2); 173 grp1.LinkToGroup(grp2);
@@ -198,8 +198,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
198 } 198 }
199 199
200 // Required for linking 200 // Required for linking
201 grp1.RootPart.UpdateFlag = 0; 201 grp1.RootPart.ClearUpdateSchedule();
202 grp3.RootPart.UpdateFlag = 0; 202 grp3.RootPart.ClearUpdateSchedule();
203 203
204 // root part should have no offset position or rotation 204 // root part should have no offset position or rotation
205 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity, 205 Assert.That(part1.OffsetPosition == Vector3.Zero && part1.RotationOffset == Quaternion.Identity,
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs
index d34d8e5..860172c 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -158,6 +158,7 @@ namespace OpenSim.Region.Framework.Scenes
158 } 158 }
159 else 159 else
160 { 160 {
161 // Note: Updating these properties on sop automatically schedules an update if needed
161 if (Position != Vector3.Zero) 162 if (Position != Vector3.Zero)
162 { 163 {
163// m_log.DebugFormat( 164// m_log.DebugFormat(
@@ -181,8 +182,6 @@ namespace OpenSim.Region.Framework.Scenes
181 182
182 part.Resize(Scale); 183 part.Resize(Scale);
183 } 184 }
184
185 part.ScheduleTerseUpdate();
186 } 185 }
187 186
188 part.Undoing = false; 187 part.Undoing = false;
@@ -212,6 +211,7 @@ namespace OpenSim.Region.Framework.Scenes
212 } 211 }
213 else 212 else
214 { 213 {
214 // Note: Updating these properties on sop automatically schedules an update if needed
215 if (Position != Vector3.Zero) 215 if (Position != Vector3.Zero)
216 part.OffsetPosition = Position; 216 part.OffsetPosition = Position;
217 217
@@ -220,8 +220,6 @@ namespace OpenSim.Region.Framework.Scenes
220 220
221 if (Scale != Vector3.Zero) 221 if (Scale != Vector3.Zero)
222 part.Resize(Scale); 222 part.Resize(Scale);
223
224 part.ScheduleTerseUpdate();
225 } 223 }
226 224
227 part.Undoing = false; 225 part.Undoing = false;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 83c3b78..b3d0dd5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3330,10 +3330,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3330 3330
3331 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain) 3331 protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
3332 { 3332 {
3333 part.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 3333 part.UpdateAngularVelocity(new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)));
3334 part.ScheduleTerseUpdate();
3335 part.SendTerseUpdateToAllClients();
3336 part.ParentGroup.HasGroupChanged = true;
3337 } 3334 }
3338 3335
3339 public LSL_Integer llGetStartParameter() 3336 public LSL_Integer llGetStartParameter()
@@ -3595,11 +3592,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3595 parentPrim = targetPart.ParentGroup; 3592 parentPrim = targetPart.ParentGroup;
3596 childPrim = m_host.ParentGroup; 3593 childPrim = m_host.ParentGroup;
3597 } 3594 }
3598// byte uf = childPrim.RootPart.UpdateFlag; 3595
3599 childPrim.RootPart.UpdateFlag = 0; 3596 // Required for linking
3597 childPrim.RootPart.ClearUpdateSchedule();
3600 parentPrim.LinkToGroup(childPrim); 3598 parentPrim.LinkToGroup(childPrim);
3601// if (uf != (Byte)0)
3602// parent.RootPart.UpdateFlag = uf;
3603 } 3599 }
3604 3600
3605 parentPrim.TriggerScriptChangedEvent(Changed.LINK); 3601 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
@@ -3680,7 +3676,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3680 parts.Remove(newRoot); 3676 parts.Remove(newRoot);
3681 foreach (SceneObjectPart part in parts) 3677 foreach (SceneObjectPart part in parts)
3682 { 3678 {
3683 part.UpdateFlag = 0; 3679 // Required for linking
3680 part.ClearUpdateSchedule();
3684 newRoot.ParentGroup.LinkToGroup(part.ParentGroup); 3681 newRoot.ParentGroup.LinkToGroup(part.ParentGroup);
3685 } 3682 }
3686 newRoot.ParentGroup.HasGroupChanged = true; 3683 newRoot.ParentGroup.HasGroupChanged = true;