From dde8aafb8addbb7ae00802c31f27d51456170000 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 3 Aug 2007 11:44:30 +0000 Subject: More work on the AllNewSceneObject* classes. --- OpenSim/Framework/General/Types/EstateSettings.cs | 2 - .../Environment/Scenes/AllNewSceneObjectGroup2.cs | 85 +++++++++++++++++++++- .../Environment/Scenes/AllNewSceneObjectPart2.cs | 40 ++++++++++ .../Region/Terrain.BasicTerrain/TerrainEngine.cs | 2 +- 4 files changed, 125 insertions(+), 4 deletions(-) diff --git a/OpenSim/Framework/General/Types/EstateSettings.cs b/OpenSim/Framework/General/Types/EstateSettings.cs index ac173a9..11594fd 100644 --- a/OpenSim/Framework/General/Types/EstateSettings.cs +++ b/OpenSim/Framework/General/Types/EstateSettings.cs @@ -560,7 +560,6 @@ namespace OpenSim.Framework.Types public void loadConfigurationOptions() { - configMember.addConfigurationOption("billable_factor", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "","0.0",true); configMember.addConfigurationOption("estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "","0",true); configMember.addConfigurationOption("parent_estate_id", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, "", "0", true); @@ -603,7 +602,6 @@ namespace OpenSim.Framework.Types configMember.addConfigurationOption("terrain_multiplier", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, "", "60.0", true); configMember.addConfigurationOption("water_height", ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, "", "20.0", true); configMember.addConfigurationOption("terrain_image_id", ConfigurationOption.ConfigurationTypes.TYPE_LLUUID, "", "00000000-0000-0000-0000-000000000000", true); - } public bool handleIncomingConfiguration(string configuration_key, object configuration_result) diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs index e43329d..8fd8e52 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs @@ -18,6 +18,9 @@ namespace OpenSim.Region.Environment.Scenes protected AllNewSceneObjectPart2 m_rootPart; protected Dictionary m_parts = new Dictionary(); + protected ulong m_regionHandle; + protected Scene m_scene; + public event PrimCountTaintedDelegate OnPrimCountTainted; /// @@ -45,9 +48,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; + m_scene = world; + this.Pos = pos; + this.m_rootPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, pos); + this.m_parts.Add(this.m_rootPart.UUID, this.m_rootPart); } /// @@ -142,6 +150,9 @@ namespace OpenSim.Region.Environment.Scenes return false; } + /// + /// + /// public void TriggerTainted() { if (OnPrimCountTainted != null) @@ -194,6 +205,50 @@ namespace OpenSim.Region.Environment.Scenes client.OutPacket(proper); } + /// + /// + /// + /// + /// + public void GetInventory(IClientAPI remoteClient, uint localID) + { + AllNewSceneObjectPart2 part = this.GetChildPrim(localID); + if (part != null) + { + part.GetInventory(remoteClient, localID); + } + } + + /// + /// + /// + /// + /// + /// + /// + public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) + { + AllNewSceneObjectPart2 part = this.GetChildPrim(localID); + if (part != null) + { + part.UpdateExtraParam(type, inUse, data); + } + } + + /// + /// + /// + /// + /// + public void UpdateTextureEntry(uint localID, byte[] textureEntry) + { + AllNewSceneObjectPart2 part = this.GetChildPrim(localID); + if (part != null) + { + part.UpdateTextureEntry(textureEntry); + } + } + #region Shape /// /// @@ -210,11 +265,20 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region Position + /// + /// + /// + /// public void UpdateGroupPosition(LLVector3 pos) { this.m_pos = pos; } + /// + /// + /// + /// + /// public void UpdateSinglePosition(LLVector3 pos, uint localID) { AllNewSceneObjectPart2 part = this.GetChildPrim(localID); @@ -231,6 +295,10 @@ namespace OpenSim.Region.Environment.Scenes } } + /// + /// + /// + /// private void UpdateRootPosition(LLVector3 pos) { LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); @@ -258,6 +326,10 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region Roation + /// + /// + /// + /// public void UpdateGroupRotation(LLQuaternion rot) { this.m_rootPart.UpdateRotation(rot); @@ -274,6 +346,11 @@ namespace OpenSim.Region.Environment.Scenes this.m_pos = pos; } + /// + /// + /// + /// + /// public void UpdateSingleRotation(LLQuaternion rot, uint localID) { AllNewSceneObjectPart2 part = this.GetChildPrim(localID); @@ -289,6 +366,11 @@ namespace OpenSim.Region.Environment.Scenes } } } + + /// + /// + /// + /// private void UpdateRootRotation(LLQuaternion rot) { this.m_rootPart.UpdateRotation(rot); @@ -310,6 +392,7 @@ namespace OpenSim.Region.Environment.Scenes } } } + #endregion /// /// diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs index c4b4b43..62f9b93 100644 --- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs +++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs @@ -252,6 +252,15 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region Constructors + /// + /// Create a completely new SceneObjectPart (prim) + /// + /// + /// + /// + /// + /// + /// public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 position) { this.m_regionHandle = regionHandle; @@ -266,6 +275,10 @@ namespace OpenSim.Region.Environment.Scenes this.m_Shape = shape; this.OffsetPosition = position; + this.RotationOffset = LLQuaternion.Identity; + this.Velocity = new LLVector3(0, 0, 0); + this.AngularVelocity = new LLVector3(0, 0, 0); + this.Acceleration = new LLVector3(0, 0, 0); //temporary code just so the m_flags field doesn't give a compiler warning if (m_flags ==LLObject.ObjectFlags.AllowInventoryDrop) @@ -273,6 +286,33 @@ namespace OpenSim.Region.Environment.Scenes } } + + /// + /// Recreate a SceneObjectPart (prim) + /// + /// + /// + /// + /// + /// + /// + public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, int creationDate, LLUUID ownerID, LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape, LLVector3 position, LLQuaternion rotation, uint flags) + { + this.m_regionHandle = regionHandle; + this.m_parentGroup = parent; + + this.CreationDate = creationDate; + this.OwnerID = ownerID; + this.CreatorID = creatorID; + this.LastOwnerID = lastOwnerID; + this.UUID = LLUUID.Random(); + this.LocalID = (uint)(localID); + this.m_Shape = shape; + + this.OffsetPosition = position; + this.RotationOffset = rotation; + this.ObjectFlags = flags; + } #endregion #region Update Scheduling diff --git a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs index 27259b9..1e0e978 100644 --- a/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs +++ b/OpenSim/Region/Terrain.BasicTerrain/TerrainEngine.cs @@ -794,7 +794,7 @@ namespace OpenSim.Region.Terrain s.Close(); } - /// + /// /// Outputs to a LL compatible RAW in the most efficient manner possible /// /// Does not calculate the revert map -- cgit v1.1