diff options
Merge branch 'master' into presence-refactor
This was a large, heavily conflicted merge and things MAY have got broken.
Please check!
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index afb5b9a..29f607b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -104,6 +104,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
104 | } | 104 | } |
105 | protected ScenePresenceAnimator m_animator; | 105 | protected ScenePresenceAnimator m_animator; |
106 | 106 | ||
107 | protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); | ||
108 | |||
107 | private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>(); | 109 | private Dictionary<UUID, ScriptControllers> scriptedcontrols = new Dictionary<UUID, ScriptControllers>(); |
108 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; | 110 | private ScriptControlled IgnoredControls = ScriptControlled.CONTROL_ZERO; |
109 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; | 111 | private ScriptControlled LastCommands = ScriptControlled.CONTROL_ZERO; |
@@ -217,7 +219,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
217 | 219 | ||
218 | protected AvatarAppearance m_appearance; | 220 | protected AvatarAppearance m_appearance; |
219 | 221 | ||
220 | protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>(); | ||
221 | public List<SceneObjectGroup> Attachments | 222 | public List<SceneObjectGroup> Attachments |
222 | { | 223 | { |
223 | get { return m_attachments; } | 224 | get { return m_attachments; } |
@@ -636,12 +637,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
636 | #endregion | 637 | #endregion |
637 | 638 | ||
638 | #region Constructor(s) | 639 | #region Constructor(s) |
639 | 640 | ||
640 | private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) | 641 | public ScenePresence() |
641 | { | 642 | { |
642 | m_animator = new ScenePresenceAnimator(this); | ||
643 | m_sendCourseLocationsMethod = SendCoarseLocationsDefault; | 643 | m_sendCourseLocationsMethod = SendCoarseLocationsDefault; |
644 | CreateSceneViewer(); | 644 | CreateSceneViewer(); |
645 | m_animator = new ScenePresenceAnimator(this); | ||
646 | } | ||
647 | |||
648 | private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() | ||
649 | { | ||
645 | m_rootRegionHandle = reginfo.RegionHandle; | 650 | m_rootRegionHandle = reginfo.RegionHandle; |
646 | m_controllingClient = client; | 651 | m_controllingClient = client; |
647 | m_firstname = m_controllingClient.FirstName; | 652 | m_firstname = m_controllingClient.FirstName; |
@@ -665,7 +670,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
665 | m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize); | 670 | m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize); |
666 | m_reprioritization_timer.AutoReset = false; | 671 | m_reprioritization_timer.AutoReset = false; |
667 | 672 | ||
668 | |||
669 | AdjustKnownSeeds(); | 673 | AdjustKnownSeeds(); |
670 | 674 | ||
671 | // TODO: I think, this won't send anything, as we are still a child here... | 675 | // TODO: I think, this won't send anything, as we are still a child here... |
@@ -1294,6 +1298,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1294 | 1298 | ||
1295 | if (m_allowMovement) | 1299 | if (m_allowMovement) |
1296 | { | 1300 | { |
1301 | if (agentData.UseClientAgentPosition) | ||
1302 | { | ||
1303 | m_moveToPositionInProgress = (agentData.ClientAgentPosition - AbsolutePosition).Length() > 0.2f; | ||
1304 | m_moveToPositionTarget = agentData.ClientAgentPosition; | ||
1305 | } | ||
1306 | |||
1297 | int i = 0; | 1307 | int i = 0; |
1298 | 1308 | ||
1299 | bool update_rotation = false; | 1309 | bool update_rotation = false; |
@@ -1400,7 +1410,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1400 | if (bAllowUpdateMoveToPosition && (m_moveToPositionInProgress && !m_autopilotMoving)) | 1410 | if (bAllowUpdateMoveToPosition && (m_moveToPositionInProgress && !m_autopilotMoving)) |
1401 | { | 1411 | { |
1402 | //Check the error term of the current position in relation to the target position | 1412 | //Check the error term of the current position in relation to the target position |
1403 | if (Util.GetDistanceTo(AbsolutePosition, m_moveToPositionTarget) <= 1.5f) | 1413 | if (Util.GetDistanceTo(AbsolutePosition, m_moveToPositionTarget) <= 0.5f) |
1404 | { | 1414 | { |
1405 | // we are close enough to the target | 1415 | // we are close enough to the target |
1406 | m_moveToPositionTarget = Vector3.Zero; | 1416 | m_moveToPositionTarget = Vector3.Zero; |
@@ -2795,7 +2805,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2795 | protected void CrossToNewRegion() | 2805 | protected void CrossToNewRegion() |
2796 | { | 2806 | { |
2797 | InTransit(); | 2807 | InTransit(); |
2798 | m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); | 2808 | try |
2809 | { | ||
2810 | m_scene.CrossAgentToNewRegion(this, m_physicsActor.Flying); | ||
2811 | } | ||
2812 | catch | ||
2813 | { | ||
2814 | m_scene.CrossAgentToNewRegion(this, false); | ||
2815 | } | ||
2799 | } | 2816 | } |
2800 | 2817 | ||
2801 | public void InTransit() | 2818 | public void InTransit() |
@@ -2873,7 +2890,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2873 | { | 2890 | { |
2874 | RemoveNeighbourRegion(handle); | 2891 | RemoveNeighbourRegion(handle); |
2875 | } | 2892 | } |
2876 | |||
2877 | } | 2893 | } |
2878 | 2894 | ||
2879 | #endregion | 2895 | #endregion |
@@ -3037,7 +3053,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3037 | List<int> attPoints = m_appearance.GetAttachedPoints(); | 3053 | List<int> attPoints = m_appearance.GetAttachedPoints(); |
3038 | if (attPoints != null) | 3054 | if (attPoints != null) |
3039 | { | 3055 | { |
3040 | m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); | 3056 | //m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); |
3041 | int i = 0; | 3057 | int i = 0; |
3042 | AttachmentData[] attachs = new AttachmentData[attPoints.Count]; | 3058 | AttachmentData[] attachs = new AttachmentData[attPoints.Count]; |
3043 | foreach (int point in attPoints) | 3059 | foreach (int point in attPoints) |
@@ -3261,17 +3277,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3261 | uint killerObj = 0; | 3277 | uint killerObj = 0; |
3262 | foreach (uint localid in coldata.Keys) | 3278 | foreach (uint localid in coldata.Keys) |
3263 | { | 3279 | { |
3264 | if (coldata[localid].PenetrationDepth <= 0.10f || m_invulnerable) | 3280 | SceneObjectPart part = Scene.GetSceneObjectPart(localid); |
3265 | continue; | ||
3266 | //if (localid == 0) | ||
3267 | //continue; | ||
3268 | |||
3269 | SceneObjectPart part = m_scene.GetSceneObjectPart(localid); | ||
3270 | 3281 | ||
3271 | if (part != null && part.ParentGroup.Damage != -1.0f) | 3282 | if (part != null && part.ParentGroup.Damage != -1.0f) |
3272 | Health -= part.ParentGroup.Damage; | 3283 | Health -= part.ParentGroup.Damage; |
3273 | else | 3284 | else |
3274 | Health -= coldata[localid].PenetrationDepth * 5.0f; | 3285 | { |
3286 | if (coldata[localid].PenetrationDepth >= 0.10f) | ||
3287 | Health -= coldata[localid].PenetrationDepth * 5.0f; | ||
3288 | } | ||
3275 | 3289 | ||
3276 | if (Health <= 0.0f) | 3290 | if (Health <= 0.0f) |
3277 | { | 3291 | { |
@@ -3289,9 +3303,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3289 | } | 3303 | } |
3290 | if (m_health <= 0) | 3304 | if (m_health <= 0) |
3291 | m_scene.EventManager.TriggerAvatarKill(killerObj, this); | 3305 | m_scene.EventManager.TriggerAvatarKill(killerObj, this); |
3292 | } | 3306 | } |
3293 | |||
3294 | |||
3295 | } | 3307 | } |
3296 | 3308 | ||
3297 | public void setHealthWithUpdate(float health) | 3309 | public void setHealthWithUpdate(float health) |
@@ -3338,13 +3350,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3338 | m_animator = null; | 3350 | m_animator = null; |
3339 | } | 3351 | } |
3340 | 3352 | ||
3341 | public ScenePresence() | ||
3342 | { | ||
3343 | m_sendCourseLocationsMethod = SendCoarseLocationsDefault; | ||
3344 | CreateSceneViewer(); | ||
3345 | m_animator = new ScenePresenceAnimator(this); | ||
3346 | } | ||
3347 | |||
3348 | public void AddAttachment(SceneObjectGroup gobj) | 3353 | public void AddAttachment(SceneObjectGroup gobj) |
3349 | { | 3354 | { |
3350 | lock (m_attachments) | 3355 | lock (m_attachments) |
@@ -3843,4 +3848,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
3843 | } | 3848 | } |
3844 | } | 3849 | } |
3845 | } | 3850 | } |
3846 | } \ No newline at end of file | 3851 | } |