aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ConvertToPlugins/src/world/Primitive.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ConvertToPlugins/src/world/Primitive.cs')
-rw-r--r--ConvertToPlugins/src/world/Primitive.cs136
1 files changed, 0 insertions, 136 deletions
diff --git a/ConvertToPlugins/src/world/Primitive.cs b/ConvertToPlugins/src/world/Primitive.cs
deleted file mode 100644
index 18b5715..0000000
--- a/ConvertToPlugins/src/world/Primitive.cs
+++ /dev/null
@@ -1,136 +0,0 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.types;
5using libsecondlife;
6using libsecondlife.Packets;
7
8namespace OpenSim.world
9{
10 public class Primitive : Entity
11 {
12 protected float mesh_cutbegin;
13 protected float mesh_cutend;
14 protected PrimData primData;
15 protected bool newPrimFlag;
16 protected ObjectUpdatePacket OurPacket;
17
18 public Primitive()
19 {
20 mesh_cutbegin = 0.0f;
21 mesh_cutend = 1.0f;
22 }
23
24 public override Mesh getMesh()
25 {
26 Mesh mesh = new Mesh();
27 Triangle tri = new Triangle(
28 new Axiom.MathLib.Vector3(0.0f, 1.0f, 1.0f),
29 new Axiom.MathLib.Vector3(1.0f, 0.0f, 1.0f),
30 new Axiom.MathLib.Vector3(1.0f, 1.0f, 0.0f));
31
32 mesh.AddTri(tri);
33 mesh += base.getMesh();
34
35 return mesh;
36 }
37
38 public override void update()
39 {
40 if(this.newPrimFlag)
41 {
42 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
43 client.OutPacket(OurPacket);
44 }
45 this.newPrimFlag = false;
46 }
47 }
48
49 public void CreateFromPacket( ObjectAddPacket addPacket, LLUUID agentID, uint localID)
50 {
51 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
52 objupdate.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle;
53 objupdate.RegionData.TimeDilation = 64096;
54
55 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
56 PrimData PData = new PrimData();
57 this.primData = PData;
58 objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock();//OpenSim_Main.local_world.PrimTemplate;
59 objupdate.ObjectData[0].PSBlock = new byte[0];
60 objupdate.ObjectData[0].ExtraParams = new byte[1];
61 objupdate.ObjectData[0].MediaURL = new byte[0];
62 objupdate.ObjectData[0].NameValue = new byte[0];
63 objupdate.ObjectData[0].PSBlock = new byte[0];
64 objupdate.ObjectData[0].Text = new byte[0];
65 objupdate.ObjectData[0].TextColor = new byte[4];
66 objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0);
67 objupdate.ObjectData[0].JointPivot = new LLVector3(0,0,0);
68 objupdate.ObjectData[0].Material = 3;
69 objupdate.ObjectData[0].TextureAnim = new byte[0];
70 objupdate.ObjectData[0].Sound = LLUUID.Zero;
71 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
72 objupdate.ObjectData[0].TextureEntry = ntex.ToBytes();
73 objupdate.ObjectData[0].State = 0;
74 objupdate.ObjectData[0].Data = new byte[0];
75 PData.OwnerID = objupdate.ObjectData[0].OwnerID = agentID;
76 PData.PCode = objupdate.ObjectData[0].PCode = addPacket.ObjectData.PCode;
77 PData.PathBegin = objupdate.ObjectData[0].PathBegin = addPacket.ObjectData.PathBegin;
78 PData.PathEnd = objupdate.ObjectData[0].PathEnd = addPacket.ObjectData.PathEnd;
79 PData.PathScaleX = objupdate.ObjectData[0].PathScaleX = addPacket.ObjectData.PathScaleX;
80 PData.PathScaleY = objupdate.ObjectData[0].PathScaleY = addPacket.ObjectData.PathScaleY;
81 PData.PathShearX = objupdate.ObjectData[0].PathShearX = addPacket.ObjectData.PathShearX;
82 PData.PathShearY = objupdate.ObjectData[0].PathShearY = addPacket.ObjectData.PathShearY;
83 PData.PathSkew = objupdate.ObjectData[0].PathSkew = addPacket.ObjectData.PathSkew;
84 PData.ProfileBegin = objupdate.ObjectData[0].ProfileBegin = addPacket.ObjectData.ProfileBegin;
85 PData.ProfileEnd = objupdate.ObjectData[0].ProfileEnd = addPacket.ObjectData.ProfileEnd;
86 PData.Scale = objupdate.ObjectData[0].Scale = addPacket.ObjectData.Scale;
87 PData.PathCurve = objupdate.ObjectData[0].PathCurve = addPacket.ObjectData.PathCurve;
88 PData.ProfileCurve = objupdate.ObjectData[0].ProfileCurve = addPacket.ObjectData.ProfileCurve;
89 PData.ParentID = objupdate.ObjectData[0].ParentID = 0;
90 PData.ProfileHollow = objupdate.ObjectData[0].ProfileHollow = addPacket.ObjectData.ProfileHollow;
91 //finish off copying rest of shape data
92
93 objupdate.ObjectData[0].ID = (uint)(localID);
94 objupdate.ObjectData[0].FullID = new LLUUID("edba7151-5857-acc5-b30b-f01efefda" + (localID- 702000).ToString("000"));
95
96 objupdate.ObjectData[0].ObjectData = new byte[60];
97 objupdate.ObjectData[0].ObjectData[46] = 128;
98 objupdate.ObjectData[0].ObjectData[47] = 63;
99 LLVector3 pos1= addPacket.ObjectData.RayEnd;
100 //update position
101 byte[] pb = pos1.GetBytes();
102 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 0, pb.Length);
103
104 this.newPrimFlag = true;
105 this.uuid = objupdate.ObjectData[0].FullID;
106 this.localid = objupdate.ObjectData[0].ID;
107 this.position = pos1;
108 this.OurPacket = objupdate;
109 }
110 }
111
112 public class PrimData
113 {
114 public LLUUID OwnerID;
115 public byte PCode;
116 public byte PathBegin;
117 public byte PathEnd;
118 public byte PathScaleX;
119 public byte PathScaleY;
120 public byte PathShearX;
121 public byte PathShearY;
122 public sbyte PathSkew;
123 public byte ProfileBegin;
124 public byte ProfileEnd;
125 public LLVector3 Scale;
126 public byte PathCurve;
127 public byte ProfileCurve;
128 public uint ParentID=0;
129 public byte ProfileHollow;
130
131 public PrimData()
132 {
133
134 }
135 }
136}