aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.Framework
diff options
context:
space:
mode:
authorMW2007-06-10 15:43:04 +0000
committerMW2007-06-10 15:43:04 +0000
commit488e71620866c0749a0347d878f0707de2b8eb15 (patch)
treed720273e85e489701d4925fe6e845b964b2e0343 /Common/OpenSim.Framework
parentAnother bug fix (diff)
downloadopensim-SC_OLD-488e71620866c0749a0347d878f0707de2b8eb15.zip
opensim-SC_OLD-488e71620866c0749a0347d878f0707de2b8eb15.tar.gz
opensim-SC_OLD-488e71620866c0749a0347d878f0707de2b8eb15.tar.bz2
opensim-SC_OLD-488e71620866c0749a0347d878f0707de2b8eb15.tar.xz
Prim creation working.
Diffstat (limited to '')
-rw-r--r--Common/OpenSim.Framework/Interfaces/IClientAPI.cs1
-rw-r--r--Common/OpenSim.Framework/Types/PrimData.cs59
2 files changed, 46 insertions, 14 deletions
diff --git a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
index 1bf378f..d3dc6d2 100644
--- a/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
+++ b/Common/OpenSim.Framework/Interfaces/IClientAPI.cs
@@ -103,5 +103,6 @@ namespace OpenSim.Framework.Interfaces
103 AgentCircuitData RequestClientInfo(); 103 AgentCircuitData RequestClientInfo();
104 104
105 void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID); 105 void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID);
106 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation);
106 } 107 }
107} 108}
diff --git a/Common/OpenSim.Framework/Types/PrimData.cs b/Common/OpenSim.Framework/Types/PrimData.cs
index 68e2a22..8729982 100644
--- a/Common/OpenSim.Framework/Types/PrimData.cs
+++ b/Common/OpenSim.Framework/Types/PrimData.cs
@@ -32,7 +32,7 @@ namespace OpenSim.Framework.Types
32 public sbyte PathTwist; 32 public sbyte PathTwist;
33 public sbyte PathTwistBegin; 33 public sbyte PathTwistBegin;
34 public byte[] Texture; 34 public byte[] Texture;
35 35
36 36
37 public Int32 CreationDate; 37 public Int32 CreationDate;
38 public uint OwnerMask = FULL_MASK_PERMISSIONS; 38 public uint OwnerMask = FULL_MASK_PERMISSIONS;
@@ -43,7 +43,7 @@ namespace OpenSim.Framework.Types
43 43
44 //following only used during prim storage 44 //following only used during prim storage
45 public LLVector3 Position; 45 public LLVector3 Position;
46 public LLQuaternion Rotation = new LLQuaternion(0,1,0,0); 46 public LLQuaternion Rotation = new LLQuaternion(0, 1, 0, 0);
47 public uint LocalID; 47 public uint LocalID;
48 public LLUUID FullID; 48 public LLUUID FullID;
49 49
@@ -54,7 +54,7 @@ namespace OpenSim.Framework.Types
54 54
55 public PrimData(byte[] data) 55 public PrimData(byte[] data)
56 { 56 {
57 int i =0; 57 int i = 0;
58 58
59 this.OwnerID = new LLUUID(data, i); i += 16; 59 this.OwnerID = new LLUUID(data, i); i += 16;
60 this.PCode = data[i++]; 60 this.PCode = data[i++];
@@ -75,9 +75,9 @@ namespace OpenSim.Framework.Types
75 this.PathRadiusOffset = (sbyte)data[i++]; 75 this.PathRadiusOffset = (sbyte)data[i++];
76 this.PathRevolutions = data[i++]; 76 this.PathRevolutions = data[i++];
77 this.PathTaperX = (sbyte)data[i++]; 77 this.PathTaperX = (sbyte)data[i++];
78 this.PathTaperY =(sbyte) data[i++]; 78 this.PathTaperY = (sbyte)data[i++];
79 this.PathTwist = (sbyte) data[i++]; 79 this.PathTwist = (sbyte)data[i++];
80 this.PathTwistBegin = (sbyte) data[i++]; 80 this.PathTwistBegin = (sbyte)data[i++];
81 ushort length = (ushort)(data[i++] + (data[i++] << 8)); 81 ushort length = (ushort)(data[i++] + (data[i++] << 8));
82 this.Texture = new byte[length]; 82 this.Texture = new byte[length];
83 Array.Copy(data, i, Texture, 0, length); i += length; 83 Array.Copy(data, i, Texture, 0, length); i += length;
@@ -88,7 +88,7 @@ namespace OpenSim.Framework.Types
88 this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); 88 this.EveryoneMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
89 this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); 89 this.BaseMask = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
90 this.Position = new LLVector3(data, i); i += 12; 90 this.Position = new LLVector3(data, i); i += 12;
91 this.Rotation = new LLQuaternion(data,i, true); i += 12; 91 this.Rotation = new LLQuaternion(data, i, true); i += 12;
92 this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24)); 92 this.LocalID = (uint)(data[i++] + (data[i++] << 8) + (data[i++] << 16) + (data[i++] << 24));
93 this.FullID = new LLUUID(data, i); i += 16; 93 this.FullID = new LLUUID(data, i); i += 16;
94 94
@@ -120,14 +120,14 @@ namespace OpenSim.Framework.Types
120 bytes[i++] = (byte)((ParentID >> 8) % 256); 120 bytes[i++] = (byte)((ParentID >> 8) % 256);
121 bytes[i++] = (byte)((ParentID >> 16) % 256); 121 bytes[i++] = (byte)((ParentID >> 16) % 256);
122 bytes[i++] = (byte)((ParentID >> 24) % 256); 122 bytes[i++] = (byte)((ParentID >> 24) % 256);
123 bytes[i++] = (byte)(this.ProfileHollow %256); 123 bytes[i++] = (byte)(this.ProfileHollow % 256);
124 bytes[i++] = (byte)((this.ProfileHollow >> 8)% 256); 124 bytes[i++] = (byte)((this.ProfileHollow >> 8) % 256);
125 bytes[i++] = ((byte)this.PathRadiusOffset); 125 bytes[i++] = ((byte)this.PathRadiusOffset);
126 bytes[i++] = this.PathRevolutions; 126 bytes[i++] = this.PathRevolutions;
127 bytes[i++] = ((byte) this.PathTaperX); 127 bytes[i++] = ((byte)this.PathTaperX);
128 bytes[i++] = ((byte) this.PathTaperY); 128 bytes[i++] = ((byte)this.PathTaperY);
129 bytes[i++] = ((byte) this.PathTwist); 129 bytes[i++] = ((byte)this.PathTwist);
130 bytes[i++] = ((byte) this.PathTwistBegin); 130 bytes[i++] = ((byte)this.PathTwistBegin);
131 bytes[i++] = (byte)(Texture.Length % 256); 131 bytes[i++] = (byte)(Texture.Length % 256);
132 bytes[i++] = (byte)((Texture.Length >> 8) % 256); 132 bytes[i++] = (byte)((Texture.Length >> 8) % 256);
133 Array.Copy(Texture, 0, bytes, i, Texture.Length); i += Texture.Length; 133 Array.Copy(Texture, 0, bytes, i, Texture.Length); i += Texture.Length;
@@ -156,7 +156,7 @@ namespace OpenSim.Framework.Types
156 bytes[i++] = (byte)((this.BaseMask >> 16) % 256); 156 bytes[i++] = (byte)((this.BaseMask >> 16) % 256);
157 bytes[i++] = (byte)((this.BaseMask >> 24) % 256); 157 bytes[i++] = (byte)((this.BaseMask >> 24) % 256);
158 Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12; 158 Array.Copy(this.Position.GetBytes(), 0, bytes, i, 12); i += 12;
159 if (this.Rotation == new LLQuaternion(0,0,0,0)) 159 if (this.Rotation == new LLQuaternion(0, 0, 0, 0))
160 { 160 {
161 this.Rotation = new LLQuaternion(0, 1, 0, 0); 161 this.Rotation = new LLQuaternion(0, 1, 0, 0);
162 } 162 }
@@ -169,5 +169,36 @@ namespace OpenSim.Framework.Types
169 169
170 return bytes; 170 return bytes;
171 } 171 }
172
173 public static PrimData DefaultCube()
174 {
175 PrimData primData = new PrimData();
176 primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
177 primData.FullID = LLUUID.Random();
178 primData.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
179 primData.Rotation = new LLQuaternion(0, 0, 0, 1);
180 primData.PCode = 9;
181 primData.ParentID = 0;
182 primData.PathBegin = 0;
183 primData.PathEnd = 0;
184 primData.PathScaleX = 0;
185 primData.PathScaleY = 0;
186 primData.PathShearX = 0;
187 primData.PathShearY = 0;
188 primData.PathSkew = 0;
189 primData.ProfileBegin = 0;
190 primData.ProfileEnd = 0;
191 primData.PathCurve = 16;
192 primData.ProfileCurve = 1;
193 primData.ProfileHollow = 0;
194 primData.PathRadiusOffset = 0;
195 primData.PathRevolutions = 0;
196 primData.PathTaperX = 0;
197 primData.PathTaperY = 0;
198 primData.PathTwist = 0;
199 primData.PathTwistBegin = 0;
200
201 return primData;
202 }
172 } 203 }
173} 204}