diff options
author | Robert Adams | 2012-03-26 17:36:33 -0700 |
---|---|---|
committer | Robert Adams | 2012-03-26 17:36:33 -0700 |
commit | 872d513daaa68b94b78f71bd2a2d9a0f117ff727 (patch) | |
tree | 3f526fbad3394fa41a86e4aa6aa0a934c9119f3b /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |
parent | BulletSim: update BulletSim binaries and configuration fixing a crash which h... (diff) | |
download | opensim-SC-872d513daaa68b94b78f71bd2a2d9a0f117ff727.zip opensim-SC-872d513daaa68b94b78f71bd2a2d9a0f117ff727.tar.gz opensim-SC-872d513daaa68b94b78f71bd2a2d9a0f117ff727.tar.bz2 opensim-SC-872d513daaa68b94b78f71bd2a2d9a0f117ff727.tar.xz |
BulletSim: make avatar animations update properly.
It seems that ODE calls the avatar collision handling routine even
if there are no collisions. This causes the animation to be updated.
So, for instance, going from HOVER to FLY is caused by the physics engine
calling the collision routine each frame with 0 collisions.
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 | } |