diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index a888e305a1..920404442b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -207,8 +207,6 @@ namespace OpenSim.Region.Framework.Scenes if (part.ParentGroup.IsAttachment) isAttachment = true; - else - part.ParentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.FullUpdate); // If it's not an attachment, and we are allowed to move it, // then we might have done so. If we moved across a parcel diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 20aa83e8d8..d352f83cb8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2051,8 +2051,6 @@ namespace OpenSim.Region.Framework.Scenes sceneObject.SetGroup(groupID, null); } - sceneObject.ScheduleGroupForUpdate(PrimUpdateFlags.FullUpdate); - return sceneObject; } diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index dbf0e463af..fd015b977d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -1512,7 +1512,7 @@ namespace OpenSim.Region.Framework.Scenes parentGroup.RootPart.AddFlag(PrimFlags.CreateSelected); parentGroup.TriggerScriptChangedEvent(Changed.LINK); parentGroup.HasGroupChanged = true; - parentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.FullUpdate); + parentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.ParentID); } finally @@ -1627,7 +1627,7 @@ namespace OpenSim.Region.Framework.Scenes { g.TriggerScriptChangedEvent(Changed.LINK); g.HasGroupChanged = true; // Persist - g.ScheduleGroupForUpdate(PrimUpdateFlags.FullUpdate); + g.ScheduleGroupForUpdate(PrimUpdateFlags.ParentID); } } finally diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 1488acf2ea..e660cf9e33 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1001,7 +1001,7 @@ namespace OpenSim.Region.Framework.Scenes } IsSelected = false; // fudge.... - ScheduleGroupForUpdate(PrimUpdateFlags.FullUpdate); + RootPart.ScheduleUpdate(PrimUpdateFlags.ParentID); } } else @@ -2902,7 +2902,6 @@ namespace OpenSim.Region.Framework.Scenes part.IgnoreUndoUpdate = false; part.StoreUndoState(); HasGroupChanged = true; - ScheduleGroupForUpdate(PrimUpdateFlags.Position); } } @@ -2939,11 +2938,12 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = pos; HasGroupChanged = true; + } //we need to do a terse update even if the move wasn't allowed // so that the position is reset in the client (the object snaps back) - ScheduleGroupForUpdate(PrimUpdateFlags.Position); + m_rootPart.ScheduleUpdate(PrimUpdateFlags.Position); } /// @@ -3008,7 +3008,7 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = newPos; HasGroupChanged = true; - ScheduleGroupForUpdate(PrimUpdateFlags.Position); + ScheduleGroupForUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); } public void OffsetForNewRegion(Vector3 offset) @@ -3040,7 +3040,6 @@ namespace OpenSim.Region.Framework.Scenes } HasGroupChanged = true; - ScheduleGroupForUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); } /// @@ -3066,7 +3065,6 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = pos; HasGroupChanged = true; - ScheduleGroupForUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); } /// diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0ed19c9fa0..84826f2122 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1240,7 +1240,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void ClearPendingUpdate() { - m_pendingUpdateFlags = 0; + m_pendingUpdateFlags = PrimUpdateFlags.None; } public void ResetExpire() @@ -2856,23 +2856,23 @@ namespace OpenSim.Region.Framework.Scenes else updateFlags &= ~PrimUpdateFlags.AngularVelocity; - if (!OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) + if (!RelativePosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) updateFlags |= PrimUpdateFlags.Position; else updateFlags &= ~PrimUpdateFlags.Position; // For good measure - if (Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) - updateFlags |= PrimUpdateFlags.Position; + //if (Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) + // updateFlags |= PrimUpdateFlags.Position; #endregion PrimUpdateFlags Management - if (updateFlags != 0) + if (updateFlags != PrimUpdateFlags.None) { AddUpdateToAllAvatars(updateFlags); // Update the "last" values - m_lastPosition = OffsetPosition; + m_lastPosition = RelativePosition; m_lastRotation = RotationOffset; m_lastVelocity = Velocity; m_lastAcceleration = Acceleration; @@ -3342,8 +3342,7 @@ namespace OpenSim.Region.Framework.Scenes public void StopLookAt() { m_parentGroup.stopLookAt(); - - m_parentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); + m_parentGroup.RootPart.ScheduleUpdate(PrimUpdateFlags.Rotation); } /// @@ -3364,8 +3363,7 @@ namespace OpenSim.Region.Framework.Scenes public void StopMoveToTarget() { m_parentGroup.stopMoveToTarget(); - - m_parentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); + m_parentGroup.RootPart.ScheduleUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); } public void StoreUndoState() @@ -3941,20 +3939,18 @@ namespace OpenSim.Region.Framework.Scenes (pos.Y != OffsetPosition.Y) || (pos.Z != OffsetPosition.Z)) { - Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); - if (ParentGroup.RootPart.GetStatusSandbox()) { - if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, newPos) > 10) + if (Util.GetDistanceTo(ParentGroup.RootPart.StatusSandboxPos, pos) > 10) { ParentGroup.RootPart.ScriptSetPhysicsStatus(false); - newPos = OffsetPosition; + pos = OffsetPosition; ParentGroup.Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), ChatTypeEnum.DebugChannel, 0x7FFFFFFF, ParentGroup.RootPart.AbsolutePosition, Name, UUID, false); } } - OffsetPosition = newPos; + OffsetPosition = pos; ScheduleUpdate(PrimUpdateFlags.Position); } } diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs index 631d3071b4..5deeef8bff 100644 --- a/OpenSim/Region/Framework/Scenes/UndoState.cs +++ b/OpenSim/Region/Framework/Scenes/UndoState.cs @@ -42,17 +42,12 @@ namespace OpenSim.Region.Framework.Scenes if (part != null) { if (part.ParentID == 0) - { Position = part.ParentGroup.AbsolutePosition; - Rotation = part.RotationOffset; - Scale = part.Shape.Scale; - } else - { Position = part.OffsetPosition; - Rotation = part.RotationOffset; - Scale = part.Shape.Scale; - } + + Rotation = part.RotationOffset; + Scale = part.Shape.Scale; } } @@ -84,57 +79,48 @@ namespace OpenSim.Region.Framework.Scenes if (part != null) { part.Undoing = true; + PrimUpdateFlags updateFlags = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation; if (part.ParentID == 0) - { - if (Position != Vector3.Zero) - part.ParentGroup.AbsolutePosition = Position; - part.RotationOffset = Rotation; - if (Scale != Vector3.Zero) - part.Resize(Scale); - part.ParentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); - } + part.ParentGroup.AbsolutePosition = Position; else + part.OffsetPosition = Position; + + part.RotationOffset = Rotation; + + if (Scale != part.Scale) { - if (Position != Vector3.Zero) - part.OffsetPosition = Position; - part.UpdateRotation(Rotation); - if (Scale != Vector3.Zero) - part.Resize(Scale); - part.ScheduleUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); + part.Scale = Scale; + updateFlags |= PrimUpdateFlags.Scale; } part.Undoing = false; + part.ScheduleUpdate(updateFlags); } } + public void PlayfwdState(SceneObjectPart part) { if (part != null) { part.Undoing = true; + PrimUpdateFlags updateFlags = PrimUpdateFlags.Position | PrimUpdateFlags.Rotation; if (part.ParentID == 0) - { - if (Position != Vector3.Zero) - part.ParentGroup.AbsolutePosition = Position; - if (Rotation != Quaternion.Identity) - part.UpdateRotation(Rotation); - if (Scale != Vector3.Zero) - part.Resize(Scale); - part.ParentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); - } + part.ParentGroup.AbsolutePosition = Position; else - { - if (Position != Vector3.Zero) - part.OffsetPosition = Position; - if (Rotation != Quaternion.Identity) - part.UpdateRotation(Rotation); - if (Scale != Vector3.Zero) - part.Resize(Scale); - part.ScheduleUpdate(PrimUpdateFlags.Position | PrimUpdateFlags.Rotation); - } - part.Undoing = false; + part.OffsetPosition = Position; + part.RotationOffset = Rotation; + + if (Scale != part.Scale) + { + part.Scale = Scale; + updateFlags |= PrimUpdateFlags.Scale; + } + + part.Undoing = false; + part.ScheduleUpdate(updateFlags); } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 39ee0414fe..ca02abcdd1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1913,7 +1913,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z); SceneObjectGroup parent = part.ParentGroup; parent.HasGroupChanged = true; - parent.ScheduleGroupForUpdate(PrimUpdateFlags.Position); + part.ScheduleUpdate(PrimUpdateFlags.Position); } } } @@ -3866,7 +3866,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Util.Clip((float)color.z, 0.0f, 1.0f)); m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); m_host.ParentGroup.HasGroupChanged = true; - m_host.ParentGroup.ScheduleGroupForUpdate(PrimUpdateFlags.Text); + m_host.ScheduleUpdate(PrimUpdateFlags.Text); } public LSL_Float llWater(LSL_Vector offset)