let Bullet do collision sounds (RAdams plz fix the relative speed)
parent
82e464cb8c
commit
15f8a46216
|
@ -485,13 +485,20 @@ public abstract class BSPhysObject : PhysicsActor
|
||||||
CollisionsLastTick = new CollisionEventUpdate();
|
CollisionsLastTick = new CollisionEventUpdate();
|
||||||
CollisionsLastTickStep = PhysScene.SimulationStep;
|
CollisionsLastTickStep = PhysScene.SimulationStep;
|
||||||
}
|
}
|
||||||
|
|
||||||
CollisionsLastTick.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
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 someone has subscribed for collision events log the collision so it will be reported up
|
||||||
if (SubscribedEvents()) {
|
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)
|
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}",
|
DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}",
|
||||||
LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving);
|
LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving);
|
||||||
|
|
Loading…
Reference in New Issue