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/Framework/General/Interfaces/IClientAPI.cs | 3 ++- .../Framework/General/Types/PrimitiveBaseShape.cs | 31 +++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/General') diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index b6f304b..9ac7994 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs @@ -75,6 +75,7 @@ namespace OpenSim.Framework.Interfaces public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); + public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape); public interface IClientAPI { @@ -94,7 +95,7 @@ namespace OpenSim.Framework.Interfaces event GenericCall2 OnCompleteMovementToRegion; event UpdateAgent OnAgentUpdate; event GenericCall OnRequestAvatarsData; - event GenericCall4 OnAddPrim; + event AddNewPrim OnAddPrim; event ObjectDuplicate OnObjectDuplicate; event UpdateVector OnGrapObject; event ObjectSelect OnDeGrapObject; diff --git a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs index a6671d1..b9a8c90 100644 --- a/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/General/Types/PrimitiveBaseShape.cs @@ -1,4 +1,5 @@ using libsecondlife; +using libsecondlife.Packets; namespace OpenSim.Framework.Types { @@ -97,6 +98,34 @@ namespace OpenSim.Framework.Types return primShape; } - } + public static PrimitiveBaseShape FromAddPacket(ObjectAddPacket addPacket) + { + PrimitiveBaseShape pShape = new PrimitiveBaseShape(); + + 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(); + return pShape; + } + } } -- cgit v1.1