From 18c625bda669509fc9aae330703fe09ff7a6c72e Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 10 Nov 2011 14:09:35 -0800 Subject: When updating SOG, a physics taint should not override a full update with a terse update --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 339cf0f..f6bfc9b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1731,18 +1731,23 @@ namespace OpenSim.Region.Framework.Scenes //if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) // return; - bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); - - if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) + // If we somehow got here to updating the SOG and its root part is not scheduled for update, + // check to see if the physical position or rotation warrant an update. + if (m_rootPart.UpdateFlag == UpdateRequired.NONE) { - m_rootPart.UpdateFlag = UpdateRequired.TERSE; - lastPhysGroupPos = AbsolutePosition; - } + bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); - if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) - { - m_rootPart.UpdateFlag = UpdateRequired.TERSE; - lastPhysGroupRot = GroupRotation; + if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) + { + m_rootPart.UpdateFlag = UpdateRequired.TERSE; + lastPhysGroupPos = AbsolutePosition; + } + + if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) + { + m_rootPart.UpdateFlag = UpdateRequired.TERSE; + lastPhysGroupRot = GroupRotation; + } } SceneObjectPart[] parts = m_parts.GetArray(); -- cgit v1.1 From 2d4ac6288dab1b12997c54cdc93d71ac5d0be8fc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 10 Nov 2011 22:56:13 +0000 Subject: Alter commit 3758306 to allow region name to be substituted within a region console prompt This is to allow broader subsitution in the future. Currently, the only substitions are \R (for region name) and \\ (for a single backslash) e.g. "Region (\R) " is the current and continuing default prompt This renames custom_prompt in [Startup] to ConsolePrompt --- OpenSim/Region/Application/OpenSim.cs | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 9fe284f..beb75a8 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Timers; using log4net; using Nini.Config; @@ -56,7 +57,16 @@ namespace OpenSim protected bool m_gui = false; protected string m_consoleType = "local"; protected uint m_consolePort = 0; - protected string m_custom_prompt; + + /// + /// Prompt to use for simulator command line. + /// + private string m_consolePrompt; + + /// + /// Regex for parsing out special characters in the prompt. + /// + private Regex m_consolePromptRegex = new Regex(@"([^\\])\\(\w)", RegexOptions.Compiled); private string m_timedScript = "disabled"; private Timer m_scriptTimer; @@ -111,7 +121,7 @@ namespace OpenSim Util.FireAndForgetMethod = asyncCallMethod; stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 15); - m_custom_prompt = startupConfig.GetString("custom_prompt", "Region"); + m_consolePrompt = startupConfig.GetString("console_prompt", @"Region (\R) "); } if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) @@ -835,7 +845,22 @@ namespace OpenSim string regionName = (m_sceneManager.CurrentScene == null ? "root" : m_sceneManager.CurrentScene.RegionInfo.RegionName); MainConsole.Instance.Output(String.Format("Currently selected region is {0}", regionName)); - m_console.DefaultPrompt = String.Format("{0} ({1}) ", m_custom_prompt, regionName); + +// m_log.DebugFormat("Original prompt is {0}", m_consolePrompt); + string prompt = m_consolePrompt; + + // Replace "\R" with the region name + // Replace "\\" with "\" + prompt = m_consolePromptRegex.Replace(prompt, m => + { +// m_log.DebugFormat("Matched {0}", m.Groups[2].Value); + if (m.Groups[2].Value == "R") + return m.Groups[1].Value + regionName; + else + return m.Groups[0].Value; + }); + + m_console.DefaultPrompt = prompt; m_console.ConsoleScene = m_sceneManager.CurrentScene; } -- cgit v1.1 From f5abae5ac67caefdc305cfa8551dfa749bf8b5c7 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 10 Nov 2011 22:34:54 +0100 Subject: Implement nudging support for strafing motion --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fc5141f..e662492 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1509,7 +1509,8 @@ namespace OpenSim.Region.Framework.Scenes if ((MovementFlag & (byte)(uint)DCF) == 0) { - if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) + if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE || + DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT_NUDGE) { MovementFlag |= (byte)nudgehack; } @@ -1522,7 +1523,8 @@ namespace OpenSim.Region.Framework.Scenes else { if ((MovementFlag & (byte)(uint)DCF) != 0 || - ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) + ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE || + DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_LEFT_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_RIGHT_NUDGE) && ((MovementFlag & (byte)nudgehack) == nudgehack)) ) // This or is for Nudge forward { -- cgit v1.1