diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 |
2 files changed, 24 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index aab6a49..96eeec4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -631,6 +631,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
631 | if (triggerScriptEvent) | 631 | if (triggerScriptEvent) |
632 | part.TriggerScriptChangedEvent(Changed.POSITION); | 632 | part.TriggerScriptChangedEvent(Changed.POSITION); |
633 | } | 633 | } |
634 | |||
635 | /* | ||
636 | This seems not needed and should not be needed: | ||
637 | sp absolute position depends on sit part absolute position fixed above. | ||
638 | sp ParentPosition is not used anywhere. | ||
639 | Since presence is sitting, viewer considers it 'linked' to root prim, so it will move/rotate it | ||
640 | Sending a extra packet with avatar position is not only bandwidth waste, but may cause jitter in viewers due to UPD nature. | ||
641 | |||
634 | if (!m_dupeInProgress) | 642 | if (!m_dupeInProgress) |
635 | { | 643 | { |
636 | foreach (ScenePresence av in m_linkedAvatars) | 644 | foreach (ScenePresence av in m_linkedAvatars) |
@@ -640,12 +648,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
640 | { | 648 | { |
641 | Vector3 offset = p.GetWorldPosition() - av.ParentPosition; | 649 | Vector3 offset = p.GetWorldPosition() - av.ParentPosition; |
642 | av.AbsolutePosition += offset; | 650 | av.AbsolutePosition += offset; |
643 | av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition | 651 | // av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition |
644 | av.SendAvatarDataToAllAgents(); | 652 | av.SendAvatarDataToAllAgents(); |
645 | } | 653 | } |
646 | } | 654 | } |
647 | } | 655 | } |
648 | 656 | */ | |
649 | //if (m_rootPart.PhysActor != null) | 657 | //if (m_rootPart.PhysActor != null) |
650 | //{ | 658 | //{ |
651 | //m_rootPart.PhysActor.Position = | 659 | //m_rootPart.PhysActor.Position = |
@@ -676,8 +684,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
676 | if (agent.ParentUUID != UUID.Zero) | 684 | if (agent.ParentUUID != UUID.Zero) |
677 | { | 685 | { |
678 | agent.ParentPart = null; | 686 | agent.ParentPart = null; |
679 | agent.ParentPosition = Vector3.Zero; | 687 | // agent.ParentPosition = Vector3.Zero; |
680 | // agent.ParentUUID = UUID.Zero; | 688 | // agent.ParentUUID = UUID.Zero; |
681 | } | 689 | } |
682 | } | 690 | } |
683 | 691 | ||
@@ -3752,7 +3760,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3752 | else | 3760 | else |
3753 | // ugly rotation update of all parts | 3761 | // ugly rotation update of all parts |
3754 | { | 3762 | { |
3755 | group.AbsolutePosition = AbsolutePosition; | 3763 | group.ResetChildPrimPhysicsPositions(); |
3756 | } | 3764 | } |
3757 | 3765 | ||
3758 | } | 3766 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 87b4d9f..a068aab 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -433,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
433 | get { return (IClientCore)ControllingClient; } | 433 | get { return (IClientCore)ControllingClient; } |
434 | } | 434 | } |
435 | 435 | ||
436 | public Vector3 ParentPosition { get; set; } | 436 | // public Vector3 ParentPosition { get; set; } |
437 | 437 | ||
438 | /// <summary> | 438 | /// <summary> |
439 | /// Position of this avatar relative to the region the avatar is in | 439 | /// Position of this avatar relative to the region the avatar is in |
@@ -491,7 +491,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
491 | if (ParentID == 0) | 491 | if (ParentID == 0) |
492 | { | 492 | { |
493 | m_pos = value; | 493 | m_pos = value; |
494 | ParentPosition = Vector3.Zero; | 494 | // ParentPosition = Vector3.Zero; |
495 | } | 495 | } |
496 | 496 | ||
497 | //m_log.DebugFormat( | 497 | //m_log.DebugFormat( |
@@ -857,11 +857,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
857 | part.ParentGroup.AddAvatar(UUID); | 857 | part.ParentGroup.AddAvatar(UUID); |
858 | if (part.SitTargetPosition != Vector3.Zero) | 858 | if (part.SitTargetPosition != Vector3.Zero) |
859 | part.SitTargetAvatar = UUID; | 859 | part.SitTargetAvatar = UUID; |
860 | ParentPosition = part.GetWorldPosition(); | 860 | // ParentPosition = part.GetWorldPosition(); |
861 | ParentID = part.LocalId; | 861 | ParentID = part.LocalId; |
862 | ParentPart = part; | 862 | ParentPart = part; |
863 | m_pos = m_prevSitOffset; | 863 | m_pos = m_prevSitOffset; |
864 | pos = ParentPosition; | 864 | // pos = ParentPosition; |
865 | pos = part.GetWorldPosition(); | ||
865 | } | 866 | } |
866 | ParentUUID = UUID.Zero; | 867 | ParentUUID = UUID.Zero; |
867 | 868 | ||
@@ -1933,11 +1934,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1933 | part.SitTargetAvatar = UUID.Zero; | 1934 | part.SitTargetAvatar = UUID.Zero; |
1934 | 1935 | ||
1935 | part.ParentGroup.DeleteAvatar(UUID); | 1936 | part.ParentGroup.DeleteAvatar(UUID); |
1936 | ParentPosition = part.GetWorldPosition(); | 1937 | // ParentPosition = part.GetWorldPosition(); |
1937 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); | 1938 | ControllingClient.SendClearFollowCamProperties(part.ParentUUID); |
1938 | 1939 | ||
1939 | m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); | 1940 | // m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); |
1940 | ParentPosition = Vector3.Zero; | 1941 | // ParentPosition = Vector3.Zero; |
1942 | m_pos += part.GetWorldPosition() + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); | ||
1941 | 1943 | ||
1942 | ParentID = 0; | 1944 | ParentID = 0; |
1943 | ParentPart = null; | 1945 | ParentPart = null; |
@@ -2388,13 +2390,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2388 | 2390 | ||
2389 | // m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset; | 2391 | // m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset; |
2390 | Rotation = sitTargetOrient; | 2392 | Rotation = sitTargetOrient; |
2391 | ParentPosition = part.AbsolutePosition; | 2393 | // ParentPosition = part.AbsolutePosition; |
2392 | part.ParentGroup.AddAvatar(UUID); | 2394 | part.ParentGroup.AddAvatar(UUID); |
2393 | } | 2395 | } |
2394 | else | 2396 | else |
2395 | { | 2397 | { |
2396 | m_pos -= part.AbsolutePosition; | 2398 | m_pos -= part.AbsolutePosition; |
2397 | ParentPosition = part.AbsolutePosition; | 2399 | // ParentPosition = part.AbsolutePosition; |
2398 | part.ParentGroup.AddAvatar(UUID); | 2400 | part.ParentGroup.AddAvatar(UUID); |
2399 | 2401 | ||
2400 | // m_log.DebugFormat( | 2402 | // m_log.DebugFormat( |