diff options
author | UbitUmarov | 2017-06-03 07:08:43 +0100 |
---|---|---|
committer | UbitUmarov | 2017-06-03 07:08:43 +0100 |
commit | 01bd578bb06643418a0586eb078a04d8e9e4a79d (patch) | |
tree | 5bf00ab4b131584daa0edec145dd23b67ee343ea /OpenSim/Region | |
parent | Merge branch 'master' into httptests (diff) | |
parent | add a delayed stop so fast tap on move keys does not stop the avatar in some ... (diff) | |
download | opensim-SC-01bd578bb06643418a0586eb078a04d8e9e4a79d.zip opensim-SC-01bd578bb06643418a0586eb078a04d8e9e4a79d.tar.gz opensim-SC-01bd578bb06643418a0586eb078a04d8e9e4a79d.tar.bz2 opensim-SC-01bd578bb06643418a0586eb078a04d8e9e4a79d.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 71 |
2 files changed, 51 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 439f79d..826cda1 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2120,7 +2120,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2120 | lock (m_returns) | 2120 | lock (m_returns) |
2121 | { | 2121 | { |
2122 | EventManager.TriggerOnBackup(SimulationDataService, forced); | 2122 | EventManager.TriggerOnBackup(SimulationDataService, forced); |
2123 | m_backingup = false; | ||
2124 | 2123 | ||
2125 | foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns) | 2124 | foreach (KeyValuePair<UUID, ReturnInfo> ret in m_returns) |
2126 | { | 2125 | { |
@@ -2151,6 +2150,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2151 | tr.SendInstantMessage(msg, delegate(bool success) { }); | 2150 | tr.SendInstantMessage(msg, delegate(bool success) { }); |
2152 | } | 2151 | } |
2153 | m_returns.Clear(); | 2152 | m_returns.Clear(); |
2153 | m_backingup = false; | ||
2154 | } | 2154 | } |
2155 | } | 2155 | } |
2156 | 2156 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f1e27a5..ed9cf53 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -364,6 +364,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
364 | //PauPaw:Proper PID Controler for autopilot************ | 364 | //PauPaw:Proper PID Controler for autopilot************ |
365 | public bool MovingToTarget { get; private set; } | 365 | public bool MovingToTarget { get; private set; } |
366 | public Vector3 MoveToPositionTarget { get; private set; } | 366 | public Vector3 MoveToPositionTarget { get; private set; } |
367 | private double m_delayedStop = -1.0; | ||
367 | 368 | ||
368 | /// <summary> | 369 | /// <summary> |
369 | /// Controls whether an avatar automatically moving to a target will land when it gets there (if flying). | 370 | /// Controls whether an avatar automatically moving to a target will land when it gets there (if flying). |
@@ -2732,7 +2733,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2732 | agent_control_v3.Z = 0; | 2733 | agent_control_v3.Z = 0; |
2733 | // else if(AgentControlStopActive %% Velocity.Z <0.01f) | 2734 | // else if(AgentControlStopActive %% Velocity.Z <0.01f) |
2734 | 2735 | ||
2735 | |||
2736 | // m_log.DebugFormat("[SCENE PRESENCE]: MovementFlag {0} for {1}", MovementFlag, Name); | 2736 | // m_log.DebugFormat("[SCENE PRESENCE]: MovementFlag {0} for {1}", MovementFlag, Name); |
2737 | 2737 | ||
2738 | // If the agent update does move the avatar, then calculate the force ready for the velocity update, | 2738 | // If the agent update does move the avatar, then calculate the force ready for the velocity update, |
@@ -2741,6 +2741,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2741 | // held down AGENT_CONTROL_STOP whilst normal walking/running). However, we do not want to update | 2741 | // held down AGENT_CONTROL_STOP whilst normal walking/running). However, we do not want to update |
2742 | // if the user rotated whilst holding down AGENT_CONTROL_STOP when already still (which locks the | 2742 | // if the user rotated whilst holding down AGENT_CONTROL_STOP when already still (which locks the |
2743 | // avatar location in place). | 2743 | // avatar location in place). |
2744 | |||
2744 | if (update_movementflag | 2745 | if (update_movementflag |
2745 | || (update_rotation && DCFlagKeyPressed && (!AgentControlStopActive || MovementFlag != 0))) | 2746 | || (update_rotation && DCFlagKeyPressed && (!AgentControlStopActive || MovementFlag != 0))) |
2746 | { | 2747 | { |
@@ -2757,12 +2758,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
2757 | } | 2758 | } |
2758 | else | 2759 | else |
2759 | { | 2760 | { |
2760 | AddNewMovement(agent_control_v3); | 2761 | if(MovingToTarget || |
2762 | (Animator.currentControlState != ScenePresenceAnimator.motionControlStates.flying && | ||
2763 | Animator.currentControlState != ScenePresenceAnimator.motionControlStates.onsurface) | ||
2764 | ) | ||
2765 | AddNewMovement(agent_control_v3); | ||
2766 | else | ||
2767 | { | ||
2768 | if (MovementFlag != 0) | ||
2769 | AddNewMovement(agent_control_v3); | ||
2770 | else | ||
2771 | m_delayedStop = Util.GetTimeStampMS() + 200.0; | ||
2772 | } | ||
2761 | } | 2773 | } |
2762 | |||
2763 | } | 2774 | } |
2764 | 2775 | ||
2765 | if (update_movementflag && ParentID == 0) | 2776 | if (update_movementflag && ParentID == 0 && m_delayedStop < 0) |
2766 | { | 2777 | { |
2767 | // m_log.DebugFormat("[SCENE PRESENCE]: Updating movement animations for {0}", Name); | 2778 | // m_log.DebugFormat("[SCENE PRESENCE]: Updating movement animations for {0}", Name); |
2768 | Animator.UpdateMovementAnimations(); | 2779 | Animator.UpdateMovementAnimations(); |
@@ -3016,6 +3027,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3016 | /// </param> | 3027 | /// </param> |
3017 | public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget) | 3028 | public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget) |
3018 | { | 3029 | { |
3030 | m_delayedStop = -1; | ||
3031 | |||
3019 | if (SitGround) | 3032 | if (SitGround) |
3020 | StandUp(); | 3033 | StandUp(); |
3021 | 3034 | ||
@@ -3671,7 +3684,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3671 | // m_log.DebugFormat( | 3684 | // m_log.DebugFormat( |
3672 | // "[SCENE PRESENCE]: Adding new movement {0} with rotation {1}, thisAddSpeedModifier {2} for {3}", | 3685 | // "[SCENE PRESENCE]: Adding new movement {0} with rotation {1}, thisAddSpeedModifier {2} for {3}", |
3673 | // vec, Rotation, thisAddSpeedModifier, Name); | 3686 | // vec, Rotation, thisAddSpeedModifier, Name); |
3674 | 3687 | m_delayedStop = -1; | |
3675 | // rotate from avatar coord space to world | 3688 | // rotate from avatar coord space to world |
3676 | Quaternion rot = Rotation; | 3689 | Quaternion rot = Rotation; |
3677 | if (!Flying && PresenceType != PresenceType.Npc) | 3690 | if (!Flying && PresenceType != PresenceType.Npc) |
@@ -3689,7 +3702,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3689 | direc.Z = 0f; // Prevent camera WASD up. | 3702 | direc.Z = 0f; // Prevent camera WASD up. |
3690 | 3703 | ||
3691 | // odd rescalings | 3704 | // odd rescalings |
3692 | direc *= 0.03f * 128f * SpeedModifier * thisAddSpeedModifier; | 3705 | direc *= 0.032f * 128f * SpeedModifier * thisAddSpeedModifier; |
3693 | 3706 | ||
3694 | // m_log.DebugFormat("[SCENE PRESENCE]: Force to apply before modification was {0} for {1}", direc, Name); | 3707 | // m_log.DebugFormat("[SCENE PRESENCE]: Force to apply before modification was {0} for {1}", direc, Name); |
3695 | 3708 | ||
@@ -3754,10 +3767,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
3754 | 3767 | ||
3755 | if(MovingToTarget) | 3768 | if(MovingToTarget) |
3756 | { | 3769 | { |
3770 | m_delayedStop = -1; | ||
3757 | Vector3 control = Vector3.Zero; | 3771 | Vector3 control = Vector3.Zero; |
3758 | if(HandleMoveToTargetUpdate(1f, ref control)) | 3772 | if(HandleMoveToTargetUpdate(1f, ref control)) |
3759 | AddNewMovement(control); | 3773 | AddNewMovement(control); |
3760 | } | 3774 | } |
3775 | else if(m_delayedStop > 0) | ||
3776 | { | ||
3777 | if(IsSatOnObject) | ||
3778 | m_delayedStop = -1; | ||
3779 | else | ||
3780 | if(Util.GetTimeStampMS() > m_delayedStop) | ||
3781 | AddNewMovement(Vector3.Zero); | ||
3782 | } | ||
3761 | 3783 | ||
3762 | if (Appearance.AvatarSize != m_lastSize) | 3784 | if (Appearance.AvatarSize != m_lastSize) |
3763 | SendAvatarDataToAllAgents(); | 3785 | SendAvatarDataToAllAgents(); |
@@ -4668,6 +4690,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
4668 | { | 4690 | { |
4669 | cAgent.CrossingFlags = crossingFlags; | 4691 | cAgent.CrossingFlags = crossingFlags; |
4670 | cAgent.CrossingFlags |= 1; | 4692 | cAgent.CrossingFlags |= 1; |
4693 | cAgent.CrossExtraFlags = 0; | ||
4694 | if((LastCommands & ScriptControlled.CONTROL_LBUTTON) != 0) | ||
4695 | cAgent.CrossExtraFlags |= 1; | ||
4696 | if((LastCommands & ScriptControlled.CONTROL_ML_LBUTTON) != 0) | ||
4697 | cAgent.CrossExtraFlags |= 2; | ||
4671 | } | 4698 | } |
4672 | else | 4699 | else |
4673 | cAgent.CrossingFlags = 0; | 4700 | cAgent.CrossingFlags = 0; |
@@ -4782,6 +4809,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
4782 | 4809 | ||
4783 | crossingFlags = cAgent.CrossingFlags; | 4810 | crossingFlags = cAgent.CrossingFlags; |
4784 | gotCrossUpdate = (crossingFlags != 0); | 4811 | gotCrossUpdate = (crossingFlags != 0); |
4812 | if(gotCrossUpdate) | ||
4813 | { | ||
4814 | LastCommands &= ~(ScriptControlled.CONTROL_LBUTTON | ScriptControlled.CONTROL_ML_LBUTTON); | ||
4815 | if((cAgent.CrossExtraFlags & 1) != 0) | ||
4816 | LastCommands |= ScriptControlled.CONTROL_LBUTTON; | ||
4817 | if((cAgent.CrossExtraFlags & 2) != 0) | ||
4818 | LastCommands |= ScriptControlled.CONTROL_ML_LBUTTON; | ||
4819 | MouseDown = (cAgent.CrossExtraFlags & 3) != 0; | ||
4820 | } | ||
4785 | 4821 | ||
4786 | haveGroupInformation = false; | 4822 | haveGroupInformation = false; |
4787 | // using this as protocol detection don't want to mess with the numbers for now | 4823 | // using this as protocol detection don't want to mess with the numbers for now |
@@ -5751,29 +5787,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
5751 | if (scriptedcontrols.Count <= 0) | 5787 | if (scriptedcontrols.Count <= 0) |
5752 | return; | 5788 | return; |
5753 | 5789 | ||
5754 | ScriptControlled allflags = ScriptControlled.CONTROL_ZERO; | 5790 | ScriptControlled allflags; |
5755 | 5791 | // convert mouse from edge to level | |
5756 | if (MouseDown) | 5792 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_UP) != 0 || |
5793 | (flags & unchecked((uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_UP)) != 0) | ||
5757 | { | 5794 | { |
5758 | allflags = LastCommands & (ScriptControlled.CONTROL_ML_LBUTTON | ScriptControlled.CONTROL_LBUTTON); | 5795 | allflags = ScriptControlled.CONTROL_ZERO; |
5759 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_UP) != 0 || (flags & unchecked((uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_UP)) != 0) | ||
5760 | { | ||
5761 | allflags = ScriptControlled.CONTROL_ZERO; | ||
5762 | MouseDown = true; | ||
5763 | } | ||
5764 | } | 5796 | } |
5797 | else // recover last state of mouse | ||
5798 | allflags = LastCommands & (ScriptControlled.CONTROL_ML_LBUTTON | ScriptControlled.CONTROL_LBUTTON); | ||
5765 | 5799 | ||
5766 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_DOWN) != 0) | 5800 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_ML_LBUTTON_DOWN) != 0) |
5767 | { | ||
5768 | allflags |= ScriptControlled.CONTROL_ML_LBUTTON; | 5801 | allflags |= ScriptControlled.CONTROL_ML_LBUTTON; |
5769 | MouseDown = true; | ||
5770 | } | ||
5771 | 5802 | ||
5772 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0) | 5803 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0) |
5773 | { | ||
5774 | allflags |= ScriptControlled.CONTROL_LBUTTON; | 5804 | allflags |= ScriptControlled.CONTROL_LBUTTON; |
5775 | MouseDown = true; | ||
5776 | } | ||
5777 | 5805 | ||
5778 | // find all activated controls, whether the scripts are interested in them or not | 5806 | // find all activated controls, whether the scripts are interested in them or not |
5779 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) | 5807 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0 || (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) != 0) |
@@ -5837,6 +5865,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5837 | } | 5865 | } |
5838 | 5866 | ||
5839 | LastCommands = allflags; | 5867 | LastCommands = allflags; |
5868 | MouseDown = (allflags & (ScriptControlled.CONTROL_ML_LBUTTON | ScriptControlled.CONTROL_LBUTTON)) != 0; | ||
5840 | } | 5869 | } |
5841 | } | 5870 | } |
5842 | 5871 | ||