aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs169
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs3
2 files changed, 88 insertions, 84 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index ce75e3a..e82c38c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -173,7 +173,7 @@ namespace OpenSim.Region.Environment.Scenes
173 set { m_rootPart.OwnerID = value; } 173 set { m_rootPart.OwnerID = value; }
174 } 174 }
175 175
176 public Color Color 176 public Color Color
177 { 177 {
178 get { return m_rootPart.Color; } 178 get { return m_rootPart.Color; }
179 set { m_rootPart.Color = value; } 179 set { m_rootPart.Color = value; }
@@ -228,26 +228,28 @@ namespace OpenSim.Region.Environment.Scenes
228 public SceneObjectGroup() 228 public SceneObjectGroup()
229 { 229 {
230 } 230 }
231 231
232 /// <summary> 232 /// <summary>
233 /// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart. 233 /// This constructor creates a SceneObjectGroup using a pre-existing SceneObjectPart.
234 /// The original SceneObjectPart will be used rather than a copy, preserving 234 /// The original SceneObjectPart will be used rather than a copy, preserving
235 /// its existing localID and UUID. 235 /// its existing localID and UUID.
236 /// </summary> 236 /// </summary>
237 public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part) 237 public SceneObjectGroup(Scene scene, ulong regionHandle, SceneObjectPart part)
238 { 238 {
239 m_scene = scene; 239 m_scene = scene;
240 m_regionHandle = regionHandle; 240 m_regionHandle = regionHandle;
241 241
242 part.SetParent(this); 242 part.SetParent(this);
243 part.ParentID = 0; 243 part.ParentID = 0;
244 244
245 m_parts.Add(part.UUID, part); 245 m_parts.Add(part.UUID, part);
246 SetPartAsRoot(part); 246 SetPartAsRoot(part);
247 247
248 AttachToBackup(); 248 AttachToBackup();
249 249
250 ScheduleGroupForFullUpdate(); 250 ApplyPhysics();
251
252 ScheduleGroupForFullUpdate();
251 } 253 }
252 254
253 /// <summary> 255 /// <summary>
@@ -281,7 +283,6 @@ namespace OpenSim.Region.Environment.Scenes
281 part.RegionHandle = m_regionHandle; 283 part.RegionHandle = m_regionHandle;
282 284
283 part.ApplyPermissions(); 285 part.ApplyPermissions();
284 part.ApplyPhysics();
285 } 286 }
286 break; 287 break;
287 case XmlNodeType.EndElement: 288 case XmlNodeType.EndElement:
@@ -291,7 +292,7 @@ namespace OpenSim.Region.Environment.Scenes
291 reader.Close(); 292 reader.Close();
292 sr.Close(); 293 sr.Close();
293 294
294 AddPart( m_rootPart ); 295 AddPart(m_rootPart);
295 296
296 m_rootPart.LocalID = m_scene.PrimIDAllocate(); 297 m_rootPart.LocalID = m_scene.PrimIDAllocate();
297 m_rootPart.ParentID = 0; 298 m_rootPart.ParentID = 0;
@@ -300,6 +301,8 @@ namespace OpenSim.Region.Environment.Scenes
300 301
301 AttachToBackup(); 302 AttachToBackup();
302 303
304 ApplyPhysics();
305
303 ScheduleGroupForFullUpdate(); 306 ScheduleGroupForFullUpdate();
304 } 307 }
305 308
@@ -369,25 +372,27 @@ namespace OpenSim.Region.Environment.Scenes
369 372
370 foreach (SceneObjectPart part in m_parts.Values) 373 foreach (SceneObjectPart part in m_parts.Values)
371 { 374 {
372 375
373 Vector3 partPosition = new Vector3(part.AbsolutePosition.X,part.AbsolutePosition.Y,part.AbsolutePosition.Z); 376 Vector3 partPosition = new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z);
374 Quaternion parentrotation = new Quaternion(GroupRotation.W,GroupRotation.X,GroupRotation.Y,GroupRotation.Z); 377 Quaternion parentrotation = new Quaternion(GroupRotation.W, GroupRotation.X, GroupRotation.Y, GroupRotation.Z);
375 378
376 // Telling the prim to raytrace. 379 // Telling the prim to raytrace.
377 EntityIntersection inter = part.TestIntersection(hRay,parentrotation); 380 EntityIntersection inter = part.TestIntersection(hRay, parentrotation);
378 381
379 // This may need to be updated to the maximum draw distance possible.. 382 // This may need to be updated to the maximum draw distance possible..
380 // We might (and probably will) be checking for prim creation from other sims 383 // We might (and probably will) be checking for prim creation from other sims
381 // when the camera crosses the border. 384 // when the camera crosses the border.
382 float idist = 256f; 385 float idist = 256f;
383
384 386
385 387
386 388
387 if (inter.HitTF) { 389
390 if (inter.HitTF)
391 {
388 // We need to find the closest prim to return to the testcaller along the ray 392 // We need to find the closest prim to return to the testcaller along the ray
389 if (inter.distance < idist) { 393 if (inter.distance < idist)
390 394 {
395
391 idist = inter.distance; 396 idist = inter.distance;
392 returnresult.HitTF = true; 397 returnresult.HitTF = true;
393 returnresult.ipoint = inter.ipoint; 398 returnresult.ipoint = inter.ipoint;
@@ -396,13 +401,13 @@ namespace OpenSim.Region.Environment.Scenes
396 returnresult.distance = inter.distance; 401 returnresult.distance = inter.distance;
397 } 402 }
398 } 403 }
399 404
400 405
401 } 406 }
402 return returnresult; 407 return returnresult;
403 408
404 } 409 }
405 410
406 411
407 412
408 /// <summary> 413 /// <summary>
@@ -429,6 +434,8 @@ namespace OpenSim.Region.Environment.Scenes
429 SetPartAsRoot(newPart); 434 SetPartAsRoot(newPart);
430 435
431 AttachToBackup(); 436 AttachToBackup();
437
438 ApplyPhysics();
432 } 439 }
433 440
434 /// <summary> 441 /// <summary>
@@ -512,7 +519,7 @@ namespace OpenSim.Region.Environment.Scenes
512 /// <returns></returns> 519 /// <returns></returns>
513 public SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID) 520 public SceneObjectGroup Copy(LLUUID cAgentID, LLUUID cGroupID)
514 { 521 {
515 SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone(); 522 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
516 dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>(); 523 dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>();
517 dupe.m_parts.Clear(); 524 dupe.m_parts.Clear();
518 //dupe.OwnerID = AgentID; 525 //dupe.OwnerID = AgentID;
@@ -520,7 +527,7 @@ namespace OpenSim.Region.Environment.Scenes
520 dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); 527 dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
521 dupe.m_scene = m_scene; 528 dupe.m_scene = m_scene;
522 dupe.m_regionHandle = m_regionHandle; 529 dupe.m_regionHandle = m_regionHandle;
523 530
524 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID); 531 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID);
525 532
526 533
@@ -539,7 +546,7 @@ namespace OpenSim.Region.Environment.Scenes
539 dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z), 546 dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z),
540 dupe.RootPart.PhysActor.IsPhysical); 547 dupe.RootPart.PhysActor.IsPhysical);
541 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); 548 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
542 549
543 } 550 }
544 // Now we've made a copy that replaces this one, we need to 551 // Now we've made a copy that replaces this one, we need to
545 // switch the owner to the person who did the copying 552 // switch the owner to the person who did the copying
@@ -554,7 +561,7 @@ namespace OpenSim.Region.Environment.Scenes
554 { 561 {
555 if (part.UUID != m_rootPart.UUID) 562 if (part.UUID != m_rootPart.UUID)
556 { 563 {
557 dupe.CopyPart(part,OwnerID, GroupID); 564 dupe.CopyPart(part, OwnerID, GroupID);
558 SetPartOwner(part, cAgentID, cGroupID); 565 SetPartOwner(part, cAgentID, cGroupID);
559 part.ScheduleFullUpdate(); 566 part.ScheduleFullUpdate();
560 567
@@ -579,7 +586,8 @@ namespace OpenSim.Region.Environment.Scenes
579 m_parts.Add(newPart.UUID, newPart); 586 m_parts.Add(newPart.UUID, newPart);
580 SetPartAsRoot(newPart); 587 SetPartAsRoot(newPart);
581 } 588 }
582 public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID) { 589 public void SetRootPartOwner(SceneObjectPart part, LLUUID cAgentID, LLUUID cGroupID)
590 {
583 part.LastOwnerID = part.OwnerID; 591 part.LastOwnerID = part.OwnerID;
584 part.OwnerID = cAgentID; 592 part.OwnerID = cAgentID;
585 part.GroupID = cGroupID; 593 part.GroupID = cGroupID;
@@ -613,7 +621,7 @@ namespace OpenSim.Region.Environment.Scenes
613 /// 621 ///
614 /// </summary> 622 /// </summary>
615 /// <param name="part"></param> 623 /// <param name="part"></param>
616 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient,LLUUID AgentID, uint RequestFlags) 624 public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags)
617 { 625 {
618 //RootPart.ServiceObjectPropertiesFamilyRequest(remoteClient, AgentID, RequestFlags); 626 //RootPart.ServiceObjectPropertiesFamilyRequest(remoteClient, AgentID, RequestFlags);
619 ObjectPropertiesFamilyPacket objPropFamilyPack = new ObjectPropertiesFamilyPacket(); 627 ObjectPropertiesFamilyPacket objPropFamilyPack = new ObjectPropertiesFamilyPacket();
@@ -627,7 +635,7 @@ namespace OpenSim.Region.Environment.Scenes
627 objPropDB.GroupMask = RootPart.GroupMask; 635 objPropDB.GroupMask = RootPart.GroupMask;
628 objPropDB.EveryoneMask = RootPart.EveryoneMask; 636 objPropDB.EveryoneMask = RootPart.EveryoneMask;
629 objPropDB.NextOwnerMask = RootPart.NextOwnerMask; 637 objPropDB.NextOwnerMask = RootPart.NextOwnerMask;
630 638
631 // TODO: More properties are needed in SceneObjectPart! 639 // TODO: More properties are needed in SceneObjectPart!
632 objPropDB.OwnershipCost = RootPart.OwnershipCost; 640 objPropDB.OwnershipCost = RootPart.OwnershipCost;
633 objPropDB.SaleType = RootPart.ObjectSaleType; 641 objPropDB.SaleType = RootPart.ObjectSaleType;
@@ -839,12 +847,12 @@ namespace OpenSim.Region.Environment.Scenes
839 Quaternion parentRot = 847 Quaternion parentRot =
840 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, 848 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
841 m_rootPart.RotationOffset.Z); 849 m_rootPart.RotationOffset.Z);
842 axPos = parentRot.Inverse()*axPos; 850 axPos = parentRot.Inverse() * axPos;
843 linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); 851 linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
844 Quaternion oldRot = 852 Quaternion oldRot =
845 new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y, 853 new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y,
846 linkPart.RotationOffset.Z); 854 linkPart.RotationOffset.Z);
847 Quaternion newRot = parentRot.Inverse()*oldRot; 855 Quaternion newRot = parentRot.Inverse() * oldRot;
848 linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); 856 linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
849 linkPart.ParentID = m_rootPart.LocalID; 857 linkPart.ParentID = m_rootPart.LocalID;
850 m_parts.Add(linkPart.UUID, linkPart); 858 m_parts.Add(linkPart.UUID, linkPart);
@@ -873,50 +881,50 @@ namespace OpenSim.Region.Environment.Scenes
873 objectGroup.DeleteParts(); 881 objectGroup.DeleteParts();
874 ScheduleGroupForFullUpdate(); 882 ScheduleGroupForFullUpdate();
875 } 883 }
876 884
877 /// <summary> 885 /// <summary>
878 /// Delink the given prim from this group. The delinked prim is established as 886 /// Delink the given prim from this group. The delinked prim is established as
879 /// an independent SceneObjectGroup. 887 /// an independent SceneObjectGroup.
880 /// </summary> 888 /// </summary>
881 /// <param name="partID"></param> 889 /// <param name="partID"></param>
882 public void DelinkFromGroup(uint partID) 890 public void DelinkFromGroup(uint partID)
883 { 891 {
884 SceneObjectPart linkPart = GetChildPart(partID); 892 SceneObjectPart linkPart = GetChildPart(partID);
885 893
886 if (null != linkPart) 894 if (null != linkPart)
887 { 895 {
888 // Remove the part from this object 896 // Remove the part from this object
889 m_parts.Remove(linkPart.UUID); 897 m_parts.Remove(linkPart.UUID);
890 898
891 // We need to reset the child part's position 899 // We need to reset the child part's position
892 // ready for life as a separate object after being a part of another object 900 // ready for life as a separate object after being a part of another object
893 Quaternion parentRot 901 Quaternion parentRot
894 = new Quaternion( 902 = new Quaternion(
895 m_rootPart.RotationOffset.W, 903 m_rootPart.RotationOffset.W,
896 m_rootPart.RotationOffset.X, 904 m_rootPart.RotationOffset.X,
897 m_rootPart.RotationOffset.Y, 905 m_rootPart.RotationOffset.Y,
898 m_rootPart.RotationOffset.Z); 906 m_rootPart.RotationOffset.Z);
899 907
900 Vector3 axPos 908 Vector3 axPos
901 = new Vector3( 909 = new Vector3(
902 linkPart.OffsetPosition.X, 910 linkPart.OffsetPosition.X,
903 linkPart.OffsetPosition.Y, 911 linkPart.OffsetPosition.Y,
904 linkPart.OffsetPosition.Z); 912 linkPart.OffsetPosition.Z);
905 913
906 axPos = parentRot * axPos; 914 axPos = parentRot * axPos;
907 linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); 915 linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
908 linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition; 916 linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition;
909 linkPart.OffsetPosition = new LLVector3(0, 0, 0); 917 linkPart.OffsetPosition = new LLVector3(0, 0, 0);
910 918
911 Quaternion oldRot 919 Quaternion oldRot
912 = new Quaternion( 920 = new Quaternion(
913 linkPart.RotationOffset.W, 921 linkPart.RotationOffset.W,
914 linkPart.RotationOffset.X, 922 linkPart.RotationOffset.X,
915 linkPart.RotationOffset.Y, 923 linkPart.RotationOffset.Y,
916 linkPart.RotationOffset.Z); 924 linkPart.RotationOffset.Z);
917 Quaternion newRot = parentRot * oldRot; 925 Quaternion newRot = parentRot * oldRot;
918 linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); 926 linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
919 927
920 // Add physics information back to delinked part if appropriate 928 // Add physics information back to delinked part if appropriate
921 // XXX This is messy and should be refactorable with the similar section in 929 // XXX This is messy and should be refactorable with the similar section in
922 // SceneObjectPart.UpdatePrimFlags() 930 // SceneObjectPart.UpdatePrimFlags()
@@ -932,13 +940,13 @@ namespace OpenSim.Region.Environment.Scenes
932 linkPart.RotationOffset.Y, linkPart.RotationOffset.Z), 940 linkPart.RotationOffset.Y, linkPart.RotationOffset.Z),
933 m_rootPart.PhysActor.IsPhysical); 941 m_rootPart.PhysActor.IsPhysical);
934 m_rootPart.DoPhysicsPropertyUpdate(m_rootPart.PhysActor.IsPhysical, true); 942 m_rootPart.DoPhysicsPropertyUpdate(m_rootPart.PhysActor.IsPhysical, true);
935 943
936 } 944 }
937 945
938 SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart); 946 SceneObjectGroup objectGroup = new SceneObjectGroup(m_scene, m_regionHandle, linkPart);
939 947
940 m_scene.AddEntity(objectGroup); 948 m_scene.AddEntity(objectGroup);
941 949
942 ScheduleGroupForFullUpdate(); 950 ScheduleGroupForFullUpdate();
943 } 951 }
944 else 952 else
@@ -946,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
946 OpenSim.Framework.Console.MainLog.Instance.Verbose("SCENE", 954 OpenSim.Framework.Console.MainLog.Instance.Verbose("SCENE",
947 "DelinkFromGroup(): Child prim local id {0} not found in object with root prim id {1}", 955 "DelinkFromGroup(): Child prim local id {0} not found in object with root prim id {1}",
948 partID, LocalId); 956 partID, LocalId);
949 } 957 }
950 } 958 }
951 959
952 private void DetachFromBackup(SceneObjectGroup objectGroup) 960 private void DetachFromBackup(SceneObjectGroup objectGroup)
@@ -961,7 +969,7 @@ namespace OpenSim.Region.Environment.Scenes
961 m_parts.Add(part.UUID, part); 969 m_parts.Add(part.UUID, part);
962 970
963 Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z); 971 Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
964 axiomOldPos = oldGroupRotation*axiomOldPos; 972 axiomOldPos = oldGroupRotation * axiomOldPos;
965 axiomOldPos += oldGroupPosition; 973 axiomOldPos += oldGroupPosition;
966 LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z); 974 LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z);
967 part.OffsetPosition = oldAbsolutePosition - AbsolutePosition; 975 part.OffsetPosition = oldAbsolutePosition - AbsolutePosition;
@@ -971,15 +979,15 @@ namespace OpenSim.Region.Environment.Scenes
971 m_rootPart.RotationOffset.Z); 979 m_rootPart.RotationOffset.Z);
972 980
973 Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z); 981 Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
974 axiomPos = axiomRootRotation.Inverse()*axiomPos; 982 axiomPos = axiomRootRotation.Inverse() * axiomPos;
975 part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z); 983 part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z);
976 984
977 Quaternion axiomPartRotation = 985 Quaternion axiomPartRotation =
978 new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y, 986 new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y,
979 part.RotationOffset.Z); 987 part.RotationOffset.Z);
980 988
981 axiomPartRotation = oldGroupRotation*axiomPartRotation; 989 axiomPartRotation = oldGroupRotation * axiomPartRotation;
982 axiomPartRotation = axiomRootRotation.Inverse()*axiomPartRotation; 990 axiomPartRotation = axiomRootRotation.Inverse() * axiomPartRotation;
983 part.RotationOffset = 991 part.RotationOffset =
984 new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w); 992 new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
985 } 993 }
@@ -996,7 +1004,7 @@ namespace OpenSim.Region.Environment.Scenes
996 { 1004 {
997 AbsolutePosition = pos; 1005 AbsolutePosition = pos;
998 m_rootPart.SendTerseUpdateToAllClients(); 1006 m_rootPart.SendTerseUpdateToAllClients();
999 } 1007 }
1000 } 1008 }
1001 1009
1002 /// <summary> 1010 /// <summary>
@@ -1009,12 +1017,12 @@ namespace OpenSim.Region.Environment.Scenes
1009 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1]; 1017 proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
1010 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock(); 1018 proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
1011 proper.ObjectData[0].ItemID = LLUUID.Zero; 1019 proper.ObjectData[0].ItemID = LLUUID.Zero;
1012 proper.ObjectData[0].CreationDate = (ulong) m_rootPart.CreationDate; 1020 proper.ObjectData[0].CreationDate = (ulong)m_rootPart.CreationDate;
1013 proper.ObjectData[0].CreatorID = m_rootPart.CreatorID; 1021 proper.ObjectData[0].CreatorID = m_rootPart.CreatorID;
1014 proper.ObjectData[0].FolderID = LLUUID.Zero; 1022 proper.ObjectData[0].FolderID = LLUUID.Zero;
1015 proper.ObjectData[0].FromTaskID = LLUUID.Zero; 1023 proper.ObjectData[0].FromTaskID = LLUUID.Zero;
1016 proper.ObjectData[0].GroupID = LLUUID.Zero; 1024 proper.ObjectData[0].GroupID = LLUUID.Zero;
1017 proper.ObjectData[0].InventorySerial = (short) m_rootPart.InventorySerial; 1025 proper.ObjectData[0].InventorySerial = (short)m_rootPart.InventorySerial;
1018 proper.ObjectData[0].LastOwnerID = m_rootPart.LastOwnerID; 1026 proper.ObjectData[0].LastOwnerID = m_rootPart.LastOwnerID;
1019 proper.ObjectData[0].ObjectID = UUID; 1027 proper.ObjectData[0].ObjectID = UUID;
1020 proper.ObjectData[0].OwnerID = m_rootPart.OwnerID; 1028 proper.ObjectData[0].OwnerID = m_rootPart.OwnerID;
@@ -1244,7 +1252,7 @@ namespace OpenSim.Region.Environment.Scenes
1244 m_rootPart.PhysActor.IsPhysical); 1252 m_rootPart.PhysActor.IsPhysical);
1245 bool UsePhysics = ((m_rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0); 1253 bool UsePhysics = ((m_rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0);
1246 m_rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); 1254 m_rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
1247 1255
1248 } 1256 }
1249 } 1257 }
1250 1258
@@ -1329,7 +1337,7 @@ namespace OpenSim.Region.Environment.Scenes
1329 Quaternion partRotation = 1337 Quaternion partRotation =
1330 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, 1338 new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
1331 m_rootPart.RotationOffset.Z); 1339 m_rootPart.RotationOffset.Z);
1332 axDiff = partRotation.Inverse()*axDiff; 1340 axDiff = partRotation.Inverse() * axDiff;
1333 diff.X = axDiff.x; 1341 diff.X = axDiff.x;
1334 diff.Y = axDiff.y; 1342 diff.Y = axDiff.y;
1335 diff.Z = axDiff.z; 1343 diff.Z = axDiff.z;
@@ -1431,14 +1439,14 @@ namespace OpenSim.Region.Environment.Scenes
1431 if (prim.UUID != m_rootPart.UUID) 1439 if (prim.UUID != m_rootPart.UUID)
1432 { 1440 {
1433 Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z); 1441 Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z);
1434 axPos = oldParentRot*axPos; 1442 axPos = oldParentRot * axPos;
1435 axPos = axRot.Inverse()*axPos; 1443 axPos = axRot.Inverse() * axPos;
1436 prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z); 1444 prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
1437 Quaternion primsRot = 1445 Quaternion primsRot =
1438 new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y, 1446 new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y,
1439 prim.RotationOffset.Z); 1447 prim.RotationOffset.Z);
1440 Quaternion newRot = oldParentRot*primsRot; 1448 Quaternion newRot = oldParentRot * primsRot;
1441 newRot = axRot.Inverse()*newRot; 1449 newRot = axRot.Inverse() * newRot;
1442 prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w); 1450 prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
1443 prim.ScheduleTerseUpdate(); 1451 prim.ScheduleTerseUpdate();
1444 } 1452 }
@@ -1515,7 +1523,7 @@ namespace OpenSim.Region.Environment.Scenes
1515 } 1523 }
1516 } 1524 }
1517 } 1525 }
1518 1526
1519 /// <summary> 1527 /// <summary>
1520 /// 1528 ///
1521 /// </summary> 1529 /// </summary>
@@ -1656,7 +1664,7 @@ namespace OpenSim.Region.Environment.Scenes
1656 { 1664 {
1657 avatars[i].StandUp(); 1665 avatars[i].StandUp();
1658 } 1666 }
1659 1667
1660 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalID); 1668 avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalID);
1661 } 1669 }
1662 } 1670 }
@@ -1670,19 +1678,16 @@ namespace OpenSim.Region.Environment.Scenes
1670 1678
1671 public override void SetText(string text, Vector3 color, double alpha) 1679 public override void SetText(string text, Vector3 color, double alpha)
1672 { 1680 {
1673 Color = Color.FromArgb (0xff - (int)(alpha * 0xff), 1681 Color = Color.FromArgb(0xff - (int)(alpha * 0xff),
1674 (int)(color.x * 0xff), 1682 (int)(color.x * 0xff),
1675 (int)(color.y * 0xff), 1683 (int)(color.y * 0xff),
1676 (int)(color.z * 0xff)); 1684 (int)(color.z * 0xff));
1677 Text = text; 1685 Text = text;
1678 } 1686 }
1679 1687
1680 public void ApplyPhysics() 1688 public void ApplyPhysics()
1681 { 1689 {
1682 foreach(SceneObjectPart part in m_parts.Values ) 1690 m_rootPart.ApplyPhysics();
1683 {
1684 part.ApplyPhysics();
1685 }
1686 } 1691 }
1687 } 1692 }
1688} 1693}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 5c1b9da..a60e3b5 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -473,7 +473,6 @@ namespace OpenSim.Region.Environment.Scenes
473 LLObject.ObjectFlags.ObjectOwnerModify; 473 LLObject.ObjectFlags.ObjectOwnerModify;
474 474
475 ApplyPermissions(); 475 ApplyPermissions();
476 ApplyPhysics();
477 476
478 ScheduleFullUpdate(); 477 ScheduleFullUpdate();
479 } 478 }
@@ -512,7 +511,7 @@ namespace OpenSim.Region.Environment.Scenes
512 ObjectFlags = flags; 511 ObjectFlags = flags;
513 512
514 ApplyPermissions(); 513 ApplyPermissions();
515 ApplyPhysics(); 514 // ApplyPhysics();
516 515
517 ScheduleFullUpdate(); 516 ScheduleFullUpdate();
518 } 517 }