From 31689e965e441fc232f6f58ebff3fbda79beab01 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 15 Jul 2022 22:23:16 +0100 Subject: [PATCH] minor cosmetics --- .../Region/Framework/Scenes/ScenePresence.cs | 14 +----- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 2 +- .../Region/PhysicsModules/ubOde/ODEPrim.cs | 2 +- .../Region/PhysicsModules/ubOde/ODEScene.cs | 45 ++++++++++--------- 4 files changed, 26 insertions(+), 37 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f99a4075f2..b819023e33 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4202,12 +4202,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENE PRESENCE] SendAvatarDataToAllAgents: {0} ({1})", Name, UUID); // only send update from root agents to other clients; children are only "listening posts" if (IsChildAgent) - { - m_log.WarnFormat( - "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}", - Name, Scene.RegionInfo.RegionName); return; - } m_lastSize = Appearance.AvatarSize; int count = 0; @@ -4288,17 +4283,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendAppearanceToAllOtherAgents() { - // m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID); - + //m_log.DebugFormat("[SCENE PRESENCE] SendAppearanceToAllOtherAgents: {0} {1}", Name, UUID); // only send update from root agents to other clients; children are only "listening posts" if (IsChildAgent) - { - m_log.WarnFormat( - "[SCENE PRESENCE]: Attempt to send avatar data from a child agent for {0} in {1}", - Name, Scene.RegionInfo.RegionName); - return; - } int count = 0; m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index cd28914943..8ffd1250b8 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -2331,7 +2331,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { SafeNativeMethods.AllocateODEDataForThread(~0U); - while (step_time > HalfOdeStep) + while (step_time > HalfOdeStep) { try { diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index c49166c3d9..36772eea6b 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs @@ -1637,7 +1637,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (vertexCount == 0 || indexCount == 0) { m_log.WarnFormat("[PHYSICS]: Invalid mesh data on OdePrim {0}, mesh {1} at {2}", - Name, m_pbs.SculptEntry ? m_pbs.SculptTexture.ToString() : "primMesh",m_position.ToString()); + Name, m_pbs.SculptEntry ? m_pbs.SculptTexture.ToString() : "primMesh", m_position.ToString()); m_hasOBB = false; m_OBBOffset = Vector3.Zero; diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index e71b0627cf..3f0f5c1b5e 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -667,18 +667,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde return; } - ContactPoint maxDepthContact; - // do volume detection case if ((p1.IsVolumeDtc || p2.IsVolumeDtc)) { - maxDepthContact = new ContactPoint( + ContactPoint volDepthContact = new ContactPoint( new Vector3(curContact.pos.X, curContact.pos.Y, curContact.pos.Z), new Vector3(curContact.normal.X, curContact.normal.Y, curContact.normal.Z), curContact.depth, false ); - collision_accounting_events(p1, p2, maxDepthContact); + collision_accounting_events(p1, p2, volDepthContact); return; } @@ -799,10 +797,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde int i = 0; - maxDepthContact = new ContactPoint(); - maxDepthContact.PenetrationDepth = float.MinValue; + ContactPoint maxDepthContact = new ContactPoint(); ContactPoint minDepthContact = new ContactPoint(); - minDepthContact.PenetrationDepth = float.MaxValue; + + float minDepth = float.MaxValue; + float maxDepth = float.MinValue; SharedTmpcontact.geom.depth = 0; SharedTmpcontact.surface.mu = mu; @@ -867,18 +866,20 @@ namespace OpenSim.Region.PhysicsModule.ubOde ncontacts++; - if (curContact.depth > maxDepthContact.PenetrationDepth) + if (curContact.depth > maxDepth) { + maxDepth = curContact.depth; + maxDepthContact.PenetrationDepth = maxDepth; maxDepthContact.Position.X = curContact.pos.X; maxDepthContact.Position.Y = curContact.pos.Y; maxDepthContact.Position.Z = curContact.pos.Z; - maxDepthContact.PenetrationDepth = curContact.depth; maxDepthContact.CharacterFeet = FeetCollision; } - if (curContact.depth < minDepthContact.PenetrationDepth) + if (curContact.depth < minDepth) { - minDepthContact.PenetrationDepth = curContact.depth; + minDepth = curContact.depth; + minDepthContact.PenetrationDepth = minDepth; minDepthContact.SurfaceNormal.X = curContact.normal.X; minDepthContact.SurfaceNormal.Y = curContact.normal.Y; minDepthContact.SurfaceNormal.Z = curContact.normal.Z; @@ -1411,8 +1412,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (world == IntPtr.Zero) return; - ODEchangeitem item; - int donechanges = 0; if (!ChangesQueue.IsEmpty) { @@ -1421,7 +1420,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde SafeNativeMethods.AllocateODEDataForThread(~0U); - while (ChangesQueue.TryDequeue(out item)) + while (ChangesQueue.TryDequeue(out ODEchangeitem item)) { if (item.actor != null) { @@ -2241,14 +2240,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde } }; - ODERayRequest req = new ODERayRequest(); - req.actor = null; - req.callbackMethod = retMethod; - req.length = length; - req.Normal = direction; - req.Origin = position; - req.Count = Count; - req.filter = filter; + ODERayRequest req = new ODERayRequest() + { + actor = null, + callbackMethod = retMethod, + length = length, + Normal = direction, + Origin = position, + Count = Count, + filter = filter + }; lock (SyncObject) {