From add7abc1de2fce8db4c6d01cc4b5305bafa4bd87 Mon Sep 17 00:00:00 2001 From: Kitto Flora Date: Fri, 7 May 2010 14:12:07 -0400 Subject: Fix Mouse+WASD makes Av rise; Fix PREJUMP. --- .../Scenes/Animation/ScenePresenceAnimator.cs | 13 +++--------- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 23 ++++++++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index be0e985..b43caf2 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -56,7 +56,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation // protected string m_movementAnimation = "DEFAULT"; //KF: 'DEFAULT' does not exist! protected string m_movementAnimation = "CROUCH"; //KF: CROUCH ensures reliable Av Anim. init. private int m_animTickFall; - private int m_animTickJump; +// private int m_animTickJump; + public int m_animTickJump; // ScenePresence has to see this to control +Z force /// /// The scene presence that this animator applies to @@ -123,22 +124,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// public void TrySetMovementAnimation(string anim) { -//Console.WriteLine("Updating movement animation to {0}", anim); - if (!m_scenePresence.IsChildAgent) { if (m_animations.TrySetDefaultAnimation( anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) { -//Console.WriteLine("TSMA {0} success.", anim); // 16384 is CHANGED_ANIMATION m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 }); SendAnimPack(); } - else - { -//Console.WriteLine("TSMA {0} fail.", anim); - } } } @@ -267,7 +261,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation m_animTickJump = Environment.TickCount; return "PREJUMP"; } - else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 1000.0f) + else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 800.0f) { // Start actual jump if (m_animTickJump == -1) @@ -317,7 +311,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation public void UpdateMovementAnimations() { m_movementAnimation = GetMovementAnimation(); -//Console.WriteLine("UMA got {0}", m_movementAnimation); if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump) { // This was the previous behavior before PREJUMP diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index db073e8..665fb4c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -613,7 +613,7 @@ namespace OpenSim.Region.Framework.Scenes m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); // TODO: Change default to true once the feature is supported m_usePreJump = startupConfig.GetBoolean("enableprejump", false); - + m_usePreJump = true; // Above line fails!? m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys); if (RegionInfo.NonphysPrimMax > 0) { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2603fe1..565438d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -665,7 +665,7 @@ namespace OpenSim.Region.Framework.Scenes CreateSceneViewer(); m_animator = new ScenePresenceAnimator(this); } - + private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() { m_rootRegionHandle = reginfo.RegionHandle; @@ -1459,7 +1459,6 @@ namespace OpenSim.Region.Framework.Scenes } i++; } - //Paupaw:Do Proper PID for Autopilot here if (bResetMoveToPosition) { @@ -2433,10 +2432,11 @@ namespace OpenSim.Region.Framework.Scenes Rotation = rotation; Vector3 direc = vec * rotation; direc.Normalize(); + PhysicsActor actor = m_physicsActor; + if ((vec.Z == 0f) && !actor.Flying) direc.Z = 0f; // Prevent camera WASD up. direc *= 0.03f * 128f * m_speedModifier; - PhysicsActor actor = m_physicsActor; if (actor != null) { if (actor.Flying) @@ -2458,11 +2458,18 @@ namespace OpenSim.Region.Framework.Scenes { if (direc.Z > 2.0f) { - direc.Z *= 3.0f; - - // TODO: PreJump and jump happen too quickly. Many times prejump gets ignored. - Animator.TrySetMovementAnimation("PREJUMP"); - Animator.TrySetMovementAnimation("JUMP"); + if(m_animator.m_animTickJump == -1) + { + direc.Z *= 3.0f; // jump + } + else + { + direc.Z *= 0.1f; // prejump + } + /* Animations are controlled via GetMovementAnimation() in ScenePresenceAnimator.cs + Animator.TrySetMovementAnimation("PREJUMP"); + Animator.TrySetMovementAnimation("JUMP"); + */ } } } -- cgit v1.1