diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 387db44..a5b88c6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -403,12 +403,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
403 | set { m_parentPosition = value; } | 403 | set { m_parentPosition = value; } |
404 | } | 404 | } |
405 | 405 | ||
406 | public int MaxPrimsPerFrame | ||
407 | { | ||
408 | get { return m_sceneViewer.MaxPrimsPerFrame; } | ||
409 | set { m_sceneViewer.MaxPrimsPerFrame = value; } | ||
410 | } | ||
411 | |||
412 | /// <summary> | 406 | /// <summary> |
413 | /// Absolute position of this avatar in 'region cordinates' | 407 | /// Absolute position of this avatar in 'region cordinates' |
414 | /// </summary> | 408 | /// </summary> |
@@ -2457,8 +2451,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2457 | Vector3 pos = m_pos; | 2451 | Vector3 pos = m_pos; |
2458 | pos.Z -= m_appearance.HipOffset; | 2452 | pos.Z -= m_appearance.HipOffset; |
2459 | 2453 | ||
2460 | remoteClient.SendAvatarTerseUpdate(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), | 2454 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, |
2461 | LocalId, pos, Velocity, m_bodyRot, m_uuid); | 2455 | pos, m_velocity, m_rotation, m_uuid, GetUpdatePriority(remoteClient))); |
2462 | 2456 | ||
2463 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2457 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2464 | m_scene.StatsReporter.AddAgentUpdates(1); | 2458 | m_scene.StatsReporter.AddAgentUpdates(1); |
@@ -2563,9 +2557,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2563 | Vector3 pos = m_pos; | 2557 | Vector3 pos = m_pos; |
2564 | pos.Z -= m_appearance.HipOffset; | 2558 | pos.Z -= m_appearance.HipOffset; |
2565 | 2559 | ||
2566 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, | 2560 | remoteAvatar.m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, |
2567 | LocalId, m_pos, m_appearance.Texture.GetBytes(), | 2561 | LocalId, m_pos, m_appearance.Texture.GetBytes(), |
2568 | m_parentID, rot); | 2562 | m_parentID, rot)); |
2569 | m_scene.StatsReporter.AddAgentUpdates(1); | 2563 | m_scene.StatsReporter.AddAgentUpdates(1); |
2570 | } | 2564 | } |
2571 | 2565 | ||
@@ -2634,8 +2628,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2634 | Vector3 pos = m_pos; | 2628 | Vector3 pos = m_pos; |
2635 | pos.Z -= m_appearance.HipOffset; | 2629 | pos.Z -= m_appearance.HipOffset; |
2636 | 2630 | ||
2637 | m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, | 2631 | m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, |
2638 | m_pos, m_appearance.Texture.GetBytes(), m_parentID, rot); | 2632 | m_pos, m_appearance.Texture.GetBytes(), m_parentID, rot)); |
2639 | 2633 | ||
2640 | if (!m_isChildAgent) | 2634 | if (!m_isChildAgent) |
2641 | { | 2635 | { |
@@ -2741,8 +2735,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2741 | } | 2735 | } |
2742 | 2736 | ||
2743 | Quaternion rot = m_bodyRot; | 2737 | Quaternion rot = m_bodyRot; |
2744 | m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, | 2738 | m_controllingClient.SendAvatarData(new SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_grouptitle, m_uuid, LocalId, |
2745 | m_pos, m_appearance.Texture.GetBytes(), m_parentID, rot); | 2739 | m_pos, m_appearance.Texture.GetBytes(), m_parentID, rot)); |
2746 | 2740 | ||
2747 | } | 2741 | } |
2748 | 2742 | ||
@@ -3870,5 +3864,41 @@ namespace OpenSim.Region.Framework.Scenes | |||
3870 | } | 3864 | } |
3871 | } | 3865 | } |
3872 | } | 3866 | } |
3867 | |||
3868 | public double GetUpdatePriority(IClientAPI client) | ||
3869 | { | ||
3870 | switch (Scene.UpdatePrioritizationScheme) | ||
3871 | { | ||
3872 | case Scene.UpdatePrioritizationSchemes.Time: | ||
3873 | return GetPriorityByTime(); | ||
3874 | case Scene.UpdatePrioritizationSchemes.Distance: | ||
3875 | return GetPriorityByDistance(client); | ||
3876 | case Scene.UpdatePrioritizationSchemes.SimpleAngularDistance: | ||
3877 | return GetPriorityByDistance(client); | ||
3878 | default: | ||
3879 | throw new InvalidOperationException("UpdatePrioritizationScheme not defined."); | ||
3880 | } | ||
3881 | } | ||
3882 | |||
3883 | private double GetPriorityByTime() | ||
3884 | { | ||
3885 | return DateTime.Now.ToOADate(); | ||
3886 | } | ||
3887 | |||
3888 | private double GetPriorityByDistance(IClientAPI client) | ||
3889 | { | ||
3890 | ScenePresence presence = Scene.GetScenePresence(client.AgentId); | ||
3891 | if (presence != null) | ||
3892 | { | ||
3893 | return GetPriorityByDistance((presence.IsChildAgent) ? | ||
3894 | presence.AbsolutePosition : presence.CameraPosition); | ||
3895 | } | ||
3896 | return double.NaN; | ||
3897 | } | ||
3898 | |||
3899 | private double GetPriorityByDistance(Vector3 position) | ||
3900 | { | ||
3901 | return Vector3.Distance(AbsolutePosition, position); | ||
3902 | } | ||
3873 | } | 3903 | } |
3874 | } | 3904 | } |