diff options
author | Melanie | 2010-06-09 16:48:37 +0100 |
---|---|---|
committer | Melanie | 2010-06-09 16:48:37 +0100 |
commit | 6b2d2413f7026c41e7abb55c72c583670cb6011d (patch) | |
tree | 6596f0132d36f74f2e57c9b1bd891d95eb0e5a33 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
parent | Add the BEGIN; I had missed (diff) | |
download | opensim-SC-6b2d2413f7026c41e7abb55c72c583670cb6011d.zip opensim-SC-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.gz opensim-SC-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.bz2 opensim-SC-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 56 |
1 files changed, 5 insertions, 51 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e3bbe8a..8cd3ac6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
66 | public ScriptControlled eventControls; | 66 | public ScriptControlled eventControls; |
67 | } | 67 | } |
68 | 68 | ||
69 | public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence); | 69 | public delegate void SendCourseLocationsMethod(UUID scene, ScenePresence presence, List<Vector3> coarseLocations, List<UUID> avatarUUIDs); |
70 | 70 | ||
71 | public class ScenePresence : EntityBase, ISceneEntity | 71 | public class ScenePresence : EntityBase, ISceneEntity |
72 | { | 72 | { |
@@ -178,8 +178,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
178 | 178 | ||
179 | public string JID = String.Empty; | 179 | public string JID = String.Empty; |
180 | 180 | ||
181 | // Agent moves with a PID controller causing a force to be exerted. | ||
182 | private bool m_newCoarseLocations = true; | ||
183 | private float m_health = 100f; | 181 | private float m_health = 100f; |
184 | 182 | ||
185 | // Default AV Height | 183 | // Default AV Height |
@@ -2548,12 +2546,6 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2548 | 2546 | ||
2549 | 2547 | ||
2550 | 2548 | ||
2551 | if (m_newCoarseLocations) | ||
2552 | { | ||
2553 | SendCoarseLocations(); | ||
2554 | m_newCoarseLocations = false; | ||
2555 | } | ||
2556 | |||
2557 | if (m_isChildAgent == false) | 2549 | if (m_isChildAgent == false) |
2558 | { | 2550 | { |
2559 | // PhysicsActor actor = m_physicsActor; | 2551 | // PhysicsActor actor = m_physicsActor; |
@@ -2630,12 +2622,12 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2630 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 2622 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |
2631 | } | 2623 | } |
2632 | 2624 | ||
2633 | public void SendCoarseLocations() | 2625 | public void SendCoarseLocations(List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
2634 | { | 2626 | { |
2635 | SendCourseLocationsMethod d = m_sendCourseLocationsMethod; | 2627 | SendCourseLocationsMethod d = m_sendCourseLocationsMethod; |
2636 | if (d != null) | 2628 | if (d != null) |
2637 | { | 2629 | { |
2638 | d.Invoke(m_scene.RegionInfo.originRegionID, this); | 2630 | d.Invoke(m_scene.RegionInfo.originRegionID, this, coarseLocations, avatarUUIDs); |
2639 | } | 2631 | } |
2640 | } | 2632 | } |
2641 | 2633 | ||
@@ -2645,50 +2637,13 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2645 | m_sendCourseLocationsMethod = d; | 2637 | m_sendCourseLocationsMethod = d; |
2646 | } | 2638 | } |
2647 | 2639 | ||
2648 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p) | 2640 | public void SendCoarseLocationsDefault(UUID sceneId, ScenePresence p, List<Vector3> coarseLocations, List<UUID> avatarUUIDs) |
2649 | { | 2641 | { |
2650 | m_perfMonMS = Util.EnvironmentTickCount(); | 2642 | m_perfMonMS = Util.EnvironmentTickCount(); |
2651 | 2643 | m_controllingClient.SendCoarseLocationUpdate(avatarUUIDs, coarseLocations); | |
2652 | List<Vector3> CoarseLocations = new List<Vector3>(); | ||
2653 | List<UUID> AvatarUUIDs = new List<UUID>(); | ||
2654 | m_scene.ForEachScenePresence(delegate(ScenePresence sp) | ||
2655 | { | ||
2656 | if (sp.IsChildAgent) | ||
2657 | return; | ||
2658 | |||
2659 | if (sp.ParentID != 0) | ||
2660 | { | ||
2661 | // sitting avatar | ||
2662 | SceneObjectPart sop = m_scene.GetSceneObjectPart(sp.ParentID); | ||
2663 | if (sop != null) | ||
2664 | { | ||
2665 | CoarseLocations.Add(sop.AbsolutePosition + sp.m_pos); | ||
2666 | AvatarUUIDs.Add(sp.UUID); | ||
2667 | } | ||
2668 | else | ||
2669 | { | ||
2670 | // we can't find the parent.. ! arg! | ||
2671 | CoarseLocations.Add(sp.m_pos); | ||
2672 | AvatarUUIDs.Add(sp.UUID); | ||
2673 | } | ||
2674 | } | ||
2675 | else | ||
2676 | { | ||
2677 | CoarseLocations.Add(sp.m_pos); | ||
2678 | AvatarUUIDs.Add(sp.UUID); | ||
2679 | } | ||
2680 | }); | ||
2681 | |||
2682 | m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations); | ||
2683 | |||
2684 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); | 2644 | m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); |
2685 | } | 2645 | } |
2686 | 2646 | ||
2687 | public void CoarseLocationChange() | ||
2688 | { | ||
2689 | m_newCoarseLocations = true; | ||
2690 | } | ||
2691 | |||
2692 | /// <summary> | 2647 | /// <summary> |
2693 | /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) | 2648 | /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) |
2694 | /// </summary> | 2649 | /// </summary> |
@@ -2923,7 +2878,6 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); | |||
2923 | { | 2878 | { |
2924 | posLastSignificantMove = AbsolutePosition; | 2879 | posLastSignificantMove = AbsolutePosition; |
2925 | m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); | 2880 | m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); |
2926 | m_scene.NotifyMyCoarseLocationChange(); | ||
2927 | } | 2881 | } |
2928 | 2882 | ||
2929 | // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m | 2883 | // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m |