diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 8198481..f2353b9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -494,11 +494,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
494 | } | 494 | } |
495 | 495 | ||
496 | private ulong m_rootRegionHandle; | 496 | private ulong m_rootRegionHandle; |
497 | private Vector3 m_rootRegionPosition = new Vector3(); | ||
497 | 498 | ||
498 | public ulong RegionHandle | 499 | public ulong RegionHandle |
499 | { | 500 | { |
500 | get { return m_rootRegionHandle; } | 501 | get { return m_rootRegionHandle; } |
501 | private set { m_rootRegionHandle = value; } | 502 | private set |
503 | { | ||
504 | m_rootRegionHandle = value; | ||
505 | // position rounded to lower multiple of 256m | ||
506 | m_rootRegionPosition.X = (float)((m_rootRegionHandle >> 32) & 0xffffff00); | ||
507 | m_rootRegionPosition.Y = (float)(m_rootRegionHandle & 0xffffff00); | ||
508 | } | ||
502 | } | 509 | } |
503 | 510 | ||
504 | #region Client Camera | 511 | #region Client Camera |
@@ -3798,6 +3805,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3798 | m_lastChildAgentUpdatePosition = AbsolutePosition; | 3805 | m_lastChildAgentUpdatePosition = AbsolutePosition; |
3799 | // m_lastChildAgentUpdateCamPosition = CameraPosition; | 3806 | // m_lastChildAgentUpdateCamPosition = CameraPosition; |
3800 | 3807 | ||
3808 | /* cadu is not used | ||
3801 | ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); | 3809 | ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); |
3802 | cadu.ActiveGroupID = UUID.Zero.Guid; | 3810 | cadu.ActiveGroupID = UUID.Zero.Guid; |
3803 | cadu.AgentID = UUID.Guid; | 3811 | cadu.AgentID = UUID.Guid; |
@@ -3812,10 +3820,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3812 | // Throttles | 3820 | // Throttles |
3813 | float multiplier = 1; | 3821 | float multiplier = 1; |
3814 | 3822 | ||
3815 | /* dont messup throttles | ||
3816 | * child agent is a full presence that can be just a few meters away across border | ||
3817 | * sending this is possible wrong since viewers may send own needs to each region | ||
3818 | * | ||
3819 | int childRegions = KnownRegionCount; | 3823 | int childRegions = KnownRegionCount; |
3820 | if (childRegions != 0) | 3824 | if (childRegions != 0) |
3821 | multiplier = 1f / childRegions; | 3825 | multiplier = 1f / childRegions; |
@@ -3823,12 +3827,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
3823 | // Minimum throttle for a child region is 1/4 of the root region throttle | 3827 | // Minimum throttle for a child region is 1/4 of the root region throttle |
3824 | if (multiplier <= 0.25f) | 3828 | if (multiplier <= 0.25f) |
3825 | multiplier = 0.25f; | 3829 | multiplier = 0.25f; |
3826 | */ | 3830 | |
3827 | cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); | 3831 | cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); |
3828 | cadu.Velocity = Velocity; | 3832 | cadu.Velocity = Velocity; |
3829 | 3833 | */ | |
3830 | AgentPosition agentpos = new AgentPosition(); | 3834 | AgentPosition agentpos = new AgentPosition(); |
3831 | agentpos.CopyFrom(cadu, ControllingClient.SessionId); | 3835 | // agentpos.CopyFrom(cadu, ControllingClient.SessionId); |
3836 | |||
3837 | agentpos.AgentID = new UUID(UUID.Guid); | ||
3838 | agentpos.SessionID = ControllingClient.SessionId; | ||
3839 | |||
3840 | agentpos.Size = Appearance.AvatarSize; | ||
3841 | |||
3842 | agentpos.Center = CameraPosition; | ||
3843 | agentpos.Far = DrawDistance; | ||
3844 | agentpos.Position = AbsolutePosition; | ||
3845 | agentpos.Velocity = Velocity; | ||
3846 | agentpos.RegionHandle = RegionHandle; | ||
3847 | agentpos.Throttles = ControllingClient.GetThrottlesPacked(1); | ||
3848 | |||
3832 | 3849 | ||
3833 | // Let's get this out of the update loop | 3850 | // Let's get this out of the update loop |
3834 | Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); }); | 3851 | Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); }); |
@@ -4131,6 +4148,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4131 | if (!IsChildAgent) | 4148 | if (!IsChildAgent) |
4132 | return; | 4149 | return; |
4133 | 4150 | ||
4151 | RegionHandle = cAgentData.RegionHandle; | ||
4152 | |||
4134 | //m_log.Debug(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY); | 4153 | //m_log.Debug(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY); |
4135 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; | 4154 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; |
4136 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; | 4155 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; |
@@ -4158,7 +4177,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4158 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | 4177 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); |
4159 | 4178 | ||
4160 | //cAgentData.AVHeight; | 4179 | //cAgentData.AVHeight; |
4161 | RegionHandle = cAgentData.RegionHandle; | ||
4162 | //m_velocity = cAgentData.Velocity; | 4180 | //m_velocity = cAgentData.Velocity; |
4163 | } | 4181 | } |
4164 | 4182 | ||