aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.API.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs76
1 files changed, 76 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index e683db2..5056f41 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -626,6 +626,39 @@ namespace OpenSim.Region.ClientStack
626 OutPacket(outPacket); 626 OutPacket(outPacket);
627 } 627 }
628 628
629
630 public void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID)
631 {
632 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
633 outPacket.RegionData.RegionHandle = regionHandle;
634 outPacket.RegionData.TimeDilation = timeDilation;
635 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
636 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primShape, textureID, flags);
637 outPacket.ObjectData[0].ID = localID;
638 outPacket.ObjectData[0].FullID = objectID;
639 outPacket.ObjectData[0].OwnerID = ownerID;
640 byte[] pb = pos.GetBytes();
641 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
642 byte[] rot = rotation.GetBytes();
643 Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 48, rot.Length);
644 OutPacket(outPacket);
645 }
646
647 public void SendPrimitiveToClient2(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLUUID textureID, uint flags, LLUUID objectID, LLUUID ownerID)
648 {
649 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
650 outPacket.RegionData.RegionHandle = regionHandle;
651 outPacket.RegionData.TimeDilation = timeDilation;
652 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
653 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primShape, textureID, flags);
654 outPacket.ObjectData[0].ID = localID;
655 outPacket.ObjectData[0].FullID = objectID;
656 outPacket.ObjectData[0].OwnerID = ownerID;
657 byte[] pb = pos.GetBytes();
658 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
659
660 OutPacket(outPacket);
661 }
629 /// <summary> 662 /// <summary>
630 /// 663 ///
631 /// </summary> 664 /// </summary>
@@ -816,6 +849,22 @@ namespace OpenSim.Region.ClientStack
816 } 849 }
817 850
818 /// <summary> 851 /// <summary>
852 /// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive)
853 /// </summary>
854 /// <param name="primData"></param>
855 /// <returns></returns>
856 protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimitiveBaseShape primShape, LLUUID textureID, uint flags)
857 {
858 ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
859 this.SetDefaultPrimPacketValues(objupdate);
860 objupdate.UpdateFlags = flags;
861 this.SetPrimPacketShapeData(objupdate, primShape, textureID);
862
863 return objupdate;
864 }
865
866
867 /// <summary>
819 /// Copy the data from a PrimData object to a ObjectUpdatePacket 868 /// Copy the data from a PrimData object to a ObjectUpdatePacket
820 /// </summary> 869 /// </summary>
821 /// <param name="objectData"></param> 870 /// <param name="objectData"></param>
@@ -848,6 +897,33 @@ namespace OpenSim.Region.ClientStack
848 objectData.PathTwistBegin = primData.PathTwistBegin; 897 objectData.PathTwistBegin = primData.PathTwistBegin;
849 } 898 }
850 899
900 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimitiveBaseShape primData, LLUUID textureID)
901 {
902 LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
903 objectData.TextureEntry = ntex.ToBytes();
904 objectData.PCode = primData.PCode;
905 objectData.PathBegin = primData.PathBegin;
906 objectData.PathEnd = primData.PathEnd;
907 objectData.PathScaleX = primData.PathScaleX;
908 objectData.PathScaleY = primData.PathScaleY;
909 objectData.PathShearX = primData.PathShearX;
910 objectData.PathShearY = primData.PathShearY;
911 objectData.PathSkew = primData.PathSkew;
912 objectData.ProfileBegin = primData.ProfileBegin;
913 objectData.ProfileEnd = primData.ProfileEnd;
914 objectData.Scale = primData.Scale;
915 objectData.PathCurve = primData.PathCurve;
916 objectData.ProfileCurve = primData.ProfileCurve;
917 objectData.ParentID = primData.ParentID;
918 objectData.ProfileHollow = primData.ProfileHollow;
919 objectData.PathRadiusOffset = primData.PathRadiusOffset;
920 objectData.PathRevolutions = primData.PathRevolutions;
921 objectData.PathTaperX = primData.PathTaperX;
922 objectData.PathTaperY = primData.PathTaperY;
923 objectData.PathTwist = primData.PathTwist;
924 objectData.PathTwistBegin = primData.PathTwistBegin;
925 }
926
851 /// <summary> 927 /// <summary>
852 /// Set some default values in a ObjectUpdatePacket 928 /// Set some default values in a ObjectUpdatePacket
853 /// </summary> 929 /// </summary>