aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
diff options
context:
space:
mode:
authorDiva Canto2012-03-27 10:09:08 -0700
committerDiva Canto2012-03-27 10:09:08 -0700
commit2e2634896d22ee08b0d3fae40f0a8c933190f556 (patch)
tree0d506518180b3892026bff6e0b9b5d00e1894e74 /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
parentSend the config section name up to the service classes themselves (XInventory... (diff)
parentAdd Garmin Kawaguichi to CONTRIBUTORS.txt (diff)
downloadopensim-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/BSCharacter.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs24
1 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 20708d9..b08d5db 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -426,6 +426,8 @@ public class BSCharacter : PhysicsActor
426 } 426 }
427 } 427 }
428 428
429 // Called by the scene when a collision with this object is reported
430 CollisionEventUpdate collisionCollection = null;
429 public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth) 431 public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth)
430 { 432 {
431 // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); 433 // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith);
@@ -443,10 +445,24 @@ public class BSCharacter : PhysicsActor
443 if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; 445 if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return;
444 _lastCollisionTime = nowTime; 446 _lastCollisionTime = nowTime;
445 447
446 Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); 448 if (collisionCollection == null)
447 contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); 449 collisionCollection = new CollisionEventUpdate();
448 CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); 450 collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
449 base.SendCollisionUpdate(args); 451 }
452
453 public void SendCollisions()
454 {
455 // if (collisionCollection != null)
456 // {
457 // base.SendCollisionUpdate(collisionCollection);
458 // collisionCollection = null;
459 // }
460 // Kludge to make a collision call even if there are no collisions.
461 // This causes the avatar animation to get updated.
462 if (collisionCollection == null)
463 collisionCollection = new CollisionEventUpdate();
464 base.SendCollisionUpdate(collisionCollection);
465 collisionCollection = null;
450 } 466 }
451 467
452} 468}