diff options
author | Robert Adams | 2016-01-19 22:09:51 -0800 |
---|---|---|
committer | Robert Adams | 2016-01-19 22:09:51 -0800 |
commit | 33af41905021e6ab2e51873a75b585044e445974 (patch) | |
tree | 6c3e49224c90867c590cdfb93b3f2240c76ca717 /OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | |
parent | BulletSim: add stationary suppression on AddForce application. This enables (diff) | |
download | opensim-SC-33af41905021e6ab2e51873a75b585044e445974.zip opensim-SC-33af41905021e6ab2e51873a75b585044e445974.tar.gz opensim-SC-33af41905021e6ab2e51873a75b585044e445974.tar.bz2 opensim-SC-33af41905021e6ab2e51873a75b585044e445974.tar.xz |
BulletSim: make collision sounds work most of the time. Seems that collisions
usually stop the collider so velocity is often small.
Also remove some chatty debug messages.
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index ff6baca..a70d1b8 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | |||
@@ -505,17 +505,20 @@ public abstract class BSPhysObject : PhysicsActor | |||
505 | // Collision sound requires a velocity to know it should happen. This is a lot of computation for a little used feature. | 505 | // Collision sound requires a velocity to know it should happen. This is a lot of computation for a little used feature. |
506 | OMV.Vector3 relvel = OMV.Vector3.Zero; | 506 | OMV.Vector3 relvel = OMV.Vector3.Zero; |
507 | if (IsPhysical) | 507 | if (IsPhysical) |
508 | relvel = Velocity; | 508 | relvel = RawVelocity; |
509 | if (collidee != null && collidee.IsPhysical) | 509 | if (collidee != null && collidee.IsPhysical) |
510 | relvel -= collidee.Velocity; | 510 | relvel -= collidee.RawVelocity; |
511 | newContact.RelativeSpeed = OMV.Vector3.Dot(relvel, contactNormal); | 511 | newContact.RelativeSpeed = OMV.Vector3.Dot(relvel, contactNormal); |
512 | // DetailLog("{0},{1}.Collision.AddCollider,vel={2},contee.vel={3},relvel={4},relspeed={5}", | ||
513 | // LocalID, TypeName, RawVelocity, (collidee == null ? OMV.Vector3.Zero : collidee.RawVelocity), relvel, newContact.RelativeSpeed); | ||
512 | 514 | ||
513 | lock (PhysScene.CollisionLock) | 515 | lock (PhysScene.CollisionLock) |
514 | { | 516 | { |
515 | CollisionCollection.AddCollider(collideeLocalID, newContact); | 517 | CollisionCollection.AddCollider(collideeLocalID, newContact); |
516 | } | 518 | } |
517 | DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}", | 519 | DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},speed={6},colliderMoving={7}", |
518 | LocalID, TypeName, collideeLocalID, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving); | 520 | LocalID, TypeName, collideeLocalID, contactPoint, contactNormal, pentrationDepth, |
521 | newContact.RelativeSpeed, ColliderIsMoving); | ||
519 | 522 | ||
520 | ret = true; | 523 | ret = true; |
521 | } | 524 | } |