aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorlbsa712007-07-13 12:32:34 +0000
committerlbsa712007-07-13 12:32:34 +0000
commit33ef93f4a6ed66dcd06733b3909e647b33faa698 (patch)
treed161a1fe96353ea4077b62f12aa453a7ebd77d9e /OpenSim/Region/Environment
parent* OGS project is now back down to zero warnings. (diff)
downloadopensim-SC-33ef93f4a6ed66dcd06733b3909e647b33faa698.zip
opensim-SC-33ef93f4a6ed66dcd06733b3909e647b33faa698.tar.gz
opensim-SC-33ef93f4a6ed66dcd06733b3909e647b33faa698.tar.bz2
opensim-SC-33ef93f4a6ed66dcd06733b3909e647b33faa698.tar.xz
* ObjectAddPacket now confined to ClientView,´using PrimitiveBaseShape instead - w00t!
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs36
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs21
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObject.cs11
4 files changed, 15 insertions, 55 deletions
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
130 /// <param name="isRoot"></param> 130 /// <param name="isRoot"></param>
131 /// <param name="parent"></param> 131 /// <param name="parent"></param>
132 /// <param name="rootObject"></param> 132 /// <param name="rootObject"></param>
133 public Primitive(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, SceneObject rootObject) 133 public Primitive(ulong regionHandle, Scene world, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent, SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos)
134 { 134 {
135 m_regionHandle = regionHandle; 135 m_regionHandle = regionHandle;
136 m_world = world; 136 m_world = world;
@@ -138,7 +138,8 @@ namespace OpenSim.Region.Environment.Scenes
138 this.m_Parent = parent; 138 this.m_Parent = parent;
139 this.m_isRootPrim = isRoot; 139 this.m_isRootPrim = isRoot;
140 this.m_RootParent = rootObject; 140 this.m_RootParent = rootObject;
141 this.CreateFromPacket(addPacket, ownerID, localID); 141
142 this.CreateFromPacket(ownerID, localID, pos, shape);
142 this.Rotation = Axiom.Math.Quaternion.Identity; 143 this.Rotation = Axiom.Math.Quaternion.Identity;
143 } 144 }
144 145
@@ -209,43 +210,20 @@ namespace OpenSim.Region.Environment.Scenes
209 /// <param name="addPacket"></param> 210 /// <param name="addPacket"></param>
210 /// <param name="ownerID"></param> 211 /// <param name="ownerID"></param>
211 /// <param name="localID"></param> 212 /// <param name="localID"></param>
212 public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID) 213 public void CreateFromPacket(LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
213 { 214 {
214 this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; 215 this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
215 this.OwnerID = ownerID; 216 this.OwnerID = ownerID;
216 this.CreatorID = this.OwnerID; 217 this.CreatorID = this.OwnerID;
217 this.LastOwnerID = LLUUID.Zero; 218 this.LastOwnerID = LLUUID.Zero;
218 this.Pos = addPacket.ObjectData.RayEnd; 219 this.Pos = pos;
219 this.uuid = LLUUID.Random(); 220 this.uuid = LLUUID.Random();
220 this.m_localId = (uint)(localID); 221 this.m_localId = (uint)(localID);
221 222
222 PrimitiveBaseShape pShape = new PrimitiveBaseShape(); 223 this.m_Shape = shape;
223 this.m_Shape = pShape;
224
225 pShape.PCode = addPacket.ObjectData.PCode;
226 pShape.PathBegin = addPacket.ObjectData.PathBegin;
227 pShape.PathEnd = addPacket.ObjectData.PathEnd;
228 pShape.PathScaleX = addPacket.ObjectData.PathScaleX;
229 pShape.PathScaleY = addPacket.ObjectData.PathScaleY;
230 pShape.PathShearX = addPacket.ObjectData.PathShearX;
231 pShape.PathShearY = addPacket.ObjectData.PathShearY;
232 pShape.PathSkew = addPacket.ObjectData.PathSkew;
233 pShape.ProfileBegin = addPacket.ObjectData.ProfileBegin;
234 pShape.ProfileEnd = addPacket.ObjectData.ProfileEnd;
235 pShape.Scale = addPacket.ObjectData.Scale;
236 pShape.PathCurve = addPacket.ObjectData.PathCurve;
237 pShape.ProfileCurve = addPacket.ObjectData.ProfileCurve;
238 pShape.ProfileHollow = addPacket.ObjectData.ProfileHollow;
239 pShape.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
240 pShape.PathRevolutions = addPacket.ObjectData.PathRevolutions;
241 pShape.PathTaperX = addPacket.ObjectData.PathTaperX;
242 pShape.PathTaperY = addPacket.ObjectData.PathTaperY;
243 pShape.PathTwist = addPacket.ObjectData.PathTwist;
244 pShape.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
245 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
246 pShape.TextureEntry = ntex.ToBytes();
247 this.updateFlag = 1; 224 this.updateFlag = 1;
248 } 225 }
226
249 #endregion 227 #endregion
250 228
251 #region Linking / unlinking 229 #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
417 /// 417 ///
418 /// </summary> 418 /// </summary>
419 /// <param name="addPacket"></param> 419 /// <param name="addPacket"></param>
420 /// <param name="agentClient"></param>
421 public void AddNewPrim(Packet addPacket, IClientAPI agentClient)
422 {
423 AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentId);
424 }
425
426 /// <summary>
427 ///
428 /// </summary>
429 /// <param name="addPacket"></param>
430 /// <param name="ownerID"></param> 420 /// <param name="ownerID"></param>
431 public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID) 421 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
432 { 422 {
433 try 423 try
434 { 424 {
435 SceneObject sceneOb = new SceneObject(m_regionHandle, this, addPacket, ownerID, this.PrimIDAllocate()); 425 SceneObject sceneOb = new SceneObject(m_regionHandle, this, ownerID, this.PrimIDAllocate(), pos, shape);
436 this.Entities.Add(sceneOb.rootUUID, sceneOb); 426 this.Entities.Add(sceneOb.rootUUID, sceneOb);
437 427
438 // Trigger event for listeners 428 // Trigger event for listeners
@@ -444,13 +434,6 @@ namespace OpenSim.Region.Environment.Scenes
444 } 434 }
445 } 435 }
446 436
447 public override uint AddNewPrim(LLUUID ownerId, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID texture, int flags)
448 {
449 uint id = NextLocalId;
450
451 throw new NotImplementedException("Not implemented yet.");
452 }
453
454 #endregion 437 #endregion
455 438
456 #region Add/Remove Avatar Methods 439 #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
146 /// <param name="child"></param> 146 /// <param name="child"></param>
147 public abstract void AddNewClient(IClientAPI client, bool child); 147 public abstract void AddNewClient(IClientAPI client, bool child);
148 148
149 public abstract uint AddNewPrim(LLUUID ownerId, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID texture, int flags);
150
151 /// <summary> 149 /// <summary>
152 /// 150 ///
153 /// </summary> 151 /// </summary>
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;
30using libsecondlife; 30using libsecondlife;
31using libsecondlife.Packets; 31using libsecondlife.Packets;
32using OpenSim.Framework.Interfaces; 32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Types;
33using OpenSim.Physics.Manager; 34using OpenSim.Physics.Manager;
34 35
35namespace OpenSim.Region.Environment.Scenes 36namespace OpenSim.Region.Environment.Scenes
@@ -67,12 +68,12 @@ namespace OpenSim.Region.Environment.Scenes
67 /// <summary> 68 /// <summary>
68 /// 69 ///
69 /// </summary> 70 /// </summary>
70 public SceneObject(ulong regionHandle, Scene world, ObjectAddPacket addPacket, LLUUID ownerID, uint localID) 71 public SceneObject(ulong regionHandle, Scene world, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
71 { 72 {
72 m_regionHandle = regionHandle; 73 m_regionHandle = regionHandle;
73 m_world = world; 74 m_world = world;
74 this.Pos = addPacket.ObjectData.RayEnd; 75 this.Pos = pos;
75 this.CreateRootFromPacket(addPacket, ownerID, localID); 76 this.CreateRootFromPacket(ownerID, localID, shape, pos );
76 } 77 }
77 78
78 /// <summary> 79 /// <summary>
@@ -90,9 +91,9 @@ namespace OpenSim.Region.Environment.Scenes
90 /// <param name="addPacket"></param> 91 /// <param name="addPacket"></param>
91 /// <param name="agentID"></param> 92 /// <param name="agentID"></param>
92 /// <param name="localID"></param> 93 /// <param name="localID"></param>
93 public void CreateRootFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) 94 public void CreateRootFromPacket(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
94 { 95 {
95 this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, addPacket, agentID, localID, true, this, this); 96 this.rootPrimitive = new Primitive( this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos);
96 this.children.Add(rootPrimitive); 97 this.children.Add(rootPrimitive);
97 this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive); 98 this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
98 } 99 }