From 24b7903cd02a2d86cdf535f86b093af0a63c99a2 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 31 Mar 2017 21:03:18 +0100 Subject: add missing file. Changes of inertia data of objects running does not produce correct physical results, namely linear and angular momentum are not conserved. --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index bed66cc..6279d6a 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -155,6 +155,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde VehicleRotationParam, VehicleFlags, SetVehicle, + SetInertia, Null //keep this last used do dim the methods array. does nothing but pulsing the prim } @@ -502,7 +503,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde d.WorldSetGravity(world, gravityx, gravityy, gravityz); - d.WorldSetLinearDamping(world, 0.002f); + d.WorldSetLinearDamping(world, 0.001f); d.WorldSetAngularDamping(world, 0.002f); d.WorldSetAngularDampingThreshold(world, 0f); d.WorldSetLinearDampingThreshold(world, 0f); -- cgit v1.1 From 9d8220ac9fe4fe01676beaf9b2a82db82d37a7f8 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 14 Apr 2017 03:14:41 +0100 Subject: some reduction on large colision repulsive force on non physical placement of physical prims --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 6279d6a..4a82f77 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde float frictionMovementMult = 0.8f; - float TerrainBounce = 0.1f; + float TerrainBounce = 0.001f; float TerrainFriction = 0.3f; public float AvatarFriction = 0;// 0.9f * 0.5f; @@ -1083,9 +1083,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde case ActorTypes.Prim: if (p2events) { - AddCollisionEventReporting(p2); + //AddCollisionEventReporting(p2); p2.AddCollisionEvent(p1.ParentActor.LocalID, contact); } + else if(p1.IsVolumeDtc) + p2.AddVDTCCollisionEvent(p1.ParentActor.LocalID, contact); + obj2LocalID = p2.ParentActor.LocalID; break; @@ -1099,9 +1102,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde { contact.SurfaceNormal = -contact.SurfaceNormal; contact.RelativeSpeed = -contact.RelativeSpeed; - AddCollisionEventReporting(p1); + //AddCollisionEventReporting(p1); p1.AddCollisionEvent(obj2LocalID, contact); } + else if(p2.IsVolumeDtc) + { + contact.SurfaceNormal = -contact.SurfaceNormal; + contact.RelativeSpeed = -contact.RelativeSpeed; + //AddCollisionEventReporting(p1); + p1.AddVDTCCollisionEvent(obj2LocalID, contact); + } break; } case ActorTypes.Ground: @@ -1110,7 +1120,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (p2events && !p2.IsVolumeDtc) { - AddCollisionEventReporting(p2); + //AddCollisionEventReporting(p2); p2.AddCollisionEvent(0, contact); } break; -- cgit v1.1 From 4f8f04d9499f040631a4056dfd11aa2ff95761dd Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 15 Apr 2017 01:21:47 +0100 Subject: still issues with volume detectors and sleeping bodies --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 50 ++++++++++++++++--------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 4a82f77..883038f 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -1668,11 +1668,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde // d.WorldSetQuickStepNumIterations(world, curphysiteractions); - int loopstartMS = Util.EnvironmentTickCount(); - int looptimeMS = 0; - int changestimeMS = 0; - int maxChangestime = (int)(reqTimeStep * 500f); // half the time - int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time + double loopstartMS = Util.GetTimeStampMS(); + double looptimeMS = 0; + double changestimeMS = 0; + double maxChangestime = (int)(reqTimeStep * 500f); // half the time + double maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time + +// double collisionTime = 0; +// double qstepTIme = 0; +// double tmpTime = 0; d.AllocateODEDataForThread(~0U); @@ -1695,7 +1699,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde item.actor.Name, item.what.ToString()); } } - changestimeMS = Util.EnvironmentTickCountSubtract(loopstartMS); + changestimeMS = Util.GetTimeStampMS() - loopstartMS; if (changestimeMS > maxChangestime) break; } @@ -1740,9 +1744,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_rayCastManager.ProcessQueuedRequests(); +// tmpTime = Util.GetTimeStampMS(); collision_optimized(); - List sleepers = new List(); +// collisionTime += Util.GetTimeStampMS() - tmpTime; + + lock(_collisionEventPrimRemove) + { + foreach (PhysicsActor obj in _collisionEventPrimRemove) + _collisionEventPrim.Remove(obj); + + _collisionEventPrimRemove.Clear(); + } + List sleepers = new List(); foreach (PhysicsActor obj in _collisionEventPrim) { if (obj == null) @@ -1772,18 +1786,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde foreach(OdePrim prm in sleepers) prm.SleeperAddCollisionEvents(); sleepers.Clear(); - - lock(_collisionEventPrimRemove) - { - foreach (PhysicsActor obj in _collisionEventPrimRemove) - _collisionEventPrim.Remove(obj); - - _collisionEventPrimRemove.Clear(); - } - + // do a ode simulation step +// tmpTime = Util.GetTimeStampMS(); d.WorldQuickStep(world, ODE_STEPSIZE); d.JointGroupEmpty(contactgroup); +// qstepTIme += Util.GetTimeStampMS() - tmpTime; // update managed ideia of physical data and do updates to core /* @@ -1824,7 +1832,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde step_time -= ODE_STEPSIZE; nodeframes++; - looptimeMS = Util.EnvironmentTickCountSubtract(loopstartMS); + looptimeMS = Util.GetTimeStampMS() - loopstartMS; if (looptimeMS > maxLoopTime) break; } @@ -1893,6 +1901,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde int nbodies = d.NTotalBodies; int ngeoms = d.NTotalGeoms; */ +/* + looptimeMS /= nodeframes; + if(looptimeMS > 0.080) + { + collisionTime /= nodeframes; + qstepTIme /= nodeframes; + } +*/ // Finished with all sim stepping. If requested, dump world state to file for debugging. // TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed? // TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots? -- cgit v1.1 From 156ef0bbe37ae97c2ec75ddbb2662edc2156dbda Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 15 Apr 2017 02:48:58 +0100 Subject: still issues with volume detectors and sleeping bodies --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 883038f..a4c3f92 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -1172,6 +1172,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde { aprim.CollisionScore = 0; aprim.IsColliding = false; + if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body)) + aprim.clearSleeperCollisions(); } } lock (_activegroups) -- cgit v1.1 From 006c08886a2af6d2287e6ef8bc67428b61ff9998 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 18 Apr 2017 05:31:15 +0100 Subject: deleted a bit 2 much on last commit --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index a4c3f92..be652c0 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -727,8 +727,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (g1 == g2) return; // Can't collide with yourself - if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) - return; +// if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) +// return; /* // debug PhysicsActor dp2; @@ -1176,6 +1176,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde aprim.clearSleeperCollisions(); } } + lock (_activegroups) { try -- cgit v1.1 From 84c9125016f964df9c77df7553aee6693fccb2e6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 20 Apr 2017 02:25:22 +0100 Subject: update ode binaries for windows; add a minimal velocity for bounce --- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs') diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index be652c0..86d41ea 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -529,6 +529,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde SharedTmpcontact.surface.mode = comumContactFlags; SharedTmpcontact.surface.mu = 0; SharedTmpcontact.surface.bounce = 0; + SharedTmpcontact.surface.bounce_vel = 1.5f; SharedTmpcontact.surface.soft_cfm = comumContactCFM; SharedTmpcontact.surface.soft_erp = comumContactERP; SharedTmpcontact.surface.slip1 = comumContactSLIP; -- cgit v1.1