aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorKitto Flora2010-11-11 04:49:47 +0000
committerKitto Flora2010-11-11 04:49:47 +0000
commit9462a1861b3a10467370380d11cf2e82a91c4ab7 (patch)
tree8097f1162c8ee9ba2df54b3a18e63c4a69e3ff78 /OpenSim/Region
parentRemove "OpenSimulator" from startup message (diff)
downloadopensim-SC-9462a1861b3a10467370380d11cf2e82a91c4ab7.zip
opensim-SC-9462a1861b3a10467370380d11cf2e82a91c4ab7.tar.gz
opensim-SC-9462a1861b3a10467370380d11cf2e82a91c4ab7.tar.bz2
opensim-SC-9462a1861b3a10467370380d11cf2e82a91c4ab7.tar.xz
Fix excessive forward motion and flailing while descending a slope, prevent adding motion while falling from flying.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs18
2 files changed, 17 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 9658e11..9c103cb 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -248,7 +248,7 @@ TrySetMovementAnimation("STAND");
248 m_animTickFall = Environment.TickCount; 248 m_animTickFall = Environment.TickCount;
249 } 249 }
250// else if (!jumping && fallElapsed > FALL_DELAY) 250// else if (!jumping && fallElapsed > FALL_DELAY)
251 else if (!m_jumping && (fallElapsed > FALL_DELAY) && (fallVelocity < -3.0f) ) // add for falling and jumping 251 else if (!m_jumping && (fallElapsed > FALL_DELAY) && (fallVelocity < -3.0f) && (m_scenePresence.m_wasFlying)) // add for falling and jumping
252 { 252 {
253 // Falling long enough to trigger the animation 253 // Falling long enough to trigger the animation
254//Console.WriteLine("FALLDOWN"); //## 254//Console.WriteLine("FALLDOWN"); //##
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b637317..f20eb33 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -161,6 +161,8 @@ namespace OpenSim.Region.Framework.Scenes
161 private bool m_setAlwaysRun; 161 private bool m_setAlwaysRun;
162 private bool m_forceFly; 162 private bool m_forceFly;
163 private bool m_flyDisabled; 163 private bool m_flyDisabled;
164 private bool m_flyingOld; // add for fly velocity control
165 public bool m_wasFlying; // add for fly velocity control
164 166
165 private float m_speedModifier = 1.0f; 167 private float m_speedModifier = 1.0f;
166 168
@@ -2564,14 +2566,22 @@ namespace OpenSim.Region.Framework.Scenes
2564 Vector3 direc = vec * rotation; 2566 Vector3 direc = vec * rotation;
2565 direc.Normalize(); 2567 direc.Normalize();
2566 PhysicsActor actor = m_physicsActor; 2568 PhysicsActor actor = m_physicsActor;
2569
2570 if (actor.Flying != m_flyingOld) // add for fly velocity control
2571 {
2572 m_flyingOld = actor.Flying; // add for fly velocity control
2573 if (!actor.Flying) m_wasFlying = true; // add for fly velocity control
2574 }
2575
2576 if (m_physicsActor.IsColliding == true) m_wasFlying = false; // add for fly velocity control
2577
2567 if ((vec.Z == 0f) && !actor.Flying) direc.Z = 0f; // Prevent camera WASD up. 2578 if ((vec.Z == 0f) && !actor.Flying) direc.Z = 0f; // Prevent camera WASD up.
2568 2579
2569 direc *= 0.03f * 128f * m_speedModifier; 2580 direc *= 0.03f * 128f * m_speedModifier;
2570 2581
2571 if (actor != null) 2582 if (actor != null)
2572 { 2583 {
2573// rm falling if (actor.Flying) 2584 if (actor.Flying)
2574 if ((actor.Flying) || Animator.m_falling) // add for falling lateral speed
2575 { 2585 {
2576// rm speed mod direc *= 4.0f; 2586// rm speed mod direc *= 4.0f;
2577 direc *= 5.2f; // for speed mod 2587 direc *= 5.2f; // for speed mod
@@ -2587,6 +2597,10 @@ namespace OpenSim.Region.Framework.Scenes
2587 // m_log.Info("[AGENT]: Stop FLying"); 2597 // m_log.Info("[AGENT]: Stop FLying");
2588 //} 2598 //}
2589 } 2599 }
2600 if (Animator.m_falling && m_wasFlying) // if falling from flying, disable motion add
2601 {
2602 direc *= 0.0f;
2603 }
2590 /* This jumping section removed to SPA 2604 /* This jumping section removed to SPA
2591 else if (!actor.Flying && actor.IsColliding) 2605 else if (!actor.Flying && actor.IsColliding)
2592 { 2606 {