From 15f8a462166b5b6d6ec823402bb7addc2dc3f0d9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 29 Nov 2015 00:02:46 +0000 Subject: [PATCH] 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(-) diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index c3eb77655c..6adf219e32 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);