diff options
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 34 |
3 files changed, 37 insertions, 8 deletions
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 | |||
485 | CollisionsLastTick = new CollisionEventUpdate(); | 485 | CollisionsLastTick = new CollisionEventUpdate(); |
486 | CollisionsLastTickStep = PhysScene.SimulationStep; | 486 | CollisionsLastTickStep = PhysScene.SimulationStep; |
487 | } | 487 | } |
488 | |||
488 | CollisionsLastTick.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); | 489 | CollisionsLastTick.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); |
489 | 490 | ||
490 | // If someone has subscribed for collision events log the collision so it will be reported up | 491 | // If someone has subscribed for collision events log the collision so it will be reported up |
491 | if (SubscribedEvents()) { | 492 | if (SubscribedEvents()) { |
493 | ContactPoint newContact = new ContactPoint(contactPoint, contactNormal, pentrationDepth); | ||
494 | |||
495 | // make collision sound work just setting a speed | ||
496 | // see ubOde | ||
497 | newContact.RelativeSpeed = 2.0f; | ||
498 | |||
492 | lock (PhysScene.CollisionLock) | 499 | lock (PhysScene.CollisionLock) |
493 | { | 500 | { |
494 | CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); | 501 | CollisionCollection.AddCollider(collidingWith, newContact); |
495 | } | 502 | } |
496 | DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}", | 503 | DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}", |
497 | LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving); | 504 | LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving); |
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 | |||
279 | 279 | ||
280 | public override bool IsPhysical | 280 | public override bool IsPhysical |
281 | { | 281 | { |
282 | get { return false; } | 282 | get { return m_isPhysical; } |
283 | set { return; } | 283 | set { return; } |
284 | } | 284 | } |
285 | 285 | ||
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 040322a..e23cca6 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | |||
@@ -125,7 +125,8 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
125 | /// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82] | 125 | /// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82] |
126 | /// </remarks> | 126 | /// </remarks> |
127 | internal static Object UniversalColliderSyncObject = new Object(); | 127 | internal static Object UniversalColliderSyncObject = new Object(); |
128 | 128 | internal static Object SimulationLock = new Object(); | |
129 | |||
129 | /// <summary> | 130 | /// <summary> |
130 | /// Is stats collecting enabled for this ODE scene? | 131 | /// Is stats collecting enabled for this ODE scene? |
131 | /// </summary> | 132 | /// </summary> |
@@ -647,7 +648,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
647 | physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0); | 648 | physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0); |
648 | physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false); | 649 | physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false); |
649 | 650 | ||
650 | m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); | 651 | // m_NINJA_physics_joints_enabled = physicsconfig.GetBoolean("use_NINJA_physics_joints", false); |
651 | minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); | 652 | minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", 3f); |
652 | maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", 10000.01f); | 653 | maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", 10000.01f); |
653 | } | 654 | } |
@@ -1441,9 +1442,28 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
1441 | obj2LocalID = 0; | 1442 | obj2LocalID = 0; |
1442 | //ctype = 0; | 1443 | //ctype = 0; |
1443 | //cStartStop = 0; | 1444 | //cStartStop = 0; |
1444 | if (!p2.SubscribedEvents() && !p1.SubscribedEvents()) | 1445 | // if (!p2.SubscribedEvents() && !p1.SubscribedEvents()) |
1446 | // return; | ||
1447 | bool p1events = p1.SubscribedEvents(); | ||
1448 | bool p2events = p2.SubscribedEvents(); | ||
1449 | |||
1450 | if (p1.IsVolumeDtc) | ||
1451 | p2events = false; | ||
1452 | if (p2.IsVolumeDtc) | ||
1453 | p1events = false; | ||
1454 | |||
1455 | if (!p2events && !p1events) | ||
1445 | return; | 1456 | return; |
1446 | 1457 | ||
1458 | Vector3 vel = Vector3.Zero; | ||
1459 | if (p2 != null && p2.IsPhysical) | ||
1460 | vel = p2.Velocity; | ||
1461 | |||
1462 | if (p1 != null && p1.IsPhysical) | ||
1463 | vel -= p1.Velocity; | ||
1464 | |||
1465 | contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal); | ||
1466 | |||
1447 | switch ((ActorTypes)p2.PhysicsActorType) | 1467 | switch ((ActorTypes)p2.PhysicsActorType) |
1448 | { | 1468 | { |
1449 | case ActorTypes.Agent: | 1469 | case ActorTypes.Agent: |
@@ -2714,6 +2734,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
2714 | CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks | 2734 | CreateRequestedJoints(); // this must be outside of the lock (OdeLock) to avoid deadlocks |
2715 | } | 2735 | } |
2716 | 2736 | ||
2737 | |||
2717 | lock (OdeLock) | 2738 | lock (OdeLock) |
2718 | { | 2739 | { |
2719 | d.AllocateODEDataForThread(~0U); | 2740 | d.AllocateODEDataForThread(~0U); |
@@ -2867,7 +2888,8 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
2867 | tempTick = tempTick2; | 2888 | tempTick = tempTick2; |
2868 | } | 2889 | } |
2869 | 2890 | ||
2870 | d.WorldQuickStep(world, ODE_STEPSIZE); | 2891 | lock(SimulationLock) |
2892 | d.WorldQuickStep(world, ODE_STEPSIZE); | ||
2871 | 2893 | ||
2872 | if (CollectStats) | 2894 | if (CollectStats) |
2873 | m_stats[ODENativeStepFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick); | 2895 | m_stats[ODENativeStepFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick); |
@@ -3377,7 +3399,8 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3377 | [HandleProcessCorruptedStateExceptions] | 3399 | [HandleProcessCorruptedStateExceptions] |
3378 | public override void Dispose() | 3400 | public override void Dispose() |
3379 | { | 3401 | { |
3380 | lock (OdeLock) | 3402 | lock(SimulationLock) |
3403 | lock(OdeLock) | ||
3381 | { | 3404 | { |
3382 | if(world == IntPtr.Zero) | 3405 | if(world == IntPtr.Zero) |
3383 | return; | 3406 | return; |
@@ -3425,7 +3448,6 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3425 | { | 3448 | { |
3426 | m_log.ErrorFormat("[ODE SCENE]: exception {0}", e.Message); | 3449 | m_log.ErrorFormat("[ODE SCENE]: exception {0}", e.Message); |
3427 | } | 3450 | } |
3428 | //d.CloseODE(); | ||
3429 | } | 3451 | } |
3430 | } | 3452 | } |
3431 | 3453 | ||