From ec5ae36fda58817b369dd49ccc3bba4355d072c3 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 3 Aug 2007 14:47:38 +0000 Subject: and more work on those classes. Think they are just about ready to begin hooking them up. --- .../Environment/Scenes/AllNewSceneObjectGroup2.cs | 76 +++++++++++++++++++++- .../Environment/Scenes/AllNewSceneObjectPart2.cs | 35 +++++++++- OpenSim/Region/Environment/Scenes/Scene.cs | 1 - 3 files changed, 107 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs index b0fe12a..9d9c97b 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs @@ -47,6 +47,14 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// + public AllNewSceneObjectGroup2() + { + + } + + /// + /// + /// public AllNewSceneObjectGroup2(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) { m_regionHandle = regionHandle; @@ -62,7 +70,70 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void FlagGroupForFullUpdate() + /// + public new AllNewSceneObjectGroup2 Copy() + { + AllNewSceneObjectGroup2 dupe = (AllNewSceneObjectGroup2) this.MemberwiseClone(); + dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z); + dupe.CopyRootPart(this.m_rootPart); + + foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) + { + if (part.UUID != this.m_rootPart.UUID) + { + dupe.CopyPart(part); + } + } + return dupe; + } + + public void CopyRootPart(AllNewSceneObjectPart2 part) + { + + } + + public void CopyPart(AllNewSceneObjectPart2 part) + { + + } + + /// + /// + /// + public override void Update() + { + foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) + { + part.SendScheduledUpdates(); + } + } + + /// + /// + /// + public void ScheduleGroupForFullUpdate() + { + foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) + { + part.ScheduleFullUpdate(); + } + } + + /// + /// + /// + public void ScheduleGroupForTerseUpdate() + { + foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) + { + part.ScheduleTerseUpdate(); + } + } + + /// + /// + /// + public void ScheduleGroupFullUpdate() { foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) { @@ -73,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void FlagGroupForTerseUpdate() + public void SendGroupTerseUpdate() { foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) { @@ -177,6 +248,7 @@ namespace OpenSim.Region.Environment.Scenes public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) { this.Pos = pos; + this.m_rootPart.SendTerseUpdateToALLClients(); } /// diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs index b0303a3..813f2e1 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs @@ -253,6 +253,14 @@ namespace OpenSim.Region.Environment.Scenes #region Constructors /// + /// + /// + public AllNewSceneObjectPart2() + { + + } + + /// /// Create a completely new SceneObjectPart (prim) /// /// @@ -315,6 +323,29 @@ namespace OpenSim.Region.Environment.Scenes } #endregion + #region Copying + /// + /// + /// + /// + public AllNewSceneObjectPart2 Copy(Scene scene) + { + AllNewSceneObjectPart2 dupe =(AllNewSceneObjectPart2) this.MemberwiseClone(); + dupe.m_Shape = m_Shape.Copy(); + dupe.m_regionHandle = m_regionHandle; + uint newLocalID = scene.PrimIDAllocate(); + dupe.UUID = LLUUID.Random(); + dupe.LocalID = newLocalID; + dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z); + dupe.RotationOffset = new LLQuaternion(RotationOffset.X, RotationOffset.Y, RotationOffset.Z, RotationOffset.W); + dupe.Velocity = new LLVector3(0, 0, 0); + dupe.Acceleration = new LLVector3(0, 0, 0); + dupe.AngularVelocity = new LLVector3(0, 0, 0); + dupe.ObjectFlags = this.ObjectFlags; + return dupe; + } + #endregion + #region Update Scheduling /// /// @@ -327,7 +358,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - private void ScheduleFullUpdate() + public void ScheduleFullUpdate() { m_updateFlag = 2; } @@ -335,7 +366,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - private void ScheduleTerseUpdate() + public void ScheduleTerseUpdate() { if (m_updateFlag < 1) { diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index f9fbe87..56e5a0a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -582,7 +582,6 @@ namespace OpenSim.Region.Environment.Scenes client.OnObjectName += PrimName; client.OnLinkObjects += LinkObjects; client.OnObjectDuplicate += DuplicateObject; - client.OnModifyTerrain += ModifyTerrain; client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest); client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest); -- cgit v1.1