diff options
author | Diva Canto | 2012-03-27 10:09:08 -0700 |
---|---|---|
committer | Diva Canto | 2012-03-27 10:09:08 -0700 |
commit | 2e2634896d22ee08b0d3fae40f0a8c933190f556 (patch) | |
tree | 0d506518180b3892026bff6e0b9b5d00e1894e74 /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |
parent | Send the config section name up to the service classes themselves (XInventory... (diff) | |
parent | Add Garmin Kawaguichi to CONTRIBUTORS.txt (diff) | |
download | opensim-SC_OLD-2e2634896d22ee08b0d3fae40f0a8c933190f556.zip opensim-SC_OLD-2e2634896d22ee08b0d3fae40f0a8c933190f556.tar.gz opensim-SC_OLD-2e2634896d22ee08b0d3fae40f0a8c933190f556.tar.bz2 opensim-SC_OLD-2e2634896d22ee08b0d3fae40f0a8c933190f556.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index f122df9..248d1f2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -1326,6 +1326,7 @@ public sealed class BSPrim : PhysicsActor | |||
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | // I've collided with something | 1328 | // I've collided with something |
1329 | CollisionEventUpdate collisionCollection = null; | ||
1329 | public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) | 1330 | public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) |
1330 | { | 1331 | { |
1331 | // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); | 1332 | // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); |
@@ -1343,11 +1344,18 @@ public sealed class BSPrim : PhysicsActor | |||
1343 | if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; | 1344 | if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; |
1344 | _lastCollisionTime = nowTime; | 1345 | _lastCollisionTime = nowTime; |
1345 | 1346 | ||
1346 | // create the event for the collision | 1347 | if (collisionCollection == null) |
1347 | Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); | 1348 | collisionCollection = new CollisionEventUpdate(); |
1348 | contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); | 1349 | collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); |
1349 | CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); | 1350 | } |
1350 | base.SendCollisionUpdate(args); | 1351 | |
1352 | public void SendCollisions() | ||
1353 | { | ||
1354 | if (collisionCollection != null) | ||
1355 | { | ||
1356 | base.SendCollisionUpdate(collisionCollection); | ||
1357 | collisionCollection = null; | ||
1358 | } | ||
1351 | } | 1359 | } |
1352 | } | 1360 | } |
1353 | } | 1361 | } |