From 33ef93f4a6ed66dcd06733b3909e647b33faa698 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 13 Jul 2007 12:32:34 +0000 Subject: * ObjectAddPacket now confined to ClientView,´using PrimitiveBaseShape instead - w00t! --- OpenSim/Region/Environment/Scenes/Primitive.cs | 36 +++++------------------- OpenSim/Region/Environment/Scenes/Scene.cs | 21 ++------------ OpenSim/Region/Environment/Scenes/SceneBase.cs | 2 -- OpenSim/Region/Environment/Scenes/SceneObject.cs | 11 ++++---- 4 files changed, 15 insertions(+), 55 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index 5cb2930..4bb43d2 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs @@ -130,7 +130,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, SceneObject rootObject) + public Primitive(ulong regionHandle, Scene world, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos) { m_regionHandle = regionHandle; m_world = world; @@ -138,7 +138,8 @@ namespace OpenSim.Region.Environment.Scenes this.m_Parent = parent; this.m_isRootPrim = isRoot; this.m_RootParent = rootObject; - this.CreateFromPacket(addPacket, ownerID, localID); + + this.CreateFromPacket(ownerID, localID, pos, shape); this.Rotation = Axiom.Math.Quaternion.Identity; } @@ -209,43 +210,20 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID) + public void CreateFromPacket(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) { this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; this.OwnerID = ownerID; this.CreatorID = this.OwnerID; this.LastOwnerID = LLUUID.Zero; - this.Pos = addPacket.ObjectData.RayEnd; + this.Pos = pos; this.uuid = LLUUID.Random(); this.m_localId = (uint)(localID); - PrimitiveBaseShape pShape = new PrimitiveBaseShape(); - this.m_Shape = pShape; - - pShape.PCode = addPacket.ObjectData.PCode; - pShape.PathBegin = addPacket.ObjectData.PathBegin; - pShape.PathEnd = addPacket.ObjectData.PathEnd; - pShape.PathScaleX = addPacket.ObjectData.PathScaleX; - pShape.PathScaleY = addPacket.ObjectData.PathScaleY; - pShape.PathShearX = addPacket.ObjectData.PathShearX; - pShape.PathShearY = addPacket.ObjectData.PathShearY; - pShape.PathSkew = addPacket.ObjectData.PathSkew; - pShape.ProfileBegin = addPacket.ObjectData.ProfileBegin; - pShape.ProfileEnd = addPacket.ObjectData.ProfileEnd; - pShape.Scale = addPacket.ObjectData.Scale; - pShape.PathCurve = addPacket.ObjectData.PathCurve; - pShape.ProfileCurve = addPacket.ObjectData.ProfileCurve; - pShape.ProfileHollow = addPacket.ObjectData.ProfileHollow; - pShape.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset; - pShape.PathRevolutions = addPacket.ObjectData.PathRevolutions; - pShape.PathTaperX = addPacket.ObjectData.PathTaperX; - pShape.PathTaperY = addPacket.ObjectData.PathTaperY; - pShape.PathTwist = addPacket.ObjectData.PathTwist; - pShape.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; - LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005")); - pShape.TextureEntry = ntex.ToBytes(); + this.m_Shape = shape; this.updateFlag = 1; } + #endregion #region Linking / unlinking diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 4a4b7a0..417f817 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -417,22 +417,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - /// - public void AddNewPrim(Packet addPacket, IClientAPI agentClient) - { - AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentId); - } - - /// - /// - /// - /// /// - public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID) + public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape) { try { - SceneObject sceneOb = new SceneObject(m_regionHandle, this, addPacket, ownerID, this.PrimIDAllocate()); + SceneObject sceneOb = new SceneObject(m_regionHandle, this, ownerID, this.PrimIDAllocate(), pos, shape); this.Entities.Add(sceneOb.rootUUID, sceneOb); // Trigger event for listeners @@ -444,13 +434,6 @@ namespace OpenSim.Region.Environment.Scenes } } - public override uint AddNewPrim(LLUUID ownerId, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID texture, int flags) - { - uint id = NextLocalId; - - throw new NotImplementedException("Not implemented yet."); - } - #endregion #region Add/Remove Avatar Methods diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 811f54c..c852499 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs @@ -146,8 +146,6 @@ namespace OpenSim.Region.Environment.Scenes /// public abstract void AddNewClient(IClientAPI client, bool child); - public abstract uint AddNewPrim(LLUUID ownerId, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID texture, int flags); - /// /// /// diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs index 93b6e8d..5eed115 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs @@ -30,6 +30,7 @@ using System.Text; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Types; using OpenSim.Physics.Manager; namespace OpenSim.Region.Environment.Scenes @@ -67,12 +68,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public SceneObject(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID) + public SceneObject(ulong regionHandle, Scene world, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) { m_regionHandle = regionHandle; m_world = world; - this.Pos = addPacket.ObjectData.RayEnd; - this.CreateRootFromPacket(addPacket, ownerID, localID); + this.Pos = pos; + this.CreateRootFromPacket(ownerID, localID, shape, pos ); } /// @@ -90,9 +91,9 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void CreateRootFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) + public void CreateRootFromPacket(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos) { - this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, addPacket, agentID, localID, true, this, this); + this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos); this.children.Add(rootPrimitive); this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive); } -- cgit v1.1