From 917fad40da98dc0485b43e9af363d04708570e27 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Dec 2009 00:36:16 +0000 Subject: Fix an omission in LSL that causes a viewer crash --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2b6d9bd..6102504 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6260,6 +6260,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSLError("First parameter to llDialog needs to be a key"); return; } + if (buttons.Length < 1) + { + LSLError("No less than 1 button can be shown"); + return; + } if (buttons.Length > 12) { LSLError("No more than 12 buttons can be shown"); -- cgit v1.1 From 8f0d6d6b5c2a66681cc80f33d10b0635a1257b25 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Dec 2009 00:36:16 +0000 Subject: Fix an omission in LSL that causes a viewer crash --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c9d6742..3a229c2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -6363,6 +6363,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSLError("First parameter to llDialog needs to be a key"); return; } + if (buttons.Length < 1) + { + LSLError("No less than 1 button can be shown"); + return; + } if (buttons.Length > 12) { LSLError("No more than 12 buttons can be shown"); -- cgit v1.1 From 25544ac04ad20d8e2ebe9c95152935bd3c4a29df Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 29 Dec 2009 21:59:19 -0500 Subject: * Attempts to resolve the megaregion terrain edit rebound. * It does this by tweaking the throttles on child agent connection to a megaregion and multiplying the land throttle by 50. (various bit and byte magic ensue) * While, I doubt this will cause terrain crater sized potholes.. since it actually increases the bandwidth available for land in child regions when MegaRegions area active, more testing would be good. * This, in theory, also shouldn't cause missing objects in child regions.. because all objects are in the root region anyway. As I said, more testing would be good. --- .../RegionCombinerModule/RegionCombinerModule.cs | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 92f060b..1a99c83 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -88,7 +88,89 @@ namespace OpenSim.Region.RegionCombinerModule public void RegionLoaded(Scene scene) { if (enabledYN) + { RegionLoadedDoWork(scene); + + scene.EventManager.OnNewPresence += NewPresence; + } + } + + private void NewPresence(ScenePresence presence) + { + if (presence.IsChildAgent) + { + byte[] throttleData; + + try + { + throttleData = presence.ControllingClient.GetThrottlesPacked(1); + } + catch (NotImplementedException) + { + return; + } + + if (throttleData == null) + return; + + if (throttleData.Length == 0) + return; + + if (throttleData.Length != 28) + return; + + byte[] adjData; + int pos = 0; + + if (!BitConverter.IsLittleEndian) + { + byte[] newData = new byte[7 * 4]; + Buffer.BlockCopy(throttleData, 0, newData, 0, 7 * 4); + + for (int i = 0; i < 7; i++) + Array.Reverse(newData, i * 4, 4); + + adjData = newData; + } + else + { + adjData = throttleData; + } + + // 0.125f converts from bits to bytes + int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; + int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; + int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; + int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; + int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; + int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; + int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); + // State is a subcategory of task that we allocate a percentage to + + + //int total = resend + land + wind + cloud + task + texture + asset; + + byte[] data = new byte[7 * 4]; + int ii = 0; + + Buffer.BlockCopy(Utils.FloatToBytes(resend), 0, data, ii, 4); ii += 4; + Buffer.BlockCopy(Utils.FloatToBytes(land * 50), 0, data, ii, 4); ii += 4; + Buffer.BlockCopy(Utils.FloatToBytes(wind), 0, data, ii, 4); ii += 4; + Buffer.BlockCopy(Utils.FloatToBytes(cloud), 0, data, ii, 4); ii += 4; + Buffer.BlockCopy(Utils.FloatToBytes(task), 0, data, ii, 4); ii += 4; + Buffer.BlockCopy(Utils.FloatToBytes(texture), 0, data, ii, 4); ii += 4; + Buffer.BlockCopy(Utils.FloatToBytes(asset), 0, data, ii, 4); + + try + { + presence.ControllingClient.SetChildAgentThrottle(data); + } + catch (NotImplementedException) + { + return; + } + + } } private void RegionLoadedDoWork(Scene scene) -- cgit v1.1 From 16a64c400b866d20ed80287f624fff89cc187145 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Wed, 30 Dec 2009 15:01:14 -0500 Subject: * Makes forward and backward key reactions faster by responding to the NUDGE type movements. --- .../Scenes/Animation/ScenePresenceAnimator.cs | 3 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 41 +++++++++++++++++----- 2 files changed, 35 insertions(+), 9 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index c314596..8b1d705 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -156,7 +156,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix); // Check control flags - bool heldForward = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS; + bool heldForward = + (((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) || ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS)); bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG; bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS; bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 289ba47..4c2de27 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.Framework.Scenes protected RegionInfo m_regionInfo; protected ulong crossingFromRegion; - private readonly Vector3[] Dir_Vectors = new Vector3[6]; + private readonly Vector3[] Dir_Vectors = new Vector3[9]; // Position of agent's camera in world (region cordinates) protected Vector3 m_CameraCenter; @@ -233,6 +233,8 @@ namespace OpenSim.Region.Framework.Scenes DIR_CONTROL_FLAG_RIGHT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG, DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, + DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, + DIR_CONTROL_FLAG_BACKWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG } @@ -717,19 +719,23 @@ namespace OpenSim.Region.Framework.Scenes Dir_Vectors[3] = -Vector3.UnitY; //RIGHT Dir_Vectors[4] = Vector3.UnitZ; //UP Dir_Vectors[5] = -Vector3.UnitZ; //DOWN - Dir_Vectors[5] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge + Dir_Vectors[8] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge + Dir_Vectors[6] = Vector3.UnitX*2; //FORWARD + Dir_Vectors[7] = -Vector3.UnitX; //BACK } private Vector3[] GetWalkDirectionVectors() { - Vector3[] vector = new Vector3[6]; + Vector3[] vector = new Vector3[9]; vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK vector[2] = Vector3.UnitY; //LEFT vector[3] = -Vector3.UnitY; //RIGHT vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN - vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge + vector[8] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge + vector[6] = (new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z) * 2); //FORWARD Nudge + vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK Nudge return vector; } @@ -1306,6 +1312,9 @@ namespace OpenSim.Region.Framework.Scenes else dirVectors = Dir_Vectors; + // The fact that m_movementflag is a byte needs to be fixed + // it really should be a uint + uint nudgehack = 250; foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) { if (((uint)flags & (uint)DCF) != 0) @@ -1315,24 +1324,40 @@ namespace OpenSim.Region.Framework.Scenes try { agent_control_v3 += dirVectors[i]; + //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); } catch (IndexOutOfRangeException) { // Why did I get this? } - if ((m_movementflag & (uint)DCF) == 0) + if ((m_movementflag & (byte)(uint)DCF) == 0) { + if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) + { + m_movementflag |= (byte)nudgehack; + } m_movementflag += (byte)(uint)DCF; update_movementflag = true; } } else { - if ((m_movementflag & (uint)DCF) != 0) + if ((m_movementflag & (byte)(uint)DCF) != 0 || + ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) + && ((m_movementflag & (byte)nudgehack) == nudgehack)) + ) // This or is for Nudge forward { - m_movementflag -= (byte)(uint)DCF; + m_movementflag -= ((byte)(uint)DCF); + update_movementflag = true; + /* + if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) + && ((m_movementflag & (byte)nudgehack) == nudgehack)) + { + m_log.Debug("Removed Hack flag"); + } + */ } else { @@ -1470,7 +1495,7 @@ namespace OpenSim.Region.Framework.Scenes } } - if (update_movementflag) + if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0)) Animator.UpdateMovementAnimations(); m_scene.EventManager.TriggerOnClientMovement(this); -- cgit v1.1 From cbe0841bc96d9ec834b06a0a012a50323698f719 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Dec 2009 20:13:18 +0000 Subject: Revert "Merge branch 'master' into careminster" This reverts commit 596af3f600462fb1e467714e5b898c10aa3d838b. --- .../Scenes/Animation/ScenePresenceAnimator.cs | 8 --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 57 ++------------- .../RegionCombinerModule/RegionCombinerModule.cs | 82 ---------------------- 3 files changed, 4 insertions(+), 143 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 8f62855..e98f0e7 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -161,18 +161,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix); // Check control flags -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS); bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); -======= - bool heldForward = - (((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) || ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS)); - bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG; - bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS; - bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG; ->>>>>>> master:OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f05fe59..c3bc96a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -173,12 +173,8 @@ namespace OpenSim.Region.Framework.Scenes protected RegionInfo m_regionInfo; protected ulong crossingFromRegion; -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs private readonly Vector3[] Dir_Vectors = new Vector3[11]; private bool m_isNudging = false; -======= - private readonly Vector3[] Dir_Vectors = new Vector3[9]; ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs // Position of agent's camera in world (region cordinates) protected Vector3 m_CameraCenter; @@ -247,13 +243,9 @@ namespace OpenSim.Region.Framework.Scenes DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS, DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG, DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS, -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS, DIR_CONTROL_FLAG_RIGHT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG, -======= - DIR_CONTROL_FLAG_BACKWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG, ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG } @@ -735,43 +727,27 @@ namespace OpenSim.Region.Framework.Scenes Dir_Vectors[3] = -Vector3.UnitY; //RIGHT Dir_Vectors[4] = Vector3.UnitZ; //UP Dir_Vectors[5] = -Vector3.UnitZ; //DOWN -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE Dir_Vectors[8] = new Vector3(0f, 0.5f, 0f); //LEFT_NUDGE Dir_Vectors[9] = new Vector3(0f, -0.5f, 0f); //RIGHT_NUDGE Dir_Vectors[10] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge -======= - Dir_Vectors[8] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge - Dir_Vectors[6] = Vector3.UnitX*2; //FORWARD - Dir_Vectors[7] = -Vector3.UnitX; //BACK ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs } private Vector3[] GetWalkDirectionVectors() { -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs Vector3[] vector = new Vector3[11]; -======= - Vector3[] vector = new Vector3[9]; ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK vector[2] = Vector3.UnitY; //LEFT vector[3] = -Vector3.UnitY; //RIGHT vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE vector[8] = Vector3.UnitY; //LEFT_NUDGE vector[9] = -Vector3.UnitY; //RIGHT_NUDGE vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE -======= - vector[8] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge - vector[6] = (new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z) * 2); //FORWARD Nudge - vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK Nudge ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs return vector; } @@ -1387,18 +1363,12 @@ namespace OpenSim.Region.Framework.Scenes else dirVectors = Dir_Vectors; -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs bool[] isNudge = GetDirectionIsNudge(); -======= - // The fact that m_movementflag is a byte needs to be fixed - // it really should be a uint - uint nudgehack = 250; ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS) { if (((uint)flags & (uint)DCF) != 0) @@ -1408,47 +1378,28 @@ namespace OpenSim.Region.Framework.Scenes try { agent_control_v3 += dirVectors[i]; -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs if (isNudge[i] == false) { Nudging = false; } -======= - //m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]); ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs } catch (IndexOutOfRangeException) { // Why did I get this? } - if ((m_movementflag & (byte)(uint)DCF) == 0) + if ((m_movementflag & (uint)DCF) == 0) { - if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) - { - m_movementflag |= (byte)nudgehack; - } m_movementflag += (byte)(uint)DCF; update_movementflag = true; } } else { - if ((m_movementflag & (byte)(uint)DCF) != 0 || - ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) - && ((m_movementflag & (byte)nudgehack) == nudgehack)) - ) // This or is for Nudge forward + if ((m_movementflag & (uint)DCF) != 0) { - m_movementflag -= ((byte)(uint)DCF); - + m_movementflag -= (byte)(uint)DCF; update_movementflag = true; - /* - if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE) - && ((m_movementflag & (byte)nudgehack) == nudgehack)) - { - m_log.Debug("Removed Hack flag"); - } - */ } else { @@ -1589,7 +1540,7 @@ namespace OpenSim.Region.Framework.Scenes } } - if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0)) + if (update_movementflag) Animator.UpdateMovementAnimations(); m_scene.EventManager.TriggerOnClientMovement(this); diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs index 1a99c83..92f060b 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs @@ -88,89 +88,7 @@ namespace OpenSim.Region.RegionCombinerModule public void RegionLoaded(Scene scene) { if (enabledYN) - { RegionLoadedDoWork(scene); - - scene.EventManager.OnNewPresence += NewPresence; - } - } - - private void NewPresence(ScenePresence presence) - { - if (presence.IsChildAgent) - { - byte[] throttleData; - - try - { - throttleData = presence.ControllingClient.GetThrottlesPacked(1); - } - catch (NotImplementedException) - { - return; - } - - if (throttleData == null) - return; - - if (throttleData.Length == 0) - return; - - if (throttleData.Length != 28) - return; - - byte[] adjData; - int pos = 0; - - if (!BitConverter.IsLittleEndian) - { - byte[] newData = new byte[7 * 4]; - Buffer.BlockCopy(throttleData, 0, newData, 0, 7 * 4); - - for (int i = 0; i < 7; i++) - Array.Reverse(newData, i * 4, 4); - - adjData = newData; - } - else - { - adjData = throttleData; - } - - // 0.125f converts from bits to bytes - int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; - int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; - int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; - int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; - int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; - int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; - int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - // State is a subcategory of task that we allocate a percentage to - - - //int total = resend + land + wind + cloud + task + texture + asset; - - byte[] data = new byte[7 * 4]; - int ii = 0; - - Buffer.BlockCopy(Utils.FloatToBytes(resend), 0, data, ii, 4); ii += 4; - Buffer.BlockCopy(Utils.FloatToBytes(land * 50), 0, data, ii, 4); ii += 4; - Buffer.BlockCopy(Utils.FloatToBytes(wind), 0, data, ii, 4); ii += 4; - Buffer.BlockCopy(Utils.FloatToBytes(cloud), 0, data, ii, 4); ii += 4; - Buffer.BlockCopy(Utils.FloatToBytes(task), 0, data, ii, 4); ii += 4; - Buffer.BlockCopy(Utils.FloatToBytes(texture), 0, data, ii, 4); ii += 4; - Buffer.BlockCopy(Utils.FloatToBytes(asset), 0, data, ii, 4); - - try - { - presence.ControllingClient.SetChildAgentThrottle(data); - } - catch (NotImplementedException) - { - return; - } - - } } private void RegionLoadedDoWork(Scene scene) -- cgit v1.1 From e6c71d6df6ef0f2836323c8ae2e59da2d1104f74 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Wed, 30 Dec 2009 15:55:49 -0500 Subject: * Fixes Sitting on the ground. --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 5 ++++- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 8b1d705..fd526eb 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -146,7 +146,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation const float PREJUMP_DELAY = 0.25f; #region Inputs - + if (m_scenePresence.SitGround) + { + return "SIT_GROUND_CONSTRAINED"; + } AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; PhysicsActor actor = m_scenePresence.PhysicsActor; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4c2de27..277081a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes private Vector3? m_forceToApply; private uint m_requestedSitTargetID; private UUID m_requestedSitTargetUUID; + public bool SitGround = false; private SendCourseLocationsMethod m_sendCourseLocationsMethod; @@ -1254,7 +1255,9 @@ namespace OpenSim.Region.Framework.Scenes // TODO: This doesn't prevent the user from walking yet. // Setting parent ID would fix this, if we knew what value // to use. Or we could add a m_isSitting variable. - Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); + //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); + SitGround = true; + } // In the future, these values might need to go global. @@ -1495,7 +1498,7 @@ namespace OpenSim.Region.Framework.Scenes } } - if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0)) + if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0) && !SitGround) Animator.UpdateMovementAnimations(); m_scene.EventManager.TriggerOnClientMovement(this); @@ -1607,8 +1610,12 @@ namespace OpenSim.Region.Framework.Scenes /// public void StandUp() { + if (SitGround) + SitGround = false; + if (m_parentID != 0) { + m_log.Debug("StandupCode Executed"); SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); if (part != null) { -- cgit v1.1 From 5e103f2b2eb51c35b435f6850fc088f1f905d9dd Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Dec 2009 20:26:22 +0000 Subject: Revert "Merge branch 'master' into careminster" This reverts commit d49d44923d1be38f6fff12706b156562c6060566. --- .../Scenes/Animation/ScenePresenceAnimator.cs | 5 +---- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 ------------------ 2 files changed, 1 insertion(+), 22 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 6c64484..e98f0e7 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -151,10 +151,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation const float PREJUMP_DELAY = 0.25f; #region Inputs - if (m_scenePresence.SitGround) - { - return "SIT_GROUND_CONSTRAINED"; - } + AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; PhysicsActor actor = m_scenePresence.PhysicsActor; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index ee76cb6..c3bc96a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -129,7 +129,6 @@ namespace OpenSim.Region.Framework.Scenes private Vector3? m_forceToApply; private uint m_requestedSitTargetID; private UUID m_requestedSitTargetUUID; - public bool SitGround = false; private SendCourseLocationsMethod m_sendCourseLocationsMethod; @@ -1300,17 +1299,8 @@ namespace OpenSim.Region.Framework.Scenes if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0) { -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); -======= - // TODO: This doesn't prevent the user from walking yet. - // Setting parent ID would fix this, if we knew what value - // to use. Or we could add a m_isSitting variable. - //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); - SitGround = true; - ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs } // In the future, these values might need to go global. @@ -1550,11 +1540,7 @@ namespace OpenSim.Region.Framework.Scenes } } -<<<<<<< HEAD:OpenSim/Region/Framework/Scenes/ScenePresence.cs if (update_movementflag) -======= - if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0) && !SitGround) ->>>>>>> master:OpenSim/Region/Framework/Scenes/ScenePresence.cs Animator.UpdateMovementAnimations(); m_scene.EventManager.TriggerOnClientMovement(this); @@ -1665,12 +1651,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void StandUp() { - if (SitGround) - SitGround = false; - if (m_parentID != 0) { - m_log.Debug("StandupCode Executed"); SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); if (part != null) { -- cgit v1.1