diff options
author | Justin Clark-Casey (justincc) | 2011-11-11 19:40:31 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-11 19:40:31 +0000 |
commit | 8f4955f6a94c09209cd76ee8141ed3c9b9753bc2 (patch) | |
tree | 00868b46e74b8b43261964eb8a0e3b65b6b84781 /OpenSim/Region/Framework | |
parent | Add new ScenePresenceSitTests with a single sit/stand test (diff) | |
parent | one more jenkins test! (diff) | |
download | opensim-SC_OLD-8f4955f6a94c09209cd76ee8141ed3c9b9753bc2.zip opensim-SC_OLD-8f4955f6a94c09209cd76ee8141ed3c9b9753bc2.tar.gz opensim-SC_OLD-8f4955f6a94c09209cd76ee8141ed3c9b9753bc2.tar.bz2 opensim-SC_OLD-8f4955f6a94c09209cd76ee8141ed3c9b9753bc2.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
5 files changed, 283 insertions, 274 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 05cdf61..4cf854e 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -180,12 +180,17 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
180 | bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); | 180 | bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); |
181 | bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); | 181 | bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); |
182 | bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); | 182 | bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); |
183 | //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; | 183 | bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; |
184 | //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; | 184 | bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; |
185 | bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; | 185 | bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; |
186 | bool heldDown = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; | 186 | bool heldDown = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; |
187 | //bool flying = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) == AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 187 | //bool flying = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) == AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
188 | //bool mouselook = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) == AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK; | 188 | //bool mouselook = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) == AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK; |
189 | if (heldForward || heldBack || heldLeft || heldRight || heldUp || heldDown) | ||
190 | { | ||
191 | heldTurnLeft = false; | ||
192 | heldTurnRight = false; | ||
193 | } | ||
189 | 194 | ||
190 | // Direction in which the avatar is trying to move | 195 | // Direction in which the avatar is trying to move |
191 | Vector3 move = Vector3.Zero; | 196 | Vector3 move = Vector3.Zero; |
@@ -363,10 +368,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
363 | // Not walking | 368 | // Not walking |
364 | if (move.Z < 0) | 369 | if (move.Z < 0) |
365 | return "CROUCH"; | 370 | return "CROUCH"; |
366 | // else if (heldTurnLeft) | 371 | else if (heldTurnLeft) |
367 | // return "TURNLEFT"; | 372 | return "TURNLEFT"; |
368 | // else if (heldTurnRight) | 373 | else if (heldTurnRight) |
369 | // return "TURNRIGHT"; | 374 | return "TURNRIGHT"; |
370 | else | 375 | else |
371 | return "STAND"; | 376 | return "STAND"; |
372 | } | 377 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index b2e5dc3..af95c28 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1661,11 +1661,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1661 | /// <param name="childPrims"></param> | 1661 | /// <param name="childPrims"></param> |
1662 | protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) | 1662 | protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children) |
1663 | { | 1663 | { |
1664 | SceneObjectGroup parentGroup = root.ParentGroup; | ||
1665 | if (parentGroup == null) return; | ||
1666 | |||
1667 | // Cowardly refuse to link to a group owned root | ||
1668 | if (parentGroup.OwnerID == parentGroup.GroupID) | ||
1669 | return; | ||
1670 | |||
1664 | Monitor.Enter(m_updateLock); | 1671 | Monitor.Enter(m_updateLock); |
1665 | try | 1672 | try |
1666 | { | 1673 | { |
1667 | SceneObjectGroup parentGroup = root.ParentGroup; | ||
1668 | |||
1669 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); | 1674 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); |
1670 | 1675 | ||
1671 | // We do this in reverse to get the link order of the prims correct | 1676 | // We do this in reverse to get the link order of the prims correct |
@@ -1683,11 +1688,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1683 | 1688 | ||
1684 | foreach (SceneObjectGroup child in childGroups) | 1689 | foreach (SceneObjectGroup child in childGroups) |
1685 | { | 1690 | { |
1686 | parentGroup.LinkToGroup(child); | 1691 | if (parentGroup.OwnerID == child.OwnerID) |
1692 | { | ||
1693 | parentGroup.LinkToGroup(child); | ||
1687 | 1694 | ||
1688 | // this is here so physics gets updated! | 1695 | // this is here so physics gets updated! |
1689 | // Don't remove! Bad juju! Stay away! or fix physics! | 1696 | // Don't remove! Bad juju! Stay away! or fix physics! |
1690 | child.AbsolutePosition = child.AbsolutePosition; | 1697 | child.AbsolutePosition = child.AbsolutePosition; |
1698 | } | ||
1691 | } | 1699 | } |
1692 | 1700 | ||
1693 | // We need to explicitly resend the newly link prim's object properties since no other actions | 1701 | // We need to explicitly resend the newly link prim's object properties since no other actions |
@@ -1725,9 +1733,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1725 | if (part.ParentGroup.PrimCount != 1) // Skip single | 1733 | if (part.ParentGroup.PrimCount != 1) // Skip single |
1726 | { | 1734 | { |
1727 | if (part.LinkNum < 2) // Root | 1735 | if (part.LinkNum < 2) // Root |
1736 | { | ||
1728 | rootParts.Add(part); | 1737 | rootParts.Add(part); |
1738 | } | ||
1729 | else | 1739 | else |
1740 | { | ||
1741 | part.LastOwnerID = part.ParentGroup.RootPart.LastOwnerID; | ||
1730 | childParts.Add(part); | 1742 | childParts.Add(part); |
1743 | } | ||
1731 | 1744 | ||
1732 | SceneObjectGroup group = part.ParentGroup; | 1745 | SceneObjectGroup group = part.ParentGroup; |
1733 | if (!affectedGroups.Contains(group)) | 1746 | if (!affectedGroups.Contains(group)) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3fa6bb0..4355394 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1873,7 +1873,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1873 | } | 1873 | } |
1874 | 1874 | ||
1875 | /// <summary> | 1875 | /// <summary> |
1876 | /// Send metadata about the root prim (name, description, sale price, etc.) to a client. | 1876 | /// Send metadata about the root prim (name, description, sale price, permissions, etc.) to a client. |
1877 | /// </summary> | 1877 | /// </summary> |
1878 | /// <param name="client"></param> | 1878 | /// <param name="client"></param> |
1879 | public void SendPropertiesToClient(IClientAPI client) | 1879 | public void SendPropertiesToClient(IClientAPI client) |
@@ -2481,6 +2481,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2481 | parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF); | 2481 | parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF); |
2482 | 2482 | ||
2483 | HasGroupChanged = true; | 2483 | HasGroupChanged = true; |
2484 | |||
2485 | // Send the group's properties to all clients once all parts are updated | ||
2486 | IClientAPI client; | ||
2487 | if (Scene.TryGetClient(AgentID, out client)) | ||
2488 | SendPropertiesToClient(client); | ||
2484 | } | 2489 | } |
2485 | 2490 | ||
2486 | #endregion | 2491 | #endregion |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4071159..4e1383c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -257,7 +257,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
257 | private string m_touchName = String.Empty; | 257 | private string m_touchName = String.Empty; |
258 | private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5); | 258 | private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5); |
259 | private readonly Stack<UndoState> m_redo = new Stack<UndoState>(5); | 259 | private readonly Stack<UndoState> m_redo = new Stack<UndoState>(5); |
260 | private UUID _creatorID; | ||
261 | 260 | ||
262 | private bool m_passTouches; | 261 | private bool m_passTouches; |
263 | 262 | ||
@@ -343,19 +342,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
343 | m_name = "Primitive"; | 342 | m_name = "Primitive"; |
344 | 343 | ||
345 | Rezzed = DateTime.UtcNow; | 344 | Rezzed = DateTime.UtcNow; |
346 | _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); | 345 | CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed); |
347 | _ownerID = ownerID; | 346 | LastOwnerID = CreatorID = OwnerID = ownerID; |
348 | _creatorID = _ownerID; | ||
349 | _lastOwnerID = UUID.Zero; | ||
350 | UUID = UUID.Random(); | 347 | UUID = UUID.Random(); |
351 | Shape = shape; | 348 | Shape = shape; |
352 | // Todo: Add More Object Parameter from above! | 349 | OwnershipCost = 0; |
353 | _ownershipCost = 0; | 350 | ObjectSaleType = 0; |
354 | _objectSaleType = 0; | 351 | SalePrice = 0; |
355 | _salePrice = 0; | 352 | Category = 0; |
356 | _category = 0; | ||
357 | _lastOwnerID = _creatorID; | ||
358 | // End Todo: /// | ||
359 | GroupPosition = groupPosition; | 353 | GroupPosition = groupPosition; |
360 | OffsetPosition = offsetPosition; | 354 | OffsetPosition = offsetPosition; |
361 | RotationOffset = rotationOffset; | 355 | RotationOffset = rotationOffset; |
@@ -400,20 +394,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
400 | private DateTime m_expires; | 394 | private DateTime m_expires; |
401 | private DateTime m_rezzed; | 395 | private DateTime m_rezzed; |
402 | private bool m_createSelected = false; | 396 | private bool m_createSelected = false; |
403 | private string m_creatorData = string.Empty; | ||
404 | 397 | ||
398 | private UUID _creatorID; | ||
405 | public UUID CreatorID | 399 | public UUID CreatorID |
406 | { | 400 | { |
407 | get | 401 | get { return _creatorID; } |
408 | { | 402 | set { _creatorID = value; } |
409 | return _creatorID; | ||
410 | } | ||
411 | set | ||
412 | { | ||
413 | _creatorID = value; | ||
414 | } | ||
415 | } | 403 | } |
416 | 404 | ||
405 | private string m_creatorData = string.Empty; | ||
417 | /// <summary> | 406 | /// <summary> |
418 | /// Data about the creator in the form profile_url;name | 407 | /// Data about the creator in the form profile_url;name |
419 | /// </summary> | 408 | /// </summary> |
@@ -432,16 +421,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
432 | { | 421 | { |
433 | get | 422 | get |
434 | { | 423 | { |
435 | if (m_creatorData != null && m_creatorData != string.Empty) | 424 | if (CreatorData != null && CreatorData != string.Empty) |
436 | return _creatorID.ToString() + ';' + m_creatorData; | 425 | return CreatorID.ToString() + ';' + CreatorData; |
437 | else | 426 | else |
438 | return _creatorID.ToString(); | 427 | return CreatorID.ToString(); |
439 | } | 428 | } |
440 | set | 429 | set |
441 | { | 430 | { |
442 | if ((value == null) || (value != null && value == string.Empty)) | 431 | if ((value == null) || (value != null && value == string.Empty)) |
443 | { | 432 | { |
444 | m_creatorData = string.Empty; | 433 | CreatorData = string.Empty; |
445 | return; | 434 | return; |
446 | } | 435 | } |
447 | 436 | ||
@@ -449,7 +438,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
449 | { | 438 | { |
450 | UUID uuid = UUID.Zero; | 439 | UUID uuid = UUID.Zero; |
451 | UUID.TryParse(value, out uuid); | 440 | UUID.TryParse(value, out uuid); |
452 | _creatorID = uuid; | 441 | CreatorID = uuid; |
453 | } | 442 | } |
454 | else // <uuid>[;<endpoint>[;name]] | 443 | else // <uuid>[;<endpoint>[;name]] |
455 | { | 444 | { |
@@ -459,14 +448,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
459 | { | 448 | { |
460 | UUID uuid = UUID.Zero; | 449 | UUID uuid = UUID.Zero; |
461 | UUID.TryParse(parts[0], out uuid); | 450 | UUID.TryParse(parts[0], out uuid); |
462 | _creatorID = uuid; | 451 | CreatorID = uuid; |
463 | } | 452 | } |
464 | if (parts.Length >= 2) | 453 | if (parts.Length >= 2) |
465 | m_creatorData = parts[1]; | 454 | CreatorData = parts[1]; |
466 | if (parts.Length >= 3) | 455 | if (parts.Length >= 3) |
467 | name = parts[2]; | 456 | name = parts[2]; |
468 | 457 | ||
469 | m_creatorData += ';' + name; | 458 | CreatorData += ';' + name; |
470 | 459 | ||
471 | } | 460 | } |
472 | } | 461 | } |
@@ -684,14 +673,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
684 | { | 673 | { |
685 | // If this is a linkset, we don't want the physics engine mucking up our group position here. | 674 | // If this is a linkset, we don't want the physics engine mucking up our group position here. |
686 | PhysicsActor actor = PhysActor; | 675 | PhysicsActor actor = PhysActor; |
687 | if (actor != null && _parentID == 0) | 676 | if (actor != null && ParentID == 0) |
688 | { | 677 | { |
689 | m_groupPosition = actor.Position; | 678 | m_groupPosition = actor.Position; |
690 | } | 679 | } |
691 | 680 | ||
692 | if (m_parentGroup.IsAttachment) | 681 | if (ParentGroup.IsAttachment) |
693 | { | 682 | { |
694 | ScenePresence sp = m_parentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); | 683 | ScenePresence sp = ParentGroup.Scene.GetScenePresence(ParentGroup.AttachedAvatar); |
695 | if (sp != null) | 684 | if (sp != null) |
696 | return sp.AbsolutePosition; | 685 | return sp.AbsolutePosition; |
697 | } | 686 | } |
@@ -708,7 +697,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
708 | try | 697 | try |
709 | { | 698 | { |
710 | // Root prim actually goes at Position | 699 | // Root prim actually goes at Position |
711 | if (_parentID == 0) | 700 | if (ParentID == 0) |
712 | { | 701 | { |
713 | actor.Position = value; | 702 | actor.Position = value; |
714 | } | 703 | } |
@@ -720,7 +709,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
720 | } | 709 | } |
721 | 710 | ||
722 | // Tell the physics engines that this prim changed. | 711 | // Tell the physics engines that this prim changed. |
723 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 712 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
724 | } | 713 | } |
725 | catch (Exception e) | 714 | catch (Exception e) |
726 | { | 715 | { |
@@ -729,10 +718,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
729 | } | 718 | } |
730 | 719 | ||
731 | // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too | 720 | // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too |
732 | if (m_sitTargetAvatar != UUID.Zero) | 721 | if (SitTargetAvatar != UUID.Zero) |
733 | { | 722 | { |
734 | ScenePresence avatar; | 723 | ScenePresence avatar; |
735 | if (m_parentGroup.Scene.TryGetScenePresence(m_sitTargetAvatar, out avatar)) | 724 | if (ParentGroup.Scene.TryGetScenePresence(SitTargetAvatar, out avatar)) |
736 | { | 725 | { |
737 | avatar.ParentPosition = GetWorldPosition(); | 726 | avatar.ParentPosition = GetWorldPosition(); |
738 | } | 727 | } |
@@ -751,14 +740,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
751 | if (ParentGroup != null && !ParentGroup.IsDeleted) | 740 | if (ParentGroup != null && !ParentGroup.IsDeleted) |
752 | { | 741 | { |
753 | PhysicsActor actor = PhysActor; | 742 | PhysicsActor actor = PhysActor; |
754 | if (_parentID != 0 && actor != null) | 743 | if (ParentID != 0 && actor != null) |
755 | { | 744 | { |
756 | actor.Position = GetWorldPosition(); | 745 | actor.Position = GetWorldPosition(); |
757 | actor.Orientation = GetWorldRotation(); | 746 | actor.Orientation = GetWorldRotation(); |
758 | 747 | ||
759 | // Tell the physics engines that this prim changed. | 748 | // Tell the physics engines that this prim changed. |
760 | if (m_parentGroup.Scene != null) | 749 | if (ParentGroup.Scene != null) |
761 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 750 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
762 | } | 751 | } |
763 | } | 752 | } |
764 | } | 753 | } |
@@ -770,7 +759,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
770 | { | 759 | { |
771 | if (IsRoot) | 760 | if (IsRoot) |
772 | { | 761 | { |
773 | if (m_parentGroup.IsAttachment) | 762 | if (ParentGroup.IsAttachment) |
774 | return AttachedPos; | 763 | return AttachedPos; |
775 | else | 764 | else |
776 | return AbsolutePosition; | 765 | return AbsolutePosition; |
@@ -788,7 +777,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
788 | { | 777 | { |
789 | // We don't want the physics engine mucking up the rotations in a linkset | 778 | // We don't want the physics engine mucking up the rotations in a linkset |
790 | PhysicsActor actor = PhysActor; | 779 | PhysicsActor actor = PhysActor; |
791 | if (_parentID == 0 && (Shape.PCode != 9 || Shape.State == 0) && actor != null) | 780 | if (ParentID == 0 && (Shape.PCode != 9 || Shape.State == 0) && actor != null) |
792 | { | 781 | { |
793 | if (actor.Orientation.X != 0f || actor.Orientation.Y != 0f | 782 | if (actor.Orientation.X != 0f || actor.Orientation.Y != 0f |
794 | || actor.Orientation.Z != 0f || actor.Orientation.W != 0f) | 783 | || actor.Orientation.Z != 0f || actor.Orientation.W != 0f) |
@@ -818,7 +807,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
818 | try | 807 | try |
819 | { | 808 | { |
820 | // Root prim gets value directly | 809 | // Root prim gets value directly |
821 | if (_parentID == 0) | 810 | if (ParentID == 0) |
822 | { | 811 | { |
823 | actor.Orientation = value; | 812 | actor.Orientation = value; |
824 | //m_log.Info("[PART]: RO1:" + actor.Orientation.ToString()); | 813 | //m_log.Info("[PART]: RO1:" + actor.Orientation.ToString()); |
@@ -831,8 +820,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
831 | //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString()); | 820 | //m_log.Info("[PART]: RO2:" + actor.Orientation.ToString()); |
832 | } | 821 | } |
833 | 822 | ||
834 | if (m_parentGroup != null) | 823 | if (ParentGroup != null) |
835 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 824 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
836 | //} | 825 | //} |
837 | } | 826 | } |
838 | catch (Exception ex) | 827 | catch (Exception ex) |
@@ -877,7 +866,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
877 | if (actor.IsPhysical) | 866 | if (actor.IsPhysical) |
878 | { | 867 | { |
879 | actor.Velocity = value; | 868 | actor.Velocity = value; |
880 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 869 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
881 | } | 870 | } |
882 | } | 871 | } |
883 | } | 872 | } |
@@ -1012,9 +1001,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1012 | PhysicsActor actor = PhysActor; | 1001 | PhysicsActor actor = PhysActor; |
1013 | if (actor != null) | 1002 | if (actor != null) |
1014 | { | 1003 | { |
1015 | if (m_parentGroup.Scene != null) | 1004 | if (ParentGroup.Scene != null) |
1016 | { | 1005 | { |
1017 | if (m_parentGroup.Scene.PhysicsScene != null) | 1006 | if (ParentGroup.Scene.PhysicsScene != null) |
1018 | { | 1007 | { |
1019 | actor.Size = m_shape.Scale; | 1008 | actor.Size = m_shape.Scale; |
1020 | 1009 | ||
@@ -1076,7 +1065,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1076 | { | 1065 | { |
1077 | get | 1066 | get |
1078 | { | 1067 | { |
1079 | if (m_parentGroup.IsAttachment) | 1068 | if (ParentGroup.IsAttachment) |
1080 | return GroupPosition; | 1069 | return GroupPosition; |
1081 | 1070 | ||
1082 | return m_offsetPosition + m_groupPosition; | 1071 | return m_offsetPosition + m_groupPosition; |
@@ -1086,6 +1075,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1086 | public SceneObjectGroup ParentGroup | 1075 | public SceneObjectGroup ParentGroup |
1087 | { | 1076 | { |
1088 | get { return m_parentGroup; } | 1077 | get { return m_parentGroup; } |
1078 | private set { m_parentGroup = value; } | ||
1089 | } | 1079 | } |
1090 | 1080 | ||
1091 | public scriptEvents ScriptEvents | 1081 | public scriptEvents ScriptEvents |
@@ -1338,22 +1328,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1338 | client.SendObjectPropertiesReply(this); | 1328 | client.SendObjectPropertiesReply(this); |
1339 | } | 1329 | } |
1340 | 1330 | ||
1341 | /// <summary> | ||
1342 | /// For the scene object group to which this part belongs, send that scene object's root part properties to a client. | ||
1343 | /// </summary> | ||
1344 | /// <param name="AgentID"></param> | ||
1345 | private void SendRootPartPropertiesToClient(UUID AgentID) | ||
1346 | { | ||
1347 | m_parentGroup.Scene.ForEachClient(delegate(IClientAPI client) | ||
1348 | { | ||
1349 | // Ugly reference :( | ||
1350 | if (client.AgentId == AgentID) | ||
1351 | { | ||
1352 | m_parentGroup.SendPropertiesToClient(client); | ||
1353 | } | ||
1354 | }); | ||
1355 | } | ||
1356 | |||
1357 | // TODO: unused: | 1331 | // TODO: unused: |
1358 | // private void handleTimerAccounting(uint localID, double interval) | 1332 | // private void handleTimerAccounting(uint localID, double interval) |
1359 | // { | 1333 | // { |
@@ -1404,7 +1378,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1404 | /// </summary> | 1378 | /// </summary> |
1405 | public void AddFullUpdateToAllAvatars() | 1379 | public void AddFullUpdateToAllAvatars() |
1406 | { | 1380 | { |
1407 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 1381 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1408 | { | 1382 | { |
1409 | AddFullUpdateToAvatar(avatar); | 1383 | AddFullUpdateToAvatar(avatar); |
1410 | }); | 1384 | }); |
@@ -1431,7 +1405,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1431 | /// Terse updates | 1405 | /// Terse updates |
1432 | public void AddTerseUpdateToAllAvatars() | 1406 | public void AddTerseUpdateToAllAvatars() |
1433 | { | 1407 | { |
1434 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 1408 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
1435 | { | 1409 | { |
1436 | AddTerseUpdateToAvatar(avatar); | 1410 | AddTerseUpdateToAvatar(avatar); |
1437 | }); | 1411 | }); |
@@ -1469,7 +1443,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1469 | if (volume < 0) | 1443 | if (volume < 0) |
1470 | volume = 0; | 1444 | volume = 0; |
1471 | 1445 | ||
1472 | m_parentGroup.Scene.ForEachRootClient(delegate(IClientAPI client) | 1446 | ParentGroup.Scene.ForEachRootClient(delegate(IClientAPI client) |
1473 | { | 1447 | { |
1474 | client.SendAttachedSoundGainChange(UUID, (float)volume); | 1448 | client.SendAttachedSoundGainChange(UUID, (float)volume); |
1475 | }); | 1449 | }); |
@@ -1495,9 +1469,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1495 | impulse = newimpulse; | 1469 | impulse = newimpulse; |
1496 | } | 1470 | } |
1497 | 1471 | ||
1498 | if (m_parentGroup != null) | 1472 | if (ParentGroup != null) |
1499 | { | 1473 | { |
1500 | m_parentGroup.applyImpulse(impulse); | 1474 | ParentGroup.applyImpulse(impulse); |
1501 | } | 1475 | } |
1502 | } | 1476 | } |
1503 | 1477 | ||
@@ -1521,7 +1495,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1521 | impulse = newimpulse; | 1495 | impulse = newimpulse; |
1522 | } | 1496 | } |
1523 | 1497 | ||
1524 | m_parentGroup.applyAngularImpulse(impulse); | 1498 | ParentGroup.applyAngularImpulse(impulse); |
1525 | } | 1499 | } |
1526 | 1500 | ||
1527 | /// <summary> | 1501 | /// <summary> |
@@ -1544,7 +1518,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1544 | impulse = newimpulse; | 1518 | impulse = newimpulse; |
1545 | } | 1519 | } |
1546 | 1520 | ||
1547 | m_parentGroup.setAngularImpulse(impulse); | 1521 | ParentGroup.setAngularImpulse(impulse); |
1548 | } | 1522 | } |
1549 | 1523 | ||
1550 | /// <summary> | 1524 | /// <summary> |
@@ -1576,11 +1550,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1576 | 1550 | ||
1577 | // The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition | 1551 | // The only time the physics scene shouldn't know about the prim is if it's phantom or an attachment, which is phantom by definition |
1578 | // or flexible | 1552 | // or flexible |
1579 | if (!isPhantom && !m_parentGroup.IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible)) | 1553 | if (!isPhantom && !ParentGroup.IsAttachment && !(Shape.PathCurve == (byte)Extrusion.Flexible)) |
1580 | { | 1554 | { |
1581 | try | 1555 | try |
1582 | { | 1556 | { |
1583 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( | 1557 | PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( |
1584 | string.Format("{0}/{1}", Name, UUID), | 1558 | string.Format("{0}/{1}", Name, UUID), |
1585 | Shape, | 1559 | Shape, |
1586 | AbsolutePosition, | 1560 | AbsolutePosition, |
@@ -1647,8 +1621,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1647 | if (!userExposed) | 1621 | if (!userExposed) |
1648 | dupe.PhysActor = null; | 1622 | dupe.PhysActor = null; |
1649 | 1623 | ||
1650 | dupe._ownerID = AgentID; | 1624 | dupe.OwnerID = AgentID; |
1651 | dupe._groupID = GroupID; | 1625 | dupe.GroupID = GroupID; |
1652 | dupe.GroupPosition = GroupPosition; | 1626 | dupe.GroupPosition = GroupPosition; |
1653 | dupe.OffsetPosition = OffsetPosition; | 1627 | dupe.OffsetPosition = OffsetPosition; |
1654 | dupe.RotationOffset = RotationOffset; | 1628 | dupe.RotationOffset = RotationOffset; |
@@ -1657,10 +1631,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1657 | dupe.AngularVelocity = new Vector3(0, 0, 0); | 1631 | dupe.AngularVelocity = new Vector3(0, 0, 0); |
1658 | dupe.Flags = Flags; | 1632 | dupe.Flags = Flags; |
1659 | 1633 | ||
1660 | dupe._ownershipCost = _ownershipCost; | 1634 | dupe.OwnershipCost = OwnershipCost; |
1661 | dupe._objectSaleType = _objectSaleType; | 1635 | dupe.ObjectSaleType = ObjectSaleType; |
1662 | dupe._salePrice = _salePrice; | 1636 | dupe.SalePrice = SalePrice; |
1663 | dupe._category = _category; | 1637 | dupe.Category = Category; |
1664 | dupe.m_rezzed = m_rezzed; | 1638 | dupe.m_rezzed = m_rezzed; |
1665 | 1639 | ||
1666 | dupe.m_inventory = new SceneObjectPartInventory(dupe); | 1640 | dupe.m_inventory = new SceneObjectPartInventory(dupe); |
@@ -1679,7 +1653,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1679 | // Move afterwards ResetIDs as it clears the localID | 1653 | // Move afterwards ResetIDs as it clears the localID |
1680 | dupe.LocalId = localID; | 1654 | dupe.LocalId = localID; |
1681 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. | 1655 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. |
1682 | dupe._lastOwnerID = OwnerID; | 1656 | dupe.LastOwnerID = OwnerID; |
1683 | 1657 | ||
1684 | byte[] extraP = new byte[Shape.ExtraParams.Length]; | 1658 | byte[] extraP = new byte[Shape.ExtraParams.Length]; |
1685 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); | 1659 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); |
@@ -1766,7 +1740,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1766 | } | 1740 | } |
1767 | } | 1741 | } |
1768 | 1742 | ||
1769 | SceneObjectPart trackedBody = m_parentGroup.Scene.GetSceneObjectPart(trackedBodyName); // FIXME: causes a sequential lookup | 1743 | SceneObjectPart trackedBody = ParentGroup.Scene.GetSceneObjectPart(trackedBodyName); // FIXME: causes a sequential lookup |
1770 | Quaternion localRotation = Quaternion.Identity; | 1744 | Quaternion localRotation = Quaternion.Identity; |
1771 | if (trackedBody != null) | 1745 | if (trackedBody != null) |
1772 | { | 1746 | { |
@@ -1779,7 +1753,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1779 | 1753 | ||
1780 | PhysicsJoint joint; | 1754 | PhysicsJoint joint; |
1781 | 1755 | ||
1782 | joint = m_parentGroup.Scene.PhysicsScene.RequestJointCreation(Name, jointType, | 1756 | joint = ParentGroup.Scene.PhysicsScene.RequestJointCreation(Name, jointType, |
1783 | AbsolutePosition, | 1757 | AbsolutePosition, |
1784 | this.RotationOffset, | 1758 | this.RotationOffset, |
1785 | Description, | 1759 | Description, |
@@ -1804,7 +1778,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1804 | else | 1778 | else |
1805 | { | 1779 | { |
1806 | // here we turn off the joint object, so remove the joint from the physics scene | 1780 | // here we turn off the joint object, so remove the joint from the physics scene |
1807 | m_parentGroup.Scene.PhysicsScene.RequestJointDeletion(Name); // FIXME: what if the name changed? | 1781 | ParentGroup.Scene.PhysicsScene.RequestJointDeletion(Name); // FIXME: what if the name changed? |
1808 | 1782 | ||
1809 | // make sure client isn't interpolating the joint proxy object | 1783 | // make sure client isn't interpolating the joint proxy object |
1810 | Velocity = Vector3.Zero; | 1784 | Velocity = Vector3.Zero; |
@@ -1846,7 +1820,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1846 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints && (!isNew)) | 1820 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints && (!isNew)) |
1847 | { | 1821 | { |
1848 | // destroy all joints connected to this now deactivated body | 1822 | // destroy all joints connected to this now deactivated body |
1849 | m_parentGroup.Scene.PhysicsScene.RemoveAllJointsConnectedToActorThreadLocked(PhysActor); | 1823 | ParentGroup.Scene.PhysicsScene.RemoveAllJointsConnectedToActorThreadLocked(PhysActor); |
1850 | } | 1824 | } |
1851 | 1825 | ||
1852 | // stop client-side interpolation of all joint proxy objects that have just been deleted | 1826 | // stop client-side interpolation of all joint proxy objects that have just been deleted |
@@ -1880,7 +1854,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1880 | 1854 | ||
1881 | PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; | 1855 | PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; |
1882 | PhysActor.OnOutOfBounds += PhysicsOutOfBounds; | 1856 | PhysActor.OnOutOfBounds += PhysicsOutOfBounds; |
1883 | if (_parentID != 0 && _parentID != LocalId) | 1857 | if (ParentID != 0 && ParentID != LocalId) |
1884 | { | 1858 | { |
1885 | if (ParentGroup.RootPart.PhysActor != null) | 1859 | if (ParentGroup.RootPart.PhysActor != null) |
1886 | { | 1860 | { |
@@ -1896,7 +1870,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1896 | if (Shape.SculptEntry) | 1870 | if (Shape.SculptEntry) |
1897 | CheckSculptAndLoad(); | 1871 | CheckSculptAndLoad(); |
1898 | else | 1872 | else |
1899 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 1873 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); |
1900 | } | 1874 | } |
1901 | } | 1875 | } |
1902 | } | 1876 | } |
@@ -1919,58 +1893,58 @@ namespace OpenSim.Region.Framework.Scenes | |||
1919 | 1893 | ||
1920 | public bool GetDieAtEdge() | 1894 | public bool GetDieAtEdge() |
1921 | { | 1895 | { |
1922 | if (m_parentGroup.IsDeleted) | 1896 | if (ParentGroup.IsDeleted) |
1923 | return false; | 1897 | return false; |
1924 | 1898 | ||
1925 | return m_parentGroup.RootPart.DIE_AT_EDGE; | 1899 | return ParentGroup.RootPart.DIE_AT_EDGE; |
1926 | } | 1900 | } |
1927 | 1901 | ||
1928 | public bool GetReturnAtEdge() | 1902 | public bool GetReturnAtEdge() |
1929 | { | 1903 | { |
1930 | if (m_parentGroup.IsDeleted) | 1904 | if (ParentGroup.IsDeleted) |
1931 | return false; | 1905 | return false; |
1932 | 1906 | ||
1933 | return m_parentGroup.RootPart.RETURN_AT_EDGE; | 1907 | return ParentGroup.RootPart.RETURN_AT_EDGE; |
1934 | } | 1908 | } |
1935 | 1909 | ||
1936 | public void SetReturnAtEdge(bool p) | 1910 | public void SetReturnAtEdge(bool p) |
1937 | { | 1911 | { |
1938 | if (m_parentGroup.IsDeleted) | 1912 | if (ParentGroup.IsDeleted) |
1939 | return; | 1913 | return; |
1940 | 1914 | ||
1941 | m_parentGroup.RootPart.RETURN_AT_EDGE = p; | 1915 | ParentGroup.RootPart.RETURN_AT_EDGE = p; |
1942 | } | 1916 | } |
1943 | 1917 | ||
1944 | public bool GetBlockGrab() | 1918 | public bool GetBlockGrab() |
1945 | { | 1919 | { |
1946 | if (m_parentGroup.IsDeleted) | 1920 | if (ParentGroup.IsDeleted) |
1947 | return false; | 1921 | return false; |
1948 | 1922 | ||
1949 | return m_parentGroup.RootPart.BlockGrab; | 1923 | return ParentGroup.RootPart.BlockGrab; |
1950 | } | 1924 | } |
1951 | 1925 | ||
1952 | public void SetBlockGrab(bool p) | 1926 | public void SetBlockGrab(bool p) |
1953 | { | 1927 | { |
1954 | if (m_parentGroup.IsDeleted) | 1928 | if (ParentGroup.IsDeleted) |
1955 | return; | 1929 | return; |
1956 | 1930 | ||
1957 | m_parentGroup.RootPart.BlockGrab = p; | 1931 | ParentGroup.RootPart.BlockGrab = p; |
1958 | } | 1932 | } |
1959 | 1933 | ||
1960 | public void SetStatusSandbox(bool p) | 1934 | public void SetStatusSandbox(bool p) |
1961 | { | 1935 | { |
1962 | if (m_parentGroup.IsDeleted) | 1936 | if (ParentGroup.IsDeleted) |
1963 | return; | 1937 | return; |
1964 | StatusSandboxPos = m_parentGroup.RootPart.AbsolutePosition; | 1938 | StatusSandboxPos = ParentGroup.RootPart.AbsolutePosition; |
1965 | m_parentGroup.RootPart.StatusSandbox = p; | 1939 | ParentGroup.RootPart.StatusSandbox = p; |
1966 | } | 1940 | } |
1967 | 1941 | ||
1968 | public bool GetStatusSandbox() | 1942 | public bool GetStatusSandbox() |
1969 | { | 1943 | { |
1970 | if (m_parentGroup.IsDeleted) | 1944 | if (ParentGroup.IsDeleted) |
1971 | return false; | 1945 | return false; |
1972 | 1946 | ||
1973 | return m_parentGroup.RootPart.StatusSandbox; | 1947 | return ParentGroup.RootPart.StatusSandbox; |
1974 | } | 1948 | } |
1975 | 1949 | ||
1976 | public int GetAxisRotation(int axis) | 1950 | public int GetAxisRotation(int axis) |
@@ -2080,7 +2054,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2080 | { | 2054 | { |
2081 | if (tau > 0) | 2055 | if (tau > 0) |
2082 | { | 2056 | { |
2083 | m_parentGroup.moveToTarget(target, tau); | 2057 | ParentGroup.moveToTarget(target, tau); |
2084 | } | 2058 | } |
2085 | else | 2059 | else |
2086 | { | 2060 | { |
@@ -2096,12 +2070,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2096 | /// <param name="tau">Number of seconds over which to reach target</param> | 2070 | /// <param name="tau">Number of seconds over which to reach target</param> |
2097 | public void SetHoverHeight(float height, PIDHoverType hoverType, float tau) | 2071 | public void SetHoverHeight(float height, PIDHoverType hoverType, float tau) |
2098 | { | 2072 | { |
2099 | m_parentGroup.SetHoverHeight(height, hoverType, tau); | 2073 | ParentGroup.SetHoverHeight(height, hoverType, tau); |
2100 | } | 2074 | } |
2101 | 2075 | ||
2102 | public void StopHover() | 2076 | public void StopHover() |
2103 | { | 2077 | { |
2104 | m_parentGroup.SetHoverHeight(0f, PIDHoverType.Ground, 0f); | 2078 | ParentGroup.SetHoverHeight(0f, PIDHoverType.Ground, 0f); |
2105 | } | 2079 | } |
2106 | 2080 | ||
2107 | public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient) | 2081 | public virtual void OnGrab(Vector3 offsetPos, IClientAPI remoteClient) |
@@ -2152,7 +2126,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2152 | m_lastColliders.Remove(localID); | 2126 | m_lastColliders.Remove(localID); |
2153 | } | 2127 | } |
2154 | 2128 | ||
2155 | if (m_parentGroup.IsDeleted) | 2129 | if (ParentGroup.IsDeleted) |
2156 | return; | 2130 | return; |
2157 | 2131 | ||
2158 | // play the sound. | 2132 | // play the sound. |
@@ -2161,7 +2135,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2161 | SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false); | 2135 | SendSound(CollisionSound.ToString(), CollisionSoundVolume, true, (byte)0, 0, false, false); |
2162 | } | 2136 | } |
2163 | 2137 | ||
2164 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) | 2138 | if ((ParentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) |
2165 | { | 2139 | { |
2166 | // do event notification | 2140 | // do event notification |
2167 | if (startedColliders.Count > 0) | 2141 | if (startedColliders.Count > 0) |
@@ -2172,30 +2146,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
2172 | { | 2146 | { |
2173 | if (localId == 0) | 2147 | if (localId == 0) |
2174 | continue; | 2148 | continue; |
2175 | 2149 | ||
2176 | if (m_parentGroup.Scene == null) | 2150 | if (ParentGroup.Scene == null) |
2177 | return; | 2151 | return; |
2178 | 2152 | ||
2179 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 2153 | SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId); |
2180 | string data = ""; | 2154 | string data = ""; |
2181 | if (obj != null) | 2155 | if (obj != null) |
2182 | { | 2156 | { |
2183 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) | 2157 | if (ParentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) |
2184 | || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2158 | || ParentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
2185 | { | 2159 | { |
2186 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2160 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2187 | //If it is 1, it is to accept ONLY collisions from this object | 2161 | //If it is 1, it is to accept ONLY collisions from this object |
2188 | if (found) | 2162 | if (found) |
2189 | { | 2163 | { |
2190 | DetectedObject detobj = new DetectedObject(); | 2164 | DetectedObject detobj = new DetectedObject(); |
2191 | detobj.keyUUID = obj.UUID; | 2165 | detobj.keyUUID = obj.UUID; |
2192 | detobj.nameStr = obj.Name; | 2166 | detobj.nameStr = obj.Name; |
2193 | detobj.ownerUUID = obj._ownerID; | 2167 | detobj.ownerUUID = obj.OwnerID; |
2194 | detobj.posVector = obj.AbsolutePosition; | 2168 | detobj.posVector = obj.AbsolutePosition; |
2195 | detobj.rotQuat = obj.GetWorldRotation(); | 2169 | detobj.rotQuat = obj.GetWorldRotation(); |
2196 | detobj.velVector = obj.Velocity; | 2170 | detobj.velVector = obj.Velocity; |
2197 | detobj.colliderType = 0; | 2171 | detobj.colliderType = 0; |
2198 | detobj.groupUUID = obj._groupID; | 2172 | detobj.groupUUID = obj.GroupID; |
2199 | colliding.Add(detobj); | 2173 | colliding.Add(detobj); |
2200 | } | 2174 | } |
2201 | //If it is 0, it is to not accept collisions from this object | 2175 | //If it is 0, it is to not accept collisions from this object |
@@ -2205,33 +2179,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
2205 | } | 2179 | } |
2206 | else | 2180 | else |
2207 | { | 2181 | { |
2208 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2182 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2209 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 2183 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
2210 | if (!found) | 2184 | if (!found) |
2211 | { | 2185 | { |
2212 | DetectedObject detobj = new DetectedObject(); | 2186 | DetectedObject detobj = new DetectedObject(); |
2213 | detobj.keyUUID = obj.UUID; | 2187 | detobj.keyUUID = obj.UUID; |
2214 | detobj.nameStr = obj.Name; | 2188 | detobj.nameStr = obj.Name; |
2215 | detobj.ownerUUID = obj._ownerID; | 2189 | detobj.ownerUUID = obj.OwnerID; |
2216 | detobj.posVector = obj.AbsolutePosition; | 2190 | detobj.posVector = obj.AbsolutePosition; |
2217 | detobj.rotQuat = obj.GetWorldRotation(); | 2191 | detobj.rotQuat = obj.GetWorldRotation(); |
2218 | detobj.velVector = obj.Velocity; | 2192 | detobj.velVector = obj.Velocity; |
2219 | detobj.colliderType = 0; | 2193 | detobj.colliderType = 0; |
2220 | detobj.groupUUID = obj._groupID; | 2194 | detobj.groupUUID = obj.GroupID; |
2221 | colliding.Add(detobj); | 2195 | colliding.Add(detobj); |
2222 | } | 2196 | } |
2223 | } | 2197 | } |
2224 | } | 2198 | } |
2225 | else | 2199 | else |
2226 | { | 2200 | { |
2227 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av) | 2201 | ParentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av) |
2228 | { | 2202 | { |
2229 | if (av.LocalId == localId) | 2203 | if (av.LocalId == localId) |
2230 | { | 2204 | { |
2231 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) | 2205 | if (ParentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) |
2232 | || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2206 | || ParentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2233 | { | 2207 | { |
2234 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); | 2208 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2235 | //If it is 1, it is to accept ONLY collisions from this avatar | 2209 | //If it is 1, it is to accept ONLY collisions from this avatar |
2236 | if (found) | 2210 | if (found) |
2237 | { | 2211 | { |
@@ -2253,7 +2227,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2253 | } | 2227 | } |
2254 | else | 2228 | else |
2255 | { | 2229 | { |
2256 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); | 2230 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2257 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2231 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2258 | if (!found) | 2232 | if (!found) |
2259 | { | 2233 | { |
@@ -2278,8 +2252,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2278 | if (colliding.Count > 0) | 2252 | if (colliding.Count > 0) |
2279 | { | 2253 | { |
2280 | StartCollidingMessage.Colliders = colliding; | 2254 | StartCollidingMessage.Colliders = colliding; |
2281 | 2255 | ||
2282 | if (m_parentGroup.Scene == null) | 2256 | if (ParentGroup.Scene == null) |
2283 | return; | 2257 | return; |
2284 | 2258 | ||
2285 | // if (m_parentGroup.PassCollision == true) | 2259 | // if (m_parentGroup.PassCollision == true) |
@@ -2287,12 +2261,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2287 | // //TODO: Add pass to root prim! | 2261 | // //TODO: Add pass to root prim! |
2288 | // } | 2262 | // } |
2289 | 2263 | ||
2290 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); | 2264 | ParentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); |
2291 | } | 2265 | } |
2292 | } | 2266 | } |
2293 | } | 2267 | } |
2294 | 2268 | ||
2295 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision) != 0) | 2269 | if ((ParentGroup.RootPart.ScriptEvents & scriptEvents.collision) != 0) |
2296 | { | 2270 | { |
2297 | if (m_lastColliders.Count > 0) | 2271 | if (m_lastColliders.Count > 0) |
2298 | { | 2272 | { |
@@ -2304,29 +2278,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
2304 | if (localId == 0) | 2278 | if (localId == 0) |
2305 | continue; | 2279 | continue; |
2306 | 2280 | ||
2307 | if (m_parentGroup.Scene == null) | 2281 | if (ParentGroup.Scene == null) |
2308 | return; | 2282 | return; |
2309 | 2283 | ||
2310 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 2284 | SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId); |
2311 | string data = ""; | 2285 | string data = ""; |
2312 | if (obj != null) | 2286 | if (obj != null) |
2313 | { | 2287 | { |
2314 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) | 2288 | if (ParentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) |
2315 | || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2289 | || ParentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
2316 | { | 2290 | { |
2317 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2291 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2318 | //If it is 1, it is to accept ONLY collisions from this object | 2292 | //If it is 1, it is to accept ONLY collisions from this object |
2319 | if (found) | 2293 | if (found) |
2320 | { | 2294 | { |
2321 | DetectedObject detobj = new DetectedObject(); | 2295 | DetectedObject detobj = new DetectedObject(); |
2322 | detobj.keyUUID = obj.UUID; | 2296 | detobj.keyUUID = obj.UUID; |
2323 | detobj.nameStr = obj.Name; | 2297 | detobj.nameStr = obj.Name; |
2324 | detobj.ownerUUID = obj._ownerID; | 2298 | detobj.ownerUUID = obj.OwnerID; |
2325 | detobj.posVector = obj.AbsolutePosition; | 2299 | detobj.posVector = obj.AbsolutePosition; |
2326 | detobj.rotQuat = obj.GetWorldRotation(); | 2300 | detobj.rotQuat = obj.GetWorldRotation(); |
2327 | detobj.velVector = obj.Velocity; | 2301 | detobj.velVector = obj.Velocity; |
2328 | detobj.colliderType = 0; | 2302 | detobj.colliderType = 0; |
2329 | detobj.groupUUID = obj._groupID; | 2303 | detobj.groupUUID = obj.GroupID; |
2330 | colliding.Add(detobj); | 2304 | colliding.Add(detobj); |
2331 | } | 2305 | } |
2332 | //If it is 0, it is to not accept collisions from this object | 2306 | //If it is 0, it is to not accept collisions from this object |
@@ -2336,33 +2310,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
2336 | } | 2310 | } |
2337 | else | 2311 | else |
2338 | { | 2312 | { |
2339 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2313 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2340 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 2314 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
2341 | if (!found) | 2315 | if (!found) |
2342 | { | 2316 | { |
2343 | DetectedObject detobj = new DetectedObject(); | 2317 | DetectedObject detobj = new DetectedObject(); |
2344 | detobj.keyUUID = obj.UUID; | 2318 | detobj.keyUUID = obj.UUID; |
2345 | detobj.nameStr = obj.Name; | 2319 | detobj.nameStr = obj.Name; |
2346 | detobj.ownerUUID = obj._ownerID; | 2320 | detobj.ownerUUID = obj.OwnerID; |
2347 | detobj.posVector = obj.AbsolutePosition; | 2321 | detobj.posVector = obj.AbsolutePosition; |
2348 | detobj.rotQuat = obj.GetWorldRotation(); | 2322 | detobj.rotQuat = obj.GetWorldRotation(); |
2349 | detobj.velVector = obj.Velocity; | 2323 | detobj.velVector = obj.Velocity; |
2350 | detobj.colliderType = 0; | 2324 | detobj.colliderType = 0; |
2351 | detobj.groupUUID = obj._groupID; | 2325 | detobj.groupUUID = obj.GroupID; |
2352 | colliding.Add(detobj); | 2326 | colliding.Add(detobj); |
2353 | } | 2327 | } |
2354 | } | 2328 | } |
2355 | } | 2329 | } |
2356 | else | 2330 | else |
2357 | { | 2331 | { |
2358 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av) | 2332 | ParentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av) |
2359 | { | 2333 | { |
2360 | if (av.LocalId == localId) | 2334 | if (av.LocalId == localId) |
2361 | { | 2335 | { |
2362 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) | 2336 | if (ParentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) |
2363 | || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2337 | || ParentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2364 | { | 2338 | { |
2365 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); | 2339 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2366 | //If it is 1, it is to accept ONLY collisions from this avatar | 2340 | //If it is 1, it is to accept ONLY collisions from this avatar |
2367 | if (found) | 2341 | if (found) |
2368 | { | 2342 | { |
@@ -2384,7 +2358,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2384 | } | 2358 | } |
2385 | else | 2359 | else |
2386 | { | 2360 | { |
2387 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); | 2361 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2388 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2362 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2389 | if (!found) | 2363 | if (!found) |
2390 | { | 2364 | { |
@@ -2409,15 +2383,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2409 | { | 2383 | { |
2410 | CollidingMessage.Colliders = colliding; | 2384 | CollidingMessage.Colliders = colliding; |
2411 | 2385 | ||
2412 | if (m_parentGroup.Scene == null) | 2386 | if (ParentGroup.Scene == null) |
2413 | return; | 2387 | return; |
2414 | 2388 | ||
2415 | m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); | 2389 | ParentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); |
2416 | } | 2390 | } |
2417 | } | 2391 | } |
2418 | } | 2392 | } |
2419 | 2393 | ||
2420 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) | 2394 | if ((ParentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) |
2421 | { | 2395 | { |
2422 | if (endedColliders.Count > 0) | 2396 | if (endedColliders.Count > 0) |
2423 | { | 2397 | { |
@@ -2428,28 +2402,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
2428 | if (localId == 0) | 2402 | if (localId == 0) |
2429 | continue; | 2403 | continue; |
2430 | 2404 | ||
2431 | if (m_parentGroup.Scene == null) | 2405 | if (ParentGroup.Scene == null) |
2432 | return; | 2406 | return; |
2433 | 2407 | ||
2434 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 2408 | SceneObjectPart obj = ParentGroup.Scene.GetSceneObjectPart(localId); |
2435 | string data = ""; | 2409 | string data = ""; |
2436 | if (obj != null) | 2410 | if (obj != null) |
2437 | { | 2411 | { |
2438 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2412 | if (ParentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || ParentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
2439 | { | 2413 | { |
2440 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2414 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2441 | //If it is 1, it is to accept ONLY collisions from this object | 2415 | //If it is 1, it is to accept ONLY collisions from this object |
2442 | if (found) | 2416 | if (found) |
2443 | { | 2417 | { |
2444 | DetectedObject detobj = new DetectedObject(); | 2418 | DetectedObject detobj = new DetectedObject(); |
2445 | detobj.keyUUID = obj.UUID; | 2419 | detobj.keyUUID = obj.UUID; |
2446 | detobj.nameStr = obj.Name; | 2420 | detobj.nameStr = obj.Name; |
2447 | detobj.ownerUUID = obj._ownerID; | 2421 | detobj.ownerUUID = obj.OwnerID; |
2448 | detobj.posVector = obj.AbsolutePosition; | 2422 | detobj.posVector = obj.AbsolutePosition; |
2449 | detobj.rotQuat = obj.GetWorldRotation(); | 2423 | detobj.rotQuat = obj.GetWorldRotation(); |
2450 | detobj.velVector = obj.Velocity; | 2424 | detobj.velVector = obj.Velocity; |
2451 | detobj.colliderType = 0; | 2425 | detobj.colliderType = 0; |
2452 | detobj.groupUUID = obj._groupID; | 2426 | detobj.groupUUID = obj.GroupID; |
2453 | colliding.Add(detobj); | 2427 | colliding.Add(detobj); |
2454 | } | 2428 | } |
2455 | //If it is 0, it is to not accept collisions from this object | 2429 | //If it is 0, it is to not accept collisions from this object |
@@ -2459,33 +2433,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
2459 | } | 2433 | } |
2460 | else | 2434 | else |
2461 | { | 2435 | { |
2462 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2436 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2463 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 2437 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
2464 | if (!found) | 2438 | if (!found) |
2465 | { | 2439 | { |
2466 | DetectedObject detobj = new DetectedObject(); | 2440 | DetectedObject detobj = new DetectedObject(); |
2467 | detobj.keyUUID = obj.UUID; | 2441 | detobj.keyUUID = obj.UUID; |
2468 | detobj.nameStr = obj.Name; | 2442 | detobj.nameStr = obj.Name; |
2469 | detobj.ownerUUID = obj._ownerID; | 2443 | detobj.ownerUUID = obj.OwnerID; |
2470 | detobj.posVector = obj.AbsolutePosition; | 2444 | detobj.posVector = obj.AbsolutePosition; |
2471 | detobj.rotQuat = obj.GetWorldRotation(); | 2445 | detobj.rotQuat = obj.GetWorldRotation(); |
2472 | detobj.velVector = obj.Velocity; | 2446 | detobj.velVector = obj.Velocity; |
2473 | detobj.colliderType = 0; | 2447 | detobj.colliderType = 0; |
2474 | detobj.groupUUID = obj._groupID; | 2448 | detobj.groupUUID = obj.GroupID; |
2475 | colliding.Add(detobj); | 2449 | colliding.Add(detobj); |
2476 | } | 2450 | } |
2477 | } | 2451 | } |
2478 | } | 2452 | } |
2479 | else | 2453 | else |
2480 | { | 2454 | { |
2481 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av) | 2455 | ParentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence av) |
2482 | { | 2456 | { |
2483 | if (av.LocalId == localId) | 2457 | if (av.LocalId == localId) |
2484 | { | 2458 | { |
2485 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) | 2459 | if (ParentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) |
2486 | || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) | 2460 | || ParentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2487 | { | 2461 | { |
2488 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); | 2462 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2489 | //If it is 1, it is to accept ONLY collisions from this avatar | 2463 | //If it is 1, it is to accept ONLY collisions from this avatar |
2490 | if (found) | 2464 | if (found) |
2491 | { | 2465 | { |
@@ -2507,7 +2481,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2507 | } | 2481 | } |
2508 | else | 2482 | else |
2509 | { | 2483 | { |
2510 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); | 2484 | bool found = ParentGroup.RootPart.CollisionFilter.TryGetValue(1, out data); |
2511 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2485 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2512 | if (!found) | 2486 | if (!found) |
2513 | { | 2487 | { |
@@ -2533,15 +2507,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2533 | { | 2507 | { |
2534 | EndCollidingMessage.Colliders = colliding; | 2508 | EndCollidingMessage.Colliders = colliding; |
2535 | 2509 | ||
2536 | if (m_parentGroup.Scene == null) | 2510 | if (ParentGroup.Scene == null) |
2537 | return; | 2511 | return; |
2538 | 2512 | ||
2539 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); | 2513 | ParentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); |
2540 | } | 2514 | } |
2541 | } | 2515 | } |
2542 | } | 2516 | } |
2543 | 2517 | ||
2544 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_start) != 0) | 2518 | if ((ParentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_start) != 0) |
2545 | { | 2519 | { |
2546 | if (startedColliders.Count > 0) | 2520 | if (startedColliders.Count > 0) |
2547 | { | 2521 | { |
@@ -2556,7 +2530,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2556 | detobj.keyUUID = UUID.Zero; | 2530 | detobj.keyUUID = UUID.Zero; |
2557 | detobj.nameStr = ""; | 2531 | detobj.nameStr = ""; |
2558 | detobj.ownerUUID = UUID.Zero; | 2532 | detobj.ownerUUID = UUID.Zero; |
2559 | detobj.posVector = m_parentGroup.RootPart.AbsolutePosition; | 2533 | detobj.posVector = ParentGroup.RootPart.AbsolutePosition; |
2560 | detobj.rotQuat = Quaternion.Identity; | 2534 | detobj.rotQuat = Quaternion.Identity; |
2561 | detobj.velVector = Vector3.Zero; | 2535 | detobj.velVector = Vector3.Zero; |
2562 | detobj.colliderType = 0; | 2536 | detobj.colliderType = 0; |
@@ -2569,15 +2543,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2569 | { | 2543 | { |
2570 | LandStartCollidingMessage.Colliders = colliding; | 2544 | LandStartCollidingMessage.Colliders = colliding; |
2571 | 2545 | ||
2572 | if (m_parentGroup.Scene == null) | 2546 | if (ParentGroup.Scene == null) |
2573 | return; | 2547 | return; |
2574 | 2548 | ||
2575 | m_parentGroup.Scene.EventManager.TriggerScriptLandCollidingStart(LocalId, LandStartCollidingMessage); | 2549 | ParentGroup.Scene.EventManager.TriggerScriptLandCollidingStart(LocalId, LandStartCollidingMessage); |
2576 | } | 2550 | } |
2577 | } | 2551 | } |
2578 | } | 2552 | } |
2579 | 2553 | ||
2580 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision) != 0) | 2554 | if ((ParentGroup.RootPart.ScriptEvents & scriptEvents.land_collision) != 0) |
2581 | { | 2555 | { |
2582 | if (m_lastColliders.Count > 0) | 2556 | if (m_lastColliders.Count > 0) |
2583 | { | 2557 | { |
@@ -2592,7 +2566,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2592 | detobj.keyUUID = UUID.Zero; | 2566 | detobj.keyUUID = UUID.Zero; |
2593 | detobj.nameStr = ""; | 2567 | detobj.nameStr = ""; |
2594 | detobj.ownerUUID = UUID.Zero; | 2568 | detobj.ownerUUID = UUID.Zero; |
2595 | detobj.posVector = m_parentGroup.RootPart.AbsolutePosition; | 2569 | detobj.posVector = ParentGroup.RootPart.AbsolutePosition; |
2596 | detobj.rotQuat = Quaternion.Identity; | 2570 | detobj.rotQuat = Quaternion.Identity; |
2597 | detobj.velVector = Vector3.Zero; | 2571 | detobj.velVector = Vector3.Zero; |
2598 | detobj.colliderType = 0; | 2572 | detobj.colliderType = 0; |
@@ -2605,15 +2579,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2605 | { | 2579 | { |
2606 | LandCollidingMessage.Colliders = colliding; | 2580 | LandCollidingMessage.Colliders = colliding; |
2607 | 2581 | ||
2608 | if (m_parentGroup.Scene == null) | 2582 | if (ParentGroup.Scene == null) |
2609 | return; | 2583 | return; |
2610 | 2584 | ||
2611 | m_parentGroup.Scene.EventManager.TriggerScriptLandColliding(LocalId, LandCollidingMessage); | 2585 | ParentGroup.Scene.EventManager.TriggerScriptLandColliding(LocalId, LandCollidingMessage); |
2612 | } | 2586 | } |
2613 | } | 2587 | } |
2614 | } | 2588 | } |
2615 | 2589 | ||
2616 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_end) != 0) | 2590 | if ((ParentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_end) != 0) |
2617 | { | 2591 | { |
2618 | if (endedColliders.Count > 0) | 2592 | if (endedColliders.Count > 0) |
2619 | { | 2593 | { |
@@ -2628,7 +2602,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2628 | detobj.keyUUID = UUID.Zero; | 2602 | detobj.keyUUID = UUID.Zero; |
2629 | detobj.nameStr = ""; | 2603 | detobj.nameStr = ""; |
2630 | detobj.ownerUUID = UUID.Zero; | 2604 | detobj.ownerUUID = UUID.Zero; |
2631 | detobj.posVector = m_parentGroup.RootPart.AbsolutePosition; | 2605 | detobj.posVector = ParentGroup.RootPart.AbsolutePosition; |
2632 | detobj.rotQuat = Quaternion.Identity; | 2606 | detobj.rotQuat = Quaternion.Identity; |
2633 | detobj.velVector = Vector3.Zero; | 2607 | detobj.velVector = Vector3.Zero; |
2634 | detobj.colliderType = 0; | 2608 | detobj.colliderType = 0; |
@@ -2641,10 +2615,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2641 | { | 2615 | { |
2642 | LandEndCollidingMessage.Colliders = colliding; | 2616 | LandEndCollidingMessage.Colliders = colliding; |
2643 | 2617 | ||
2644 | if (m_parentGroup.Scene == null) | 2618 | if (ParentGroup.Scene == null) |
2645 | return; | 2619 | return; |
2646 | 2620 | ||
2647 | m_parentGroup.Scene.EventManager.TriggerScriptLandCollidingEnd(LocalId, LandEndCollidingMessage); | 2621 | ParentGroup.Scene.EventManager.TriggerScriptLandCollidingEnd(LocalId, LandEndCollidingMessage); |
2648 | } | 2622 | } |
2649 | } | 2623 | } |
2650 | } | 2624 | } |
@@ -2656,7 +2630,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2656 | 2630 | ||
2657 | RemFlag(PrimFlags.Physics); | 2631 | RemFlag(PrimFlags.Physics); |
2658 | DoPhysicsPropertyUpdate(false, true); | 2632 | DoPhysicsPropertyUpdate(false, true); |
2659 | //m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 2633 | //ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); |
2660 | } | 2634 | } |
2661 | 2635 | ||
2662 | public void PhysicsRequestingTerseUpdate() | 2636 | public void PhysicsRequestingTerseUpdate() |
@@ -2665,15 +2639,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2665 | { | 2639 | { |
2666 | Vector3 newpos = new Vector3(PhysActor.Position.GetBytes(), 0); | 2640 | Vector3 newpos = new Vector3(PhysActor.Position.GetBytes(), 0); |
2667 | 2641 | ||
2668 | if (m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.N) | 2642 | if (ParentGroup.Scene.TestBorderCross(newpos, Cardinals.N) |
2669 | | m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.S) | 2643 | | ParentGroup.Scene.TestBorderCross(newpos, Cardinals.S) |
2670 | | m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.E) | 2644 | | ParentGroup.Scene.TestBorderCross(newpos, Cardinals.E) |
2671 | | m_parentGroup.Scene.TestBorderCross(newpos, Cardinals.W)) | 2645 | | ParentGroup.Scene.TestBorderCross(newpos, Cardinals.W)) |
2672 | { | 2646 | { |
2673 | m_parentGroup.AbsolutePosition = newpos; | 2647 | ParentGroup.AbsolutePosition = newpos; |
2674 | return; | 2648 | return; |
2675 | } | 2649 | } |
2676 | //m_parentGroup.RootPart.m_groupPosition = newpos; | 2650 | //ParentGroup.RootPart.m_groupPosition = newpos; |
2677 | } | 2651 | } |
2678 | ScheduleTerseUpdate(); | 2652 | ScheduleTerseUpdate(); |
2679 | 2653 | ||
@@ -2704,7 +2678,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2704 | } | 2678 | } |
2705 | } | 2679 | } |
2706 | 2680 | ||
2707 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) | 2681 | ParentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) |
2708 | { | 2682 | { |
2709 | if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) | 2683 | if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100)) |
2710 | sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); | 2684 | sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); |
@@ -2789,7 +2763,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2789 | 2763 | ||
2790 | public void rotLookAt(Quaternion target, float strength, float damping) | 2764 | public void rotLookAt(Quaternion target, float strength, float damping) |
2791 | { | 2765 | { |
2792 | if (m_parentGroup.IsAttachment) | 2766 | if (ParentGroup.IsAttachment) |
2793 | { | 2767 | { |
2794 | /* | 2768 | /* |
2795 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); | 2769 | ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar); |
@@ -2825,10 +2799,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2825 | { | 2799 | { |
2826 | // m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); | 2800 | // m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); |
2827 | 2801 | ||
2828 | if (m_parentGroup == null) | 2802 | if (ParentGroup == null) |
2829 | return; | 2803 | return; |
2830 | 2804 | ||
2831 | m_parentGroup.QueueForUpdateCheck(); | 2805 | ParentGroup.QueueForUpdateCheck(); |
2832 | 2806 | ||
2833 | int timeNow = Util.UnixTimeSinceEpoch(); | 2807 | int timeNow = Util.UnixTimeSinceEpoch(); |
2834 | 2808 | ||
@@ -2857,13 +2831,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2857 | /// </summary> | 2831 | /// </summary> |
2858 | public void ScheduleTerseUpdate() | 2832 | public void ScheduleTerseUpdate() |
2859 | { | 2833 | { |
2860 | if (m_parentGroup == null) | 2834 | if (ParentGroup == null) |
2861 | return; | 2835 | return; |
2862 | 2836 | ||
2863 | if (UpdateFlag == UpdateRequired.NONE) | 2837 | if (UpdateFlag == UpdateRequired.NONE) |
2864 | { | 2838 | { |
2865 | m_parentGroup.HasGroupChanged = true; | 2839 | ParentGroup.HasGroupChanged = true; |
2866 | m_parentGroup.QueueForUpdateCheck(); | 2840 | ParentGroup.QueueForUpdateCheck(); |
2867 | 2841 | ||
2868 | TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); | 2842 | TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); |
2869 | UpdateFlag = UpdateRequired.TERSE; | 2843 | UpdateFlag = UpdateRequired.TERSE; |
@@ -2876,7 +2850,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2876 | 2850 | ||
2877 | public void ScriptSetPhysicsStatus(bool UsePhysics) | 2851 | public void ScriptSetPhysicsStatus(bool UsePhysics) |
2878 | { | 2852 | { |
2879 | m_parentGroup.ScriptSetPhysicsStatus(UsePhysics); | 2853 | ParentGroup.ScriptSetPhysicsStatus(UsePhysics); |
2880 | } | 2854 | } |
2881 | 2855 | ||
2882 | /// <summary> | 2856 | /// <summary> |
@@ -2903,7 +2877,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2903 | // Update the physics actor with the new loaded sculpt data and set the taint signal. | 2877 | // Update the physics actor with the new loaded sculpt data and set the taint signal. |
2904 | PhysActor.Shape = m_shape; | 2878 | PhysActor.Shape = m_shape; |
2905 | 2879 | ||
2906 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 2880 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); |
2907 | } | 2881 | } |
2908 | } | 2882 | } |
2909 | } | 2883 | } |
@@ -2916,7 +2890,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2916 | /// <param name="clientFlags"></param> | 2890 | /// <param name="clientFlags"></param> |
2917 | protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) | 2891 | protected internal void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) |
2918 | { | 2892 | { |
2919 | if (m_parentGroup == null) | 2893 | if (ParentGroup == null) |
2920 | return; | 2894 | return; |
2921 | 2895 | ||
2922 | // m_log.DebugFormat( | 2896 | // m_log.DebugFormat( |
@@ -2924,7 +2898,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2924 | 2898 | ||
2925 | if (IsRoot) | 2899 | if (IsRoot) |
2926 | { | 2900 | { |
2927 | if (m_parentGroup.IsAttachment) | 2901 | if (ParentGroup.IsAttachment) |
2928 | { | 2902 | { |
2929 | SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); | 2903 | SendFullUpdateToClient(remoteClient, AttachedPos, clientFlags); |
2930 | } | 2904 | } |
@@ -2944,10 +2918,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2944 | /// </summary> | 2918 | /// </summary> |
2945 | public void SendFullUpdateToAllClients() | 2919 | public void SendFullUpdateToAllClients() |
2946 | { | 2920 | { |
2947 | if (m_parentGroup == null) | 2921 | if (ParentGroup == null) |
2948 | return; | 2922 | return; |
2949 | 2923 | ||
2950 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 2924 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2951 | { | 2925 | { |
2952 | SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); | 2926 | SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID)); |
2953 | }); | 2927 | }); |
@@ -2959,10 +2933,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2959 | /// <param name="agentID"></param> | 2933 | /// <param name="agentID"></param> |
2960 | public void SendFullUpdateToAllClientsExcept(UUID agentID) | 2934 | public void SendFullUpdateToAllClientsExcept(UUID agentID) |
2961 | { | 2935 | { |
2962 | if (m_parentGroup == null) | 2936 | if (ParentGroup == null) |
2963 | return; | 2937 | return; |
2964 | 2938 | ||
2965 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 2939 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
2966 | { | 2940 | { |
2967 | // Ugly reference :( | 2941 | // Ugly reference :( |
2968 | if (avatar.UUID != agentID) | 2942 | if (avatar.UUID != agentID) |
@@ -3007,7 +2981,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3007 | 2981 | ||
3008 | clientFlags &= ~(uint) PrimFlags.CreateSelected; | 2982 | clientFlags &= ~(uint) PrimFlags.CreateSelected; |
3009 | 2983 | ||
3010 | if (remoteClient.AgentId == _ownerID) | 2984 | if (remoteClient.AgentId == OwnerID) |
3011 | { | 2985 | { |
3012 | if ((Flags & PrimFlags.CreateSelected) != 0) | 2986 | if ((Flags & PrimFlags.CreateSelected) != 0) |
3013 | { | 2987 | { |
@@ -3083,13 +3057,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3083 | if (volume < 0) | 3057 | if (volume < 0) |
3084 | volume = 0; | 3058 | volume = 0; |
3085 | 3059 | ||
3086 | UUID ownerID = _ownerID; | 3060 | UUID ownerID = OwnerID; |
3087 | UUID objectID = ParentGroup.RootPart.UUID; | 3061 | UUID objectID = ParentGroup.RootPart.UUID; |
3088 | UUID parentID = ParentGroup.UUID; | 3062 | UUID parentID = ParentGroup.UUID; |
3089 | 3063 | ||
3090 | UUID soundID = UUID.Zero; | 3064 | UUID soundID = UUID.Zero; |
3091 | Vector3 position = AbsolutePosition; // region local | 3065 | Vector3 position = AbsolutePosition; // region local |
3092 | ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; | 3066 | ulong regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle; |
3093 | 3067 | ||
3094 | if (!UUID.TryParse(sound, out soundID)) | 3068 | if (!UUID.TryParse(sound, out soundID)) |
3095 | { | 3069 | { |
@@ -3110,7 +3084,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3110 | if (soundID == UUID.Zero) | 3084 | if (soundID == UUID.Zero) |
3111 | return; | 3085 | return; |
3112 | 3086 | ||
3113 | ISoundModule soundModule = m_parentGroup.Scene.RequestModuleInterface<ISoundModule>(); | 3087 | ISoundModule soundModule = ParentGroup.Scene.RequestModuleInterface<ISoundModule>(); |
3114 | if (soundModule != null) | 3088 | if (soundModule != null) |
3115 | { | 3089 | { |
3116 | if (useMaster) | 3090 | if (useMaster) |
@@ -3122,7 +3096,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3122 | else | 3096 | else |
3123 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | 3097 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); |
3124 | ParentGroup.PlaySoundMasterPrim = this; | 3098 | ParentGroup.PlaySoundMasterPrim = this; |
3125 | ownerID = _ownerID; | 3099 | ownerID = OwnerID; |
3126 | objectID = ParentGroup.RootPart.UUID; | 3100 | objectID = ParentGroup.RootPart.UUID; |
3127 | parentID = ParentGroup.UUID; | 3101 | parentID = ParentGroup.UUID; |
3128 | position = AbsolutePosition; // region local | 3102 | position = AbsolutePosition; // region local |
@@ -3133,7 +3107,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3133 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); | 3107 | soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); |
3134 | foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) | 3108 | foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) |
3135 | { | 3109 | { |
3136 | ownerID = prim._ownerID; | 3110 | ownerID = prim.OwnerID; |
3137 | objectID = prim.ParentGroup.RootPart.UUID; | 3111 | objectID = prim.ParentGroup.RootPart.UUID; |
3138 | parentID = prim.ParentGroup.UUID; | 3112 | parentID = prim.ParentGroup.UUID; |
3139 | position = prim.AbsolutePosition; // region local | 3113 | position = prim.AbsolutePosition; // region local |
@@ -3166,7 +3140,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3166 | /// </summary> | 3140 | /// </summary> |
3167 | public void SendTerseUpdateToAllClients() | 3141 | public void SendTerseUpdateToAllClients() |
3168 | { | 3142 | { |
3169 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) | 3143 | ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar) |
3170 | { | 3144 | { |
3171 | SendTerseUpdateToClient(avatar.ControllingClient); | 3145 | SendTerseUpdateToClient(avatar.ControllingClient); |
3172 | }); | 3146 | }); |
@@ -3174,7 +3148,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3174 | 3148 | ||
3175 | public void SetAxisRotation(int axis, int rotate) | 3149 | public void SetAxisRotation(int axis, int rotate) |
3176 | { | 3150 | { |
3177 | m_parentGroup.SetAxisRotation(axis, rotate); | 3151 | ParentGroup.SetAxisRotation(axis, rotate); |
3178 | 3152 | ||
3179 | //Cannot use ScriptBaseClass constants as no referance to it currently. | 3153 | //Cannot use ScriptBaseClass constants as no referance to it currently. |
3180 | if (axis == 2)//STATUS_ROTATE_X | 3154 | if (axis == 2)//STATUS_ROTATE_X |
@@ -3197,10 +3171,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3197 | 3171 | ||
3198 | public void SetDieAtEdge(bool p) | 3172 | public void SetDieAtEdge(bool p) |
3199 | { | 3173 | { |
3200 | if (m_parentGroup.IsDeleted) | 3174 | if (ParentGroup.IsDeleted) |
3201 | return; | 3175 | return; |
3202 | 3176 | ||
3203 | m_parentGroup.RootPart.DIE_AT_EDGE = p; | 3177 | ParentGroup.RootPart.DIE_AT_EDGE = p; |
3204 | } | 3178 | } |
3205 | 3179 | ||
3206 | public void SetFloatOnWater(int floatYN) | 3180 | public void SetFloatOnWater(int floatYN) |
@@ -3442,7 +3416,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3442 | 3416 | ||
3443 | public void SetGroup(UUID groupID, IClientAPI client) | 3417 | public void SetGroup(UUID groupID, IClientAPI client) |
3444 | { | 3418 | { |
3445 | _groupID = groupID; | 3419 | GroupID = groupID; |
3446 | if (client != null) | 3420 | if (client != null) |
3447 | SendPropertiesToClient(client); | 3421 | SendPropertiesToClient(client); |
3448 | UpdateFlag = UpdateRequired.FULL; | 3422 | UpdateFlag = UpdateRequired.FULL; |
@@ -3453,13 +3427,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3453 | /// </summary> | 3427 | /// </summary> |
3454 | public void SetParent(SceneObjectGroup parent) | 3428 | public void SetParent(SceneObjectGroup parent) |
3455 | { | 3429 | { |
3456 | m_parentGroup = parent; | 3430 | ParentGroup = parent; |
3457 | } | 3431 | } |
3458 | 3432 | ||
3459 | // Use this for attachments! LocalID should be avatar's localid | 3433 | // Use this for attachments! LocalID should be avatar's localid |
3460 | public void SetParentLocalId(uint localID) | 3434 | public void SetParentLocalId(uint localID) |
3461 | { | 3435 | { |
3462 | _parentID = localID; | 3436 | ParentID = localID; |
3463 | } | 3437 | } |
3464 | 3438 | ||
3465 | public void SetPhysicsAxisRotation() | 3439 | public void SetPhysicsAxisRotation() |
@@ -3467,7 +3441,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3467 | if (PhysActor != null) | 3441 | if (PhysActor != null) |
3468 | { | 3442 | { |
3469 | PhysActor.LockAngularMotion(RotationAxis); | 3443 | PhysActor.LockAngularMotion(RotationAxis); |
3470 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 3444 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); |
3471 | } | 3445 | } |
3472 | } | 3446 | } |
3473 | 3447 | ||
@@ -3515,9 +3489,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3515 | 3489 | ||
3516 | public void StopLookAt() | 3490 | public void StopLookAt() |
3517 | { | 3491 | { |
3518 | m_parentGroup.stopLookAt(); | 3492 | ParentGroup.stopLookAt(); |
3519 | 3493 | ||
3520 | m_parentGroup.ScheduleGroupForTerseUpdate(); | 3494 | ParentGroup.ScheduleGroupForTerseUpdate(); |
3521 | } | 3495 | } |
3522 | 3496 | ||
3523 | /// <summary> | 3497 | /// <summary> |
@@ -3537,10 +3511,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
3537 | 3511 | ||
3538 | public void StopMoveToTarget() | 3512 | public void StopMoveToTarget() |
3539 | { | 3513 | { |
3540 | m_parentGroup.stopMoveToTarget(); | 3514 | ParentGroup.stopMoveToTarget(); |
3541 | 3515 | ||
3542 | m_parentGroup.ScheduleGroupForTerseUpdate(); | 3516 | ParentGroup.ScheduleGroupForTerseUpdate(); |
3543 | //m_parentGroup.ScheduleGroupForFullUpdate(); | 3517 | //ParentGroup.ScheduleGroupForFullUpdate(); |
3544 | } | 3518 | } |
3545 | 3519 | ||
3546 | public void StoreUndoState() | 3520 | public void StoreUndoState() |
@@ -3579,7 +3553,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3579 | // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", | 3553 | // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", |
3580 | // Name, LocalId, forGroup, m_undo.Count); | 3554 | // Name, LocalId, forGroup, m_undo.Count); |
3581 | 3555 | ||
3582 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 3556 | if (ParentGroup.GetSceneMaxUndo() > 0) |
3583 | { | 3557 | { |
3584 | UndoState nUndo = new UndoState(this, forGroup); | 3558 | UndoState nUndo = new UndoState(this, forGroup); |
3585 | 3559 | ||
@@ -3635,7 +3609,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3635 | { | 3609 | { |
3636 | UndoState nUndo = null; | 3610 | UndoState nUndo = null; |
3637 | 3611 | ||
3638 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 3612 | if (ParentGroup.GetSceneMaxUndo() > 0) |
3639 | { | 3613 | { |
3640 | nUndo = new UndoState(this, goback.ForGroup); | 3614 | nUndo = new UndoState(this, goback.ForGroup); |
3641 | } | 3615 | } |
@@ -3667,7 +3641,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3667 | 3641 | ||
3668 | if (gofwd != null) | 3642 | if (gofwd != null) |
3669 | { | 3643 | { |
3670 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 3644 | if (ParentGroup.GetSceneMaxUndo() > 0) |
3671 | { | 3645 | { |
3672 | UndoState nUndo = new UndoState(this, gofwd.ForGroup); | 3646 | UndoState nUndo = new UndoState(this, gofwd.ForGroup); |
3673 | 3647 | ||
@@ -4142,17 +4116,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
4142 | 4116 | ||
4143 | public void TriggerScriptChangedEvent(Changed val) | 4117 | public void TriggerScriptChangedEvent(Changed val) |
4144 | { | 4118 | { |
4145 | if (m_parentGroup != null && m_parentGroup.Scene != null) | 4119 | if (ParentGroup != null && ParentGroup.Scene != null) |
4146 | m_parentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val); | 4120 | ParentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val); |
4147 | } | 4121 | } |
4148 | 4122 | ||
4149 | public void TrimPermissions() | 4123 | public void TrimPermissions() |
4150 | { | 4124 | { |
4151 | _baseMask &= (uint)PermissionMask.All; | 4125 | BaseMask &= (uint)PermissionMask.All; |
4152 | _ownerMask &= (uint)PermissionMask.All; | 4126 | OwnerMask &= (uint)PermissionMask.All; |
4153 | _groupMask &= (uint)PermissionMask.All; | 4127 | GroupMask &= (uint)PermissionMask.All; |
4154 | _everyoneMask &= (uint)PermissionMask.All; | 4128 | EveryoneMask &= (uint)PermissionMask.All; |
4155 | _nextOwnerMask &= (uint)PermissionMask.All; | 4129 | NextOwnerMask &= (uint)PermissionMask.All; |
4156 | } | 4130 | } |
4157 | 4131 | ||
4158 | public void UpdateExtraParam(ushort type, bool inUse, byte[] data) | 4132 | public void UpdateExtraParam(ushort type, bool inUse, byte[] data) |
@@ -4163,7 +4137,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4163 | { | 4137 | { |
4164 | if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero) | 4138 | if (m_shape.SculptEntry && m_shape.SculptTexture != UUID.Zero) |
4165 | { | 4139 | { |
4166 | m_parentGroup.Scene.AssetService.Get(m_shape.SculptTexture.ToString(), this, AssetReceived); | 4140 | ParentGroup.Scene.AssetService.Get(m_shape.SculptTexture.ToString(), this, AssetReceived); |
4167 | } | 4141 | } |
4168 | } | 4142 | } |
4169 | 4143 | ||
@@ -4214,56 +4188,63 @@ namespace OpenSim.Region.Framework.Scenes | |||
4214 | } | 4188 | } |
4215 | } | 4189 | } |
4216 | 4190 | ||
4191 | /// <summary> | ||
4192 | /// Update permissions on the SOP. Should only be called from SOG.UpdatePermissions because the SOG | ||
4193 | /// will handle the client notifications once all of its parts are updated. | ||
4194 | /// </summary> | ||
4195 | /// <param name="AgentID"></param> | ||
4196 | /// <param name="field"></param> | ||
4197 | /// <param name="localID"></param> | ||
4198 | /// <param name="mask"></param> | ||
4199 | /// <param name="addRemTF"></param> | ||
4217 | public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF) | 4200 | public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF) |
4218 | { | 4201 | { |
4219 | bool set = addRemTF == 1; | 4202 | bool set = addRemTF == 1; |
4220 | bool god = m_parentGroup.Scene.Permissions.IsGod(AgentID); | 4203 | bool god = ParentGroup.Scene.Permissions.IsGod(AgentID); |
4221 | 4204 | ||
4222 | uint baseMask = _baseMask; | 4205 | uint baseMask = BaseMask; |
4223 | if (god) | 4206 | if (god) |
4224 | baseMask = 0x7ffffff0; | 4207 | baseMask = 0x7ffffff0; |
4225 | 4208 | ||
4226 | // Are we the owner? | 4209 | // Are we the owner? |
4227 | if ((AgentID == _ownerID) || god) | 4210 | if ((AgentID == OwnerID) || god) |
4228 | { | 4211 | { |
4229 | switch (field) | 4212 | switch (field) |
4230 | { | 4213 | { |
4231 | case 1: | 4214 | case 1: |
4232 | if (god) | 4215 | if (god) |
4233 | { | 4216 | { |
4234 | _baseMask = ApplyMask(_baseMask, set, mask); | 4217 | BaseMask = ApplyMask(BaseMask, set, mask); |
4235 | Inventory.ApplyGodPermissions(_baseMask); | 4218 | Inventory.ApplyGodPermissions(_baseMask); |
4236 | } | 4219 | } |
4237 | 4220 | ||
4238 | break; | 4221 | break; |
4239 | case 2: | 4222 | case 2: |
4240 | _ownerMask = ApplyMask(_ownerMask, set, mask) & | 4223 | OwnerMask = ApplyMask(OwnerMask, set, mask) & |
4241 | baseMask; | 4224 | baseMask; |
4242 | break; | 4225 | break; |
4243 | case 4: | 4226 | case 4: |
4244 | _groupMask = ApplyMask(_groupMask, set, mask) & | 4227 | GroupMask = ApplyMask(GroupMask, set, mask) & |
4245 | baseMask; | 4228 | baseMask; |
4246 | break; | 4229 | break; |
4247 | case 8: | 4230 | case 8: |
4248 | _everyoneMask = ApplyMask(_everyoneMask, set, mask) & | 4231 | EveryoneMask = ApplyMask(EveryoneMask, set, mask) & |
4249 | baseMask; | 4232 | baseMask; |
4250 | break; | 4233 | break; |
4251 | case 16: | 4234 | case 16: |
4252 | _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) & | 4235 | NextOwnerMask = ApplyMask(NextOwnerMask, set, mask) & |
4253 | baseMask; | 4236 | baseMask; |
4254 | // Prevent the client from creating no mod, no copy | 4237 | // Prevent the client from creating no mod, no copy |
4255 | // objects | 4238 | // objects |
4256 | if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) | 4239 | if ((NextOwnerMask & (uint)PermissionMask.Copy) == 0) |
4257 | _nextOwnerMask |= (uint)PermissionMask.Transfer; | 4240 | NextOwnerMask |= (uint)PermissionMask.Transfer; |
4258 | 4241 | ||
4259 | _nextOwnerMask |= (uint)PermissionMask.Move; | 4242 | NextOwnerMask |= (uint)PermissionMask.Move; |
4260 | 4243 | ||
4261 | break; | 4244 | break; |
4262 | } | 4245 | } |
4263 | 4246 | ||
4264 | SendFullUpdateToAllClients(); | 4247 | SendFullUpdateToAllClients(); |
4265 | |||
4266 | SendRootPartPropertiesToClient(AgentID); | ||
4267 | } | 4248 | } |
4268 | } | 4249 | } |
4269 | 4250 | ||
@@ -4272,7 +4253,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4272 | // For now, we use the NINJA naming scheme for identifying joints. | 4253 | // For now, we use the NINJA naming scheme for identifying joints. |
4273 | // In the future, we can support other joint specification schemes such as a | 4254 | // In the future, we can support other joint specification schemes such as a |
4274 | // custom checkbox in the viewer GUI. | 4255 | // custom checkbox in the viewer GUI. |
4275 | if (m_parentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4256 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4276 | { | 4257 | { |
4277 | string hingeString = "hingejoint"; | 4258 | string hingeString = "hingejoint"; |
4278 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); | 4259 | return (Name.Length >= hingeString.Length && Name.Substring(0, hingeString.Length) == hingeString); |
@@ -4288,7 +4269,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4288 | // For now, we use the NINJA naming scheme for identifying joints. | 4269 | // For now, we use the NINJA naming scheme for identifying joints. |
4289 | // In the future, we can support other joint specification schemes such as a | 4270 | // In the future, we can support other joint specification schemes such as a |
4290 | // custom checkbox in the viewer GUI. | 4271 | // custom checkbox in the viewer GUI. |
4291 | if (m_parentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4272 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4292 | { | 4273 | { |
4293 | string ballString = "balljoint"; | 4274 | string ballString = "balljoint"; |
4294 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); | 4275 | return (Name.Length >= ballString.Length && Name.Substring(0, ballString.Length) == ballString); |
@@ -4304,7 +4285,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4304 | // For now, we use the NINJA naming scheme for identifying joints. | 4285 | // For now, we use the NINJA naming scheme for identifying joints. |
4305 | // In the future, we can support other joint specification schemes such as a | 4286 | // In the future, we can support other joint specification schemes such as a |
4306 | // custom checkbox in the viewer GUI. | 4287 | // custom checkbox in the viewer GUI. |
4307 | if (m_parentGroup.Scene.PhysicsScene.SupportsNINJAJoints) | 4288 | if (ParentGroup.Scene.PhysicsScene.SupportsNINJAJoints) |
4308 | { | 4289 | { |
4309 | return IsHingeJoint() || IsBallJoint(); | 4290 | return IsHingeJoint() || IsBallJoint(); |
4310 | } | 4291 | } |
@@ -4370,11 +4351,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
4370 | { | 4351 | { |
4371 | DoPhysicsPropertyUpdate(UsePhysics, false); | 4352 | DoPhysicsPropertyUpdate(UsePhysics, false); |
4372 | 4353 | ||
4373 | if (!m_parentGroup.IsDeleted) | 4354 | if (!ParentGroup.IsDeleted) |
4374 | { | 4355 | { |
4375 | if (LocalId == m_parentGroup.RootPart.LocalId) | 4356 | if (LocalId == ParentGroup.RootPart.LocalId) |
4376 | { | 4357 | { |
4377 | m_parentGroup.CheckSculptAndLoad(); | 4358 | ParentGroup.CheckSculptAndLoad(); |
4378 | } | 4359 | } |
4379 | } | 4360 | } |
4380 | } | 4361 | } |
@@ -4407,7 +4388,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4407 | if (PhysActor == null) | 4388 | if (PhysActor == null) |
4408 | { | 4389 | { |
4409 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it | 4390 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it |
4410 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( | 4391 | PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape( |
4411 | string.Format("{0}/{1}", Name, UUID), | 4392 | string.Format("{0}/{1}", Name, UUID), |
4412 | Shape, | 4393 | Shape, |
4413 | AbsolutePosition, | 4394 | AbsolutePosition, |
@@ -4419,11 +4400,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
4419 | PhysActor.SetMaterial(Material); | 4400 | PhysActor.SetMaterial(Material); |
4420 | DoPhysicsPropertyUpdate(UsePhysics, true); | 4401 | DoPhysicsPropertyUpdate(UsePhysics, true); |
4421 | 4402 | ||
4422 | if (!m_parentGroup.IsDeleted) | 4403 | if (!ParentGroup.IsDeleted) |
4423 | { | 4404 | { |
4424 | if (LocalId == m_parentGroup.RootPart.LocalId) | 4405 | if (LocalId == ParentGroup.RootPart.LocalId) |
4425 | { | 4406 | { |
4426 | m_parentGroup.CheckSculptAndLoad(); | 4407 | ParentGroup.CheckSculptAndLoad(); |
4427 | } | 4408 | } |
4428 | } | 4409 | } |
4429 | 4410 | ||
@@ -4445,11 +4426,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
4445 | { | 4426 | { |
4446 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim | 4427 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. If it's phantom this will remove the prim |
4447 | 4428 | ||
4448 | if (!m_parentGroup.IsDeleted) | 4429 | if (!ParentGroup.IsDeleted) |
4449 | { | 4430 | { |
4450 | if (LocalId == m_parentGroup.RootPart.LocalId) | 4431 | if (LocalId == ParentGroup.RootPart.LocalId) |
4451 | { | 4432 | { |
4452 | m_parentGroup.CheckSculptAndLoad(); | 4433 | ParentGroup.CheckSculptAndLoad(); |
4453 | } | 4434 | } |
4454 | } | 4435 | } |
4455 | } | 4436 | } |
@@ -4561,7 +4542,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4561 | if (PhysActor != null) | 4542 | if (PhysActor != null) |
4562 | { | 4543 | { |
4563 | PhysActor.Shape = m_shape; | 4544 | PhysActor.Shape = m_shape; |
4564 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | 4545 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); |
4565 | } | 4546 | } |
4566 | 4547 | ||
4567 | // This is what makes vehicle trailers work | 4548 | // This is what makes vehicle trailers work |
@@ -4722,18 +4703,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
4722 | 4703 | ||
4723 | //if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) | 4704 | //if ((GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0) |
4724 | //{ | 4705 | //{ |
4725 | // m_parentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; | 4706 | // ParentGroup.Scene.EventManager.OnScriptTimerEvent += handleTimerAccounting; |
4726 | //} | 4707 | //} |
4727 | //else | 4708 | //else |
4728 | //{ | 4709 | //{ |
4729 | // m_parentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting; | 4710 | // ParentGroup.Scene.EventManager.OnScriptTimerEvent -= handleTimerAccounting; |
4730 | //} | 4711 | //} |
4731 | 4712 | ||
4732 | LocalFlags = (PrimFlags)objectflagupdate; | 4713 | LocalFlags = (PrimFlags)objectflagupdate; |
4733 | 4714 | ||
4734 | if (m_parentGroup != null && m_parentGroup.RootPart == this) | 4715 | if (ParentGroup != null && ParentGroup.RootPart == this) |
4735 | { | 4716 | { |
4736 | m_parentGroup.aggregateScriptEvents(); | 4717 | ParentGroup.aggregateScriptEvents(); |
4737 | } | 4718 | } |
4738 | else | 4719 | else |
4739 | { | 4720 | { |
@@ -4801,14 +4782,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
4801 | 4782 | ||
4802 | public void AddScriptLPS(int count) | 4783 | public void AddScriptLPS(int count) |
4803 | { | 4784 | { |
4804 | m_parentGroup.AddScriptLPS(count); | 4785 | ParentGroup.AddScriptLPS(count); |
4805 | } | 4786 | } |
4806 | 4787 | ||
4807 | public void ApplyNextOwnerPermissions() | 4788 | public void ApplyNextOwnerPermissions() |
4808 | { | 4789 | { |
4809 | _baseMask &= _nextOwnerMask; | 4790 | BaseMask &= NextOwnerMask; |
4810 | _ownerMask &= _nextOwnerMask; | 4791 | OwnerMask &= NextOwnerMask; |
4811 | _everyoneMask &= _nextOwnerMask; | 4792 | EveryoneMask &= NextOwnerMask; |
4812 | 4793 | ||
4813 | Inventory.ApplyNextOwnerPermissions(); | 4794 | Inventory.ApplyNextOwnerPermissions(); |
4814 | } | 4795 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e662492..fdf944b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1387,6 +1387,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1387 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) | 1387 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) |
1388 | m_updateCount = UPDATE_COUNT; | 1388 | m_updateCount = UPDATE_COUNT; |
1389 | 1389 | ||
1390 | // Make turning in place work | ||
1391 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 || | ||
1392 | (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) | ||
1393 | m_updateCount = UPDATE_COUNT; | ||
1394 | |||
1390 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) | 1395 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) |
1391 | { | 1396 | { |
1392 | StandUp(); | 1397 | StandUp(); |