From 24435cfe9ace3a23ec8590d14dd8454258c0e568 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 17 Oct 2015 21:56:15 +0100 Subject: Fix wrong active angularlock detection (it was only burning cpu), stop trying to add a amotor to each child prim and stop using unnecessary trimeshcallbacks --- OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs | 13 ++++--------- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 14 +++++++------- 2 files changed, 11 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/PhysicsModules') diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs index d22f912..7e884d4 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs @@ -445,7 +445,7 @@ namespace OpenSim.Region.PhysicsModule.ODE m_disabled = false; // The body doesn't already have a finite rotation mode set here - if ((!m_angularlock.ApproxEquals(Vector3.Zero, 0.0f)) && _parent == null) + if ((!m_angularlock.ApproxEquals(Vector3.One, 0.0f)) && _parent == null) { createAMotor(m_angularlock); } @@ -919,7 +919,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // _parent_scene.waitForSpaceUnlock(m_targetSpace); try { - SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, parent_scene.triCallback, null, null)); + SetGeom(d.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null)); } catch (AccessViolationException) { @@ -1121,7 +1121,7 @@ Console.WriteLine("ZProcessTaints for " + Name); { d.Mass m2; d.MassSetZero(out m2); - d.MassSetBoxTotal(out m2, prim.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z); + d.MassSetBoxTotal(out m2, prm.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z); d.Quaternion quat = new d.Quaternion(); quat.W = prm._orientation.W; @@ -1184,11 +1184,6 @@ Console.WriteLine("ZProcessTaints for " + Name); prm.m_collisionscore = 0; prm.m_disabled = false; - // The body doesn't already have a finite rotation mode set here - if ((!m_angularlock.ApproxEquals(Vector3.Zero, 0f)) && _parent == null) - { - prm.createAMotor(m_angularlock); - } prm.Body = Body; _parent_scene.ActivatePrim(prm); } @@ -1235,7 +1230,7 @@ Console.WriteLine("ZProcessTaints for " + Name); m_disabled = false; // The body doesn't already have a finite rotation mode set here - if ((!m_angularlock.ApproxEquals(Vector3.Zero, 0f)) && _parent == null) + if ((!m_angularlock.ApproxEquals(Vector3.One, 0f)) && _parent == null) { createAMotor(m_angularlock); } diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index f245a3b..62988d0 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -580,8 +580,8 @@ namespace OpenSim.Region.PhysicsModule.ODE m_suportCombine = false; nearCallback = near; - triCallback = TriCallback; - triArrayCallback = TriArrayCallback; +// triCallback = TriCallback; +// triArrayCallback = TriArrayCallback; m_rayCastManager = new ODERayCastRequestManager(this); // Create the world and the first space @@ -1811,10 +1811,10 @@ namespace OpenSim.Region.PhysicsModule.ODE //} // } } - +/* private int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount) { - /* String name1 = null; + String name1 = null; String name2 = null; if (!geom_name_map.TryGetValue(trimesh, out name1)) @@ -1827,7 +1827,7 @@ namespace OpenSim.Region.PhysicsModule.ODE } m_log.InfoFormat("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2); - */ + return 1; } @@ -1857,7 +1857,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return 1; } - +*/ /// /// This is our collision testing routine in ODE /// @@ -1988,8 +1988,8 @@ namespace OpenSim.Region.PhysicsModule.ODE x = x - offsetX + 1f; y = y - offsetY + 1f; - // map is rotated + // map is rotated index = (int)x * ((int)m_regionHeight + 3) + (int)y; if (index < TerrainHeightFieldHeights[heightFieldGeom].Length) -- cgit v1.1