From 5aa1c0d32825082f7da79a549ab01034d7523d23 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 27 Nov 2015 18:43:17 +0000 Subject: coment out warnings that do a messed around number of threadpool workitens and number of active threads ( at least when a pool is in use) --- OpenSim/Framework/Util.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 4aad578..3e51f7f 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -2315,7 +2315,7 @@ namespace OpenSim.Framework // It's possible that the thread won't abort. To make sure the thread pool isn't // depleted, increase the pool size. - m_ThreadPool.MaxThreads++; +// m_ThreadPool.MaxThreads++; } } } @@ -2430,6 +2430,7 @@ namespace OpenSim.Framework long numQueued = Interlocked.Increment(ref numQueuedThreadFuncs); try { +/* long numRunning = numRunningThreadFuncs; if (m_ThreadPool != null && LogOverloads) @@ -2462,6 +2463,7 @@ namespace OpenSim.Framework } } else +*/ { // Since we didn't log "Queue threadfunc", don't log "Run threadfunc" or "End threadfunc" either. // Those log lines aren't useful when we don't know which function is running in the thread. -- cgit v1.1 From f59350a1ee7adb13e1ad85c9189a5676dc2b002a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 27 Nov 2015 22:50:28 +0000 Subject: add a nasty global lock, ode.dll requires on multi regions per instance ( also make sure ninjaJoints are disabled --- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 040322a..7ba2083 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -125,7 +125,8 @@ namespace OpenSim.Region.PhysicsModule.ODE /// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82] /// internal static Object UniversalColliderSyncObject = new Object(); - + internal static Object SimulationLock = new Object(); + /// /// Is stats collecting enabled for this ODE scene? /// @@ -647,7 +648,7 @@ namespace OpenSim.Region.PhysicsModule.ODE physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0); physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false); - m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); +// m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", 10000.01f); } @@ -2714,6 +2715,7 @@ namespace OpenSim.Region.PhysicsModule.ODE CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks } + lock (OdeLock) { d.AllocateODEDataForThread(~0U); @@ -2867,7 +2869,8 @@ namespace OpenSim.Region.PhysicsModule.ODE tempTick = tempTick2; } - d.WorldQuickStep(world, ODE_STEPSIZE); + lock(SimulationLock) + d.WorldQuickStep(world, ODE_STEPSIZE); if (CollectStats) m_stats[ODENativeStepFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick); @@ -3377,7 +3380,8 @@ namespace OpenSim.Region.PhysicsModule.ODE [HandleProcessCorruptedStateExceptions] public override void Dispose() { - lock (OdeLock) + lock(SimulationLock) + lock(OdeLock) { if(world == IntPtr.Zero) return; @@ -3425,7 +3429,6 @@ namespace OpenSim.Region.PhysicsModule.ODE { m_log.ErrorFormat("[ODE SCENE]: exception {0}", e.Message); } - //d.CloseODE(); } } -- cgit v1.1 From 9928076d1a16b3b62fb6cd5e24f43b9f9c648457 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 27 Nov 2015 23:46:58 +0000 Subject: remove terrain height clamping left over the ushort format testing --- OpenSim/Region/Framework/Scenes/TerrainChannel.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs index ce5586c..1aa1194 100644 --- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs +++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs @@ -158,11 +158,7 @@ namespace OpenSim.Region.Framework.Scenes { if (Double.IsNaN(value) || Double.IsInfinity(value)) return; - if (value < 0) - value = 0; - else - if (value > 655.35) - value = 655.35; + m_terrainData[x, y] = (float)value; } } -- cgit v1.1 From 82e464cb8c974ffb50cd4a1252e09ee815877d11 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 28 Nov 2015 23:44:53 +0000 Subject: let old ODE trigger collision sounds like ubOde --- OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs | 2 +- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs index f535c41..aaf90f2 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs @@ -279,7 +279,7 @@ namespace OpenSim.Region.PhysicsModule.ODE public override bool IsPhysical { - get { return false; } + get { return m_isPhysical; } set { return; } } diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 7ba2083..e23cca6 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -1442,9 +1442,28 @@ namespace OpenSim.Region.PhysicsModule.ODE obj2LocalID = 0; //ctype = 0; //cStartStop = 0; - if (!p2.SubscribedEvents() && !p1.SubscribedEvents()) +// if (!p2.SubscribedEvents() && !p1.SubscribedEvents()) +// return; + bool p1events = p1.SubscribedEvents(); + bool p2events = p2.SubscribedEvents(); + + if (p1.IsVolumeDtc) + p2events = false; + if (p2.IsVolumeDtc) + p1events = false; + + if (!p2events && !p1events) return; + Vector3 vel = Vector3.Zero; + if (p2 != null && p2.IsPhysical) + vel = p2.Velocity; + + if (p1 != null && p1.IsPhysical) + vel -= p1.Velocity; + + contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal); + switch ((ActorTypes)p2.PhysicsActorType) { case ActorTypes.Agent: -- cgit v1.1 From 15f8a462166b5b6d6ec823402bb7addc2dc3f0d9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 29 Nov 2015 00:02:46 +0000 Subject: let Bullet do collision sounds (RAdams plz fix the relative speed) --- OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index c3eb776..6adf219 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs @@ -485,13 +485,20 @@ public abstract class BSPhysObject : PhysicsActor CollisionsLastTick = new CollisionEventUpdate(); CollisionsLastTickStep = PhysScene.SimulationStep; } + CollisionsLastTick.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); // If someone has subscribed for collision events log the collision so it will be reported up if (SubscribedEvents()) { + ContactPoint newContact = new ContactPoint(contactPoint, contactNormal, pentrationDepth); + + // make collision sound work just setting a speed + // see ubOde + newContact.RelativeSpeed = 2.0f; + lock (PhysScene.CollisionLock) { - CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); + CollisionCollection.AddCollider(collidingWith, newContact); } DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}", LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving); -- cgit v1.1 From ca026ac735e50ac4294b030db69b2cfcbc59c55b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 29 Nov 2015 00:19:25 +0000 Subject: fix the default shape type on upload, it is always convex --- OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 1236e83..b61959d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1028,9 +1028,7 @@ namespace OpenSim.Region.ClientStack.Linden // for now viwers do send fixed defaults // but this may change // int physicsShapeType = inner_instance_list["physics_shape_type"].AsInteger(); - byte physicsShapeType = (byte)PhysShapeType.prim; // default for mesh is simple convex - if(hasmesh) - physicsShapeType = (byte) PhysShapeType.convex; // default for mesh is simple convex + byte physicsShapeType = (byte)PhysShapeType.convex; // default is simple convex // int material = inner_instance_list["material"].AsInteger(); byte material = (byte)Material.Wood; -- cgit v1.1 From 302d28625d86de33ff9c98ad27b2f31cd2841879 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 29 Nov 2015 14:36:09 +0000 Subject: change llLookAt math to master cleaner solution, assuming lAxis2rot does work --- .../Shared/Api/Implementation/LSL_Api.cs | 31 +++++++++++++--------- 1 file changed, 18 insertions(+), 13 deletions(-) (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 61397cd..38cbdbc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -3550,19 +3550,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); // Get the normalized vector to the target - LSL_Vector d1 = llVecNorm(target - llGetPos()); + LSL_Vector from = llGetPos(); - // Get the bearing (yaw) - LSL_Vector a1 = new LSL_Vector(0,0,0); - a1.z = llAtan2(d1.y, d1.x); + // normalized direction to target + LSL_Vector dir = llVecNorm(target - from); - // Get the elevation (pitch) - LSL_Vector a2 = new LSL_Vector(0,0,0); - a2.y= -llAtan2(d1.z, llSqrt((d1.x * d1.x) + (d1.y * d1.y))); + // use vertical to help compute left axis +// LSL_Vector up = new LSL_Vector(0.0, 0.0, 1.0); + // find normalized left axis parallel to horizon +// LSL_Vector left = llVecNorm(LSL_Vector.Cross(up, dir)); + + LSL_Vector left = new LSL_Vector(-dir.y, dir.x, 0.0f); + left = llVecNorm(left); + // make up orthogonal to left and dir + LSL_Vector up = LSL_Vector.Cross(dir, left); - LSL_Rotation r1 = llEuler2Rot(a1); - LSL_Rotation r2 = llEuler2Rot(a2); - LSL_Rotation r3 = new LSL_Rotation(0.000000, 0.707107, 0.000000, 0.707107); + // compute rotation based on orthogonal axes + // and rotate so Z points to target with X below horizont + LSL_Rotation rot = new LSL_Rotation(0.0, 0.707107, 0.0, 0.707107) * llAxes2Rot(dir, left, up); if (m_host.PhysActor == null || !m_host.PhysActor.IsPhysical) { @@ -3570,17 +3575,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (strength <= 0.0 || damping <= 0.0) return; - llSetRot(r3 * r2 * r1); + llSetRot(rot); } else { if (strength == 0) { - llSetRot(r3 * r2 * r1); + llSetRot(rot); return; } - m_host.StartLookAt((Quaternion)(r3 * r2 * r1), (float)strength, (float)damping); + m_host.StartLookAt(rot, (float)strength, (float)damping); } } -- cgit v1.1