aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorCharles Krinke2007-11-01 03:56:54 +0000
committerCharles Krinke2007-11-01 03:56:54 +0000
commit8af272b3abdb4ecc64fa7cf46ef0205e4398f01c (patch)
tree4100dee3fdad35cce23ce4cb645fa443bf7c90da /OpenSim/Region
parentThank you Melanie for a patch to SceneObjectPart.cs so that on first transmis... (diff)
downloadopensim-SC-8af272b3abdb4ecc64fa7cf46ef0205e4398f01c.zip
opensim-SC-8af272b3abdb4ecc64fa7cf46ef0205e4398f01c.tar.gz
opensim-SC-8af272b3abdb4ecc64fa7cf46ef0205e4398f01c.tar.bz2
opensim-SC-8af272b3abdb4ecc64fa7cf46ef0205e4398f01c.tar.xz
Thank you, Melanie for solving: When receiving an ObjectAdd packet, the Rotation member is silently ignored and the prim is created with 0,0,0,1 rotation. The patch introduces a fix that passes the Rotation parameter from the packet to the object and uses it in the actual object creation.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs14
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs9
4 files changed, 22 insertions, 9 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 3b996d5..1e14587 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -243,7 +243,7 @@ namespace OpenSim.Region.ClientStack
243 { 243 {
244 ObjectAddPacket addPacket = (ObjectAddPacket) Pack; 244 ObjectAddPacket addPacket = (ObjectAddPacket) Pack;
245 PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); 245 PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket);
246 OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, shape); 246 OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape);
247 } 247 }
248 break; 248 break;
249 case PacketType.ObjectShape: 249 case PacketType.ObjectShape:
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index e37ad59..8da22c4 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -568,12 +568,12 @@ namespace OpenSim.Region.Environment.Scenes
568 /// </summary> 568 /// </summary>
569 /// <param name="addPacket"></param> 569 /// <param name="addPacket"></param>
570 /// <param name="ownerID"></param> 570 /// <param name="ownerID"></param>
571 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape) 571 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape)
572 { 572 {
573 if (PermissionsMngr.CanRezObject(ownerID, pos)) 573 if (PermissionsMngr.CanRezObject(ownerID, pos))
574 { 574 {
575 SceneObjectGroup sceneOb = 575 SceneObjectGroup sceneOb =
576 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); 576 new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, rot, shape);
577 AddEntity(sceneOb); 577 AddEntity(sceneOb);
578 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); 578 SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
579 // if grass or tree, make phantom 579 // if grass or tree, make phantom
@@ -1565,4 +1565,4 @@ namespace OpenSim.Region.Environment.Scenes
1565 } 1565 }
1566 } 1566 }
1567 } 1567 }
1568} \ No newline at end of file 1568}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 2f86d2f..aaa25e7 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Scenes
322 /// 322 ///
323 /// </summary> 323 /// </summary>
324 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 324 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
325 PrimitiveBaseShape shape) 325 LLQuaternion rot, PrimitiveBaseShape shape)
326 { 326 {
327 m_regionHandle = regionHandle; 327 m_regionHandle = regionHandle;
328 m_scene = scene; 328 m_scene = scene;
@@ -330,13 +330,21 @@ namespace OpenSim.Region.Environment.Scenes
330 // this.Pos = pos; 330 // this.Pos = pos;
331 LLVector3 rootOffset = new LLVector3(0, 0, 0); 331 LLVector3 rootOffset = new LLVector3(0, 0, 0);
332 SceneObjectPart newPart = 332 SceneObjectPart newPart =
333 new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset); 333 new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rot, rootOffset);
334 m_parts.Add(newPart.UUID, newPart); 334 m_parts.Add(newPart.UUID, newPart);
335 SetPartAsRoot(newPart); 335 SetPartAsRoot(newPart);
336 336
337 AttachToBackup(); 337 AttachToBackup();
338 } 338 }
339 339
340 /// <summary>
341 ///
342 /// </summary>
343 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
344 PrimitiveBaseShape shape):this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape)
345 {
346 }
347
340 #endregion 348 #endregion
341 349
342 public string ToXmlString() 350 public string ToXmlString()
@@ -1386,4 +1394,4 @@ namespace OpenSim.Region.Environment.Scenes
1386 Text = text; 1394 Text = text;
1387 } 1395 }
1388 } 1396 }
1389} \ No newline at end of file 1397}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 80723fa..dacac4b 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -271,6 +271,11 @@ namespace OpenSim.Region.Environment.Scenes
271 { 271 {
272 } 272 }
273 273
274 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID,
275 PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition):this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition)
276 {
277 }
278
274 /// <summary> 279 /// <summary>
275 /// Create a completely new SceneObjectPart (prim) 280 /// Create a completely new SceneObjectPart (prim)
276 /// </summary> 281 /// </summary>
@@ -281,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes
281 /// <param name="shape"></param> 286 /// <param name="shape"></param>
282 /// <param name="position"></param> 287 /// <param name="position"></param>
283 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, 288 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID,
284 PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) 289 PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset, LLVector3 offsetPosition)
285 { 290 {
286 m_name = "Primitive"; 291 m_name = "Primitive";
287 m_regionHandle = regionHandle; 292 m_regionHandle = regionHandle;
@@ -297,7 +302,7 @@ namespace OpenSim.Region.Environment.Scenes
297 302
298 GroupPosition = groupPosition; 303 GroupPosition = groupPosition;
299 OffsetPosition = offsetPosition; 304 OffsetPosition = offsetPosition;
300 RotationOffset = LLQuaternion.Identity; 305 RotationOffset = rotationOffset;
301 Velocity = new LLVector3(0, 0, 0); 306 Velocity = new LLVector3(0, 0, 0);
302 AngularVelocity = new LLVector3(0, 0, 0); 307 AngularVelocity = new LLVector3(0, 0, 0);
303 Acceleration = new LLVector3(0, 0, 0); 308 Acceleration = new LLVector3(0, 0, 0);