From 3c5d148cac0ddf30cc767774d62042895ab731bb Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 20 Apr 2022 15:45:10 +0100 Subject: [PATCH] retouch sp terseupdates throttle again --- .../Region/Framework/Scenes/ScenePresence.cs | 50 +++++++++++------- bin/OpenMetaverse.Rendering.Meshmerizer.dll | Bin 20480 -> 20480 bytes bin/OpenMetaverse.StructuredData.dll | Bin 126976 -> 126976 bytes bin/OpenMetaverse.dll | Bin 2170880 -> 2170880 bytes bin/OpenMetaverseTypes.dll | Bin 163840 -> 163840 bytes 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index bd32300527..610a557868 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2644,13 +2644,13 @@ namespace OpenSim.Region.Framework.Scenes m_mouseLook = (allFlags & ACFlags.AGENT_CONTROL_MOUSELOOK) != 0; m_headrotation = agentData.HeadRotation; - byte oldState = State; + //byte oldState = State; State = agentData.State; #endregion Inputs - if (oldState != State) - SendAgentTerseUpdate(this); + //if (oldState != State) + // SendAgentTerseUpdate(this); if ((allFlags & ACFlags.AGENT_CONTROL_STAND_UP) != 0) StandUp(); @@ -3783,8 +3783,8 @@ namespace OpenSim.Region.Framework.Scenes #region Overridden Methods - const float ROTATION_TOLERANCE = 0.01f; - const float VELOCITY_TOLERANCE = 0.1f; + const float ROTATION_TOLERANCE = 0.005f; + const float VELOCITY_TOLERANCE = 0.005f; const float LOWVELOCITYSQ = 0.1f; const float POSITION_LARGETOLERANCE = 5f; const float POSITION_SMALLTOLERANCE = 0.05f; @@ -3827,20 +3827,29 @@ namespace OpenSim.Region.Framework.Scenes // has changed significantly from last sent update if (!IsSatOnObject) { - if (State != m_lastState || !m_bodyRot.ApproxEquals(m_lastRotation) || - !Velocity.ApproxEquals(m_lastVelocity) || (Velocity.IsZero() && !m_lastVelocity.IsZero() || - !CollisionPlane.ApproxEquals(m_lastCollisionPlane, POSITION_SMALLTOLERANCE))) + if (State != m_lastState || + !m_bodyRot.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || + !CollisionPlane.ApproxEquals(m_lastCollisionPlane, POSITION_SMALLTOLERANCE)) { SendTerseUpdateToAllClients(); } else { - Vector3 dpos = m_pos - m_lastPosition; - if(!dpos.ApproxZero(POSITION_LARGETOLERANCE) || - ((!dpos.ApproxZero(POSITION_SMALLTOLERANCE)) && Velocity.LengthSquared() < LOWVELOCITYSQ)) + Vector3 vel = Velocity; + if(!vel.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || + (vel.IsZero() && !m_lastVelocity.IsZero())) { SendTerseUpdateToAllClients(); } + else + { + Vector3 dpos = m_pos - m_lastPosition; + if(!dpos.ApproxZero(POSITION_LARGETOLERANCE) || + ((!dpos.ApproxZero(POSITION_SMALLTOLERANCE)) && vel.LengthSquared() < LOWVELOCITYSQ)) + { + SendTerseUpdateToAllClients(); + } + } } } CheckForSignificantMovement(); @@ -5186,30 +5195,33 @@ namespace OpenSim.Region.Framework.Scenes CollisionEventUpdate collisionData = (CollisionEventUpdate)e; Dictionary coldata = collisionData.m_objCollisionList; - if (coldata.Count != 0) + if (coldata.Count == 0) + CollisionPlane = Vector4.UnitW; + else { ContactPoint lowest; lowest.SurfaceNormal = Vector3.Zero; lowest.Position = Vector3.Zero; - lowest.Position.Z = float.MaxValue; + float maxZ= float.MaxValue; foreach (ContactPoint contact in coldata.Values) { - if (contact.CharacterFeet && contact.Position.Z < lowest.Position.Z) + if (contact.CharacterFeet && contact.Position.Z < maxZ) + { lowest = contact; + maxZ = lowest.Position.Z; + } } - if (lowest.Position.Z != float.MaxValue) + if (maxZ != float.MaxValue) { lowest.SurfaceNormal = -lowest.SurfaceNormal; - CollisionPlane = new Vector4(lowest.SurfaceNormal, Vector3.Dot(lowest.Position, lowest.SurfaceNormal)); + CollisionPlane = new Vector4(lowest.SurfaceNormal, lowest.Position.Dot(lowest.SurfaceNormal)); } else CollisionPlane = Vector4.UnitW; } - else - CollisionPlane = Vector4.UnitW; - + RaiseCollisionScriptEvents(coldata); // Gods do not take damage and Invulnerable is set depending on parcel/region flags diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll index 079073512044167473ea92951a8df36af9db91e7..79aa8477f18cc37abe2461dc08856b5ad6192b35 100755 GIT binary patch delta 46 zcmZozz}T>WaY6@k>72NY-G$0bjp3XBDX(G|*e|KYccvo4r7O*qe@g4SzRf$dJyZa< Cu@dJ1 delta 46 zcmV+}0MY+|paFoO0g#9T*FaaXi*X|YGM=;kBdP}wCI+bFrvna4hi%`YZ@%^Sv$!ir EB*G>XP5=M^ diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index 84a8a29aba4f96fb0984b2eb2b4406402bc76a81..c752e0653c21090a43f977c37136d51006153557 100755 GIT binary patch delta 42 ycmZp8z~1nHeL@Fw@tnBE?ycR7vMU569%^RX&f|3MVwoJ7Cteh`ea8w$4|f24(h&v# delta 42 ycmZp8z~1nHeL@HG6^HP~?ycR7vMU76+dX}*##86o?|sE=Wmb3h_8lu2J=_7AgcA7x diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index 6ec79b460f8e7944de9f58c242fd501c84b0c135..c63fa613d1daa1b98ba45f7ab47f8303696c8db0 100755 GIT binary patch delta 169 zcmWN=yAHun00!WmYTfEmck1p55Kqt;Jb=U?JcWpuNc^ef?;vKook#}@Q(wS4NV*xU z;(W=sdF;eSKI}t_(|k)%fGQXQHBbk`U<8bUF)$7qU;<2nDKHJ1U=z z%V6b3Yv!xli4*viT$O8b-3$E2ac$o3XYDrzqmSIPc_@W^dIADM1BAO delta 169 zcmWN=yAHun00!XGx~ogw@3%J)F|bK@vxO%xbQM#HKg2H~5{b!6h;&s;2eVf&*bHJ5 z=Sx28x=<{6xAHuCgBd{uR6!5u1%03&41hr}1cpHkjDS%v2F5`hOn^x+1*X9am<4lS z9xPl~9Jy-iw0yZmxg?k6iv4n{`>DRZea+*c+~1Cert`edmm8yIZ;blH3AII2v_)5R N&Tr+T*{a_7#s3^2Ml=8b diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 1f77692a014974dc6cc9994cf384189081024c08..05df59100abec19ae40fdac737fa56f5f1e6d37a 100755 GIT binary patch delta 45 zcmZo@;A&{#n$W>qJSVQPyS1BfYd2G=set_nhY2~y_j|0}EGt_3&r*N8fEm*VPXMIR B5_A9n delta 45 zcmZo@;A&{#n$W>q`6a5cyS1BfYd2G=sepi2nfBzORc<{IMjR7Q6eevKFk|}Q2>_Qg B5rO~!