From 266b27267378bf9030f74135ac14af418a37e5ec Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 7 Aug 2007 18:31:20 +0000 Subject: Some more work on new Sceneobject. --- .../Environment/Scenes/AllNewSceneObjectGroup2.cs | 57 ++++++++++++++++++++-- .../Environment/Scenes/AllNewSceneObjectPart2.cs | 52 ++++++++++++++------ OpenSim/Region/Environment/Scenes/EntityBase.cs | 4 +- 3 files changed, 91 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs index 4638d70..86610c0 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs @@ -38,6 +38,33 @@ namespace OpenSim.Region.Environment.Scenes get { return new LLVector3(0, 0, 0); } } + public override LLVector3 Pos + { + get { return m_rootPart.GroupPosition; } + set + { + lock (this.m_parts) + { + foreach (AllNewSceneObjectPart2 part in this.m_parts.Values) + { + part.GroupPosition = value; + } + } + } + } + + public override uint LocalId + { + get { return m_rootPart.LocalID; } + set { m_rootPart.LocalID = value; } + } + + public override LLUUID UUID + { + get { return m_rootPart.UUID; } + set { m_rootPart.UUID = value; } + } + /// /// /// @@ -370,7 +397,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void UpdateGroupPosition(LLVector3 pos) { - this.m_pos = pos; + this.Pos = pos; } /// @@ -442,7 +469,7 @@ namespace OpenSim.Region.Environment.Scenes public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) { this.m_rootPart.UpdateRotation(rot); - this.m_pos = pos; + this.Pos = pos; } /// @@ -500,8 +527,8 @@ namespace OpenSim.Region.Environment.Scenes private void SetPartAsRoot(AllNewSceneObjectPart2 part) { this.m_rootPart = part; - this.m_uuid = part.UUID; - this.m_localId = part.LocalID; + //this.m_uuid= part.UUID; + // this.m_localId = part.LocalID; } /// @@ -522,6 +549,11 @@ namespace OpenSim.Region.Environment.Scenes return m_scene.RequestAvatarList(); } + /// + /// + /// + /// + /// internal void SendPartFullUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part) { if( m_rootPart == part ) @@ -533,5 +565,22 @@ namespace OpenSim.Region.Environment.Scenes part.SendFullUpdateToClient( remoteClient ); } } + + /// + /// + /// + /// + /// + internal void SendPartTerseUpdate(IClientAPI remoteClient, AllNewSceneObjectPart2 part) + { + if (m_rootPart == part) + { + part.SendTerseUpdateToClient(remoteClient, Pos); + } + else + { + part.SendTerseUpdateToClient(remoteClient); + } + } } } diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs index 7b6676b..c91701a 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs @@ -172,14 +172,6 @@ namespace OpenSim.Region.Environment.Scenes } #endregion - //might not end up being used - protected bool m_isRoot; - public bool IsRoot - { - set { m_isRoot = value; } - get { return this.m_isRoot; } - } - #region Constructors /// /// @@ -209,9 +201,9 @@ namespace OpenSim.Region.Environment.Scenes this.LastOwnerID = LLUUID.Zero; this.UUID = LLUUID.Random(); this.LocalID = (uint)(localID); - this.m_shape = shape; + this.Shape = shape; - this.m_groupPosition = groupPosition; + this.GroupPosition = groupPosition; this.OffsetPosition = offsetPosition; this.RotationOffset = LLQuaternion.Identity; this.Velocity = new LLVector3(0, 0, 0); @@ -245,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes this.LastOwnerID = lastOwnerID; this.UUID = LLUUID.Random(); this.LocalID = (uint)(localID); - this.m_shape = shape; + this.Shape = shape; this.OffsetPosition = position; this.RotationOffset = rotation; @@ -265,12 +257,14 @@ namespace OpenSim.Region.Environment.Scenes dupe.m_regionHandle = m_regionHandle; dupe.UUID = LLUUID.Random(); dupe.LocalID = localID; + dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z); 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; + //TODO copy extraparams data and anything else not currently copied return dupe; } #endregion @@ -439,13 +433,15 @@ namespace OpenSim.Region.Environment.Scenes List avatars = this.m_parentGroup.RequestSceneAvatars(); for (int i = 0; i < avatars.Count; i++) { - SendFullUpdateToClient(avatars[i].ControllingClient); + m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this); } } - - - public void FullUpdate(IClientAPI remoteClient) + /// + /// + /// + /// + public void SendFullUpdate(IClientAPI remoteClient) { m_parentGroup.SendPartFullUpdate( remoteClient, this ); } @@ -461,6 +457,11 @@ namespace OpenSim.Region.Environment.Scenes SendFullUpdateToClient(remoteClient, lPos); } + /// + /// + /// + /// + /// public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos) { LLQuaternion lRot; @@ -478,20 +479,39 @@ namespace OpenSim.Region.Environment.Scenes List avatars = this.m_parentGroup.RequestSceneAvatars(); for (int i = 0; i < avatars.Count; i++) { - SendTerseUpdateToClient(avatars[i].ControllingClient); + m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this); } } /// /// /// + /// + public void SendTerseUpdate(IClientAPI remoteClient) + { + m_parentGroup.SendPartTerseUpdate(remoteClient, this); + } + + /// + /// + /// /// public void SendTerseUpdateToClient(IClientAPI remoteClient) { LLVector3 lPos; lPos = this.OffsetPosition; LLQuaternion mRot = this.RotationOffset; + remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot); + } + /// + /// + /// + /// + /// + public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos) + { + LLQuaternion mRot = this.RotationOffset; remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot); } #endregion diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index fa0fc33..5f2634d 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -11,7 +11,7 @@ namespace OpenSim.Region.Environment.Scenes protected Scene m_scene; public LLUUID m_uuid; - public LLUUID UUID + public virtual LLUUID UUID { get { @@ -61,7 +61,7 @@ namespace OpenSim.Region.Environment.Scenes } protected uint m_localId; - public uint LocalId + public virtual uint LocalId { get { return m_localId; } set { m_localId = value; } -- cgit v1.1