aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorlbsa712007-07-13 12:32:34 +0000
committerlbsa712007-07-13 12:32:34 +0000
commit33ef93f4a6ed66dcd06733b3909e647b33faa698 (patch)
treed161a1fe96353ea4077b62f12aa453a7ebd77d9e
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 '')
-rw-r--r--OpenSim/Framework/General/Interfaces/IClientAPI.cs3
-rw-r--r--OpenSim/Framework/General/Types/PrimitiveBaseShape.cs31
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs5
-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
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs2
9 files changed, 53 insertions, 60 deletions
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
75 75
76 public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client); 76 public delegate void UUIDNameRequest(LLUUID id, IClientAPI remote_client);
77 77
78 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape);
78 79
79 public interface IClientAPI 80 public interface IClientAPI
80 { 81 {
@@ -94,7 +95,7 @@ namespace OpenSim.Framework.Interfaces
94 event GenericCall2 OnCompleteMovementToRegion; 95 event GenericCall2 OnCompleteMovementToRegion;
95 event UpdateAgent OnAgentUpdate; 96 event UpdateAgent OnAgentUpdate;
96 event GenericCall OnRequestAvatarsData; 97 event GenericCall OnRequestAvatarsData;
97 event GenericCall4 OnAddPrim; 98 event AddNewPrim OnAddPrim;
98 event ObjectDuplicate OnObjectDuplicate; 99 event ObjectDuplicate OnObjectDuplicate;
99 event UpdateVector OnGrapObject; 100 event UpdateVector OnGrapObject;
100 event ObjectSelect OnDeGrapObject; 101 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 @@
1using libsecondlife; 1using libsecondlife;
2using libsecondlife.Packets;
2 3
3namespace OpenSim.Framework.Types 4namespace OpenSim.Framework.Types
4{ 5{
@@ -97,6 +98,34 @@ namespace OpenSim.Framework.Types
97 98
98 return primShape; 99 return primShape;
99 } 100 }
100 }
101 101
102 public static PrimitiveBaseShape FromAddPacket(ObjectAddPacket addPacket)
103 {
104 PrimitiveBaseShape pShape = new PrimitiveBaseShape();
105
106 pShape.PCode = addPacket.ObjectData.PCode;
107 pShape.PathBegin = addPacket.ObjectData.PathBegin;
108 pShape.PathEnd = addPacket.ObjectData.PathEnd;
109 pShape.PathScaleX = addPacket.ObjectData.PathScaleX;
110 pShape.PathScaleY = addPacket.ObjectData.PathScaleY;
111 pShape.PathShearX = addPacket.ObjectData.PathShearX;
112 pShape.PathShearY = addPacket.ObjectData.PathShearY;
113 pShape.PathSkew = addPacket.ObjectData.PathSkew;
114 pShape.ProfileBegin = addPacket.ObjectData.ProfileBegin;
115 pShape.ProfileEnd = addPacket.ObjectData.ProfileEnd;
116 pShape.Scale = addPacket.ObjectData.Scale;
117 pShape.PathCurve = addPacket.ObjectData.PathCurve;
118 pShape.ProfileCurve = addPacket.ObjectData.ProfileCurve;
119 pShape.ProfileHollow = addPacket.ObjectData.ProfileHollow;
120 pShape.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
121 pShape.PathRevolutions = addPacket.ObjectData.PathRevolutions;
122 pShape.PathTaperX = addPacket.ObjectData.PathTaperX;
123 pShape.PathTaperY = addPacket.ObjectData.PathTaperY;
124 pShape.PathTwist = addPacket.ObjectData.PathTwist;
125 pShape.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
126 LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-9999-000000000005"));
127 pShape.TextureEntry = ntex.ToBytes();
128 return pShape;
129 }
130 }
102} 131}
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index b47d95a..2be5b0e 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ClientStack
58 public event ObjectSelect OnDeGrapObject; 58 public event ObjectSelect OnDeGrapObject;
59 public event ObjectDuplicate OnObjectDuplicate; 59 public event ObjectDuplicate OnObjectDuplicate;
60 public event MoveObject OnGrapUpdate; 60 public event MoveObject OnGrapUpdate;
61 public event GenericCall4 OnAddPrim; 61 public event AddNewPrim OnAddPrim;
62 public event UpdateShape OnUpdatePrimShape; 62 public event UpdateShape OnUpdatePrimShape;
63 public event ObjectSelect OnObjectSelect; 63 public event ObjectSelect OnObjectSelect;
64 public event GenericCall7 OnObjectDescription; 64 public event GenericCall7 OnObjectDescription;
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index df2bf34..013b755 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -217,7 +217,10 @@ namespace OpenSim.Region.ClientStack
217 case PacketType.ObjectAdd: 217 case PacketType.ObjectAdd:
218 if (OnAddPrim != null) 218 if (OnAddPrim != null)
219 { 219 {
220 OnAddPrim(Pack, this); 220 ObjectAddPacket packet = (ObjectAddPacket) Pack ;
221 PrimitiveBaseShape primShape = PrimitiveBaseShape.FromAddPacket( packet );
222
223 OnAddPrim(this.AgentId, packet.ObjectData.RayEnd, primShape );
221 } 224 }
222 break; 225 break;
223 case PacketType.ObjectShape: 226 case PacketType.ObjectShape:
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 }
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 87e877c..095ba1d 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -68,7 +68,7 @@ namespace SimpleApp
68 PrimData primData = new PrimData(); 68 PrimData primData = new PrimData();
69 primData.Scale = new LLVector3(1, 1, 1); 69 primData.Scale = new LLVector3(1, 1, 1);
70 70
71 m_localId = world.AddNewPrim( LLUUID.Zero, primData, LLVector3.Zero, new LLQuaternion(0, 0, 0, 0), LLUUID.Zero, 0); 71 //m_localId = world.AddNewPrim( LLUUID.Zero, primData, LLVector3.Zero, new LLQuaternion(0, 0, 0, 0), LLUUID.Zero, 0);
72 72
73 } 73 }
74 74