diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index ab2835c..6621d39 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -532,26 +532,26 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
532 | } | 532 | } |
533 | } | 533 | } |
534 | 534 | ||
535 | // This is a kludge to get avatar movement updates. | ||
536 | // The simulator expects collisions for avatars even if there are have been no collisions. This updates | ||
537 | // avatar animations and stuff. | ||
538 | // If you fix avatar animation updates, remove this overhead and let normal collision processing happen. | ||
539 | foreach (BSPhysObject bsp in m_avatars) | ||
540 | bsp.SendCollisions(); | ||
541 | |||
542 | // The above SendCollision's batch up the collisions on the objects. | 535 | // The above SendCollision's batch up the collisions on the objects. |
543 | // Now push the collisions into the simulator. | 536 | // Now push the collisions into the simulator. |
544 | if (ObjectsWithCollisions.Count > 0) | 537 | if (ObjectsWithCollisions.Count > 0) |
545 | { | 538 | { |
546 | foreach (BSPhysObject bsp in ObjectsWithCollisions) | 539 | foreach (BSPhysObject bsp in ObjectsWithCollisions) |
547 | if (!m_avatars.Contains(bsp)) // don't call avatars twice | 540 | if (!bsp.SendCollisions()) |
548 | if (!bsp.SendCollisions()) | 541 | { |
549 | { | 542 | // If the object is done colliding, see that it's removed from the colliding list |
550 | // If the object is done colliding, see that it's removed from the colliding list | 543 | ObjectsWithNoMoreCollisions.Add(bsp); |
551 | ObjectsWithNoMoreCollisions.Add(bsp); | 544 | } |
552 | } | ||
553 | } | 545 | } |
554 | 546 | ||
547 | // This is a kludge to get avatar movement updates. | ||
548 | // The simulator expects collisions for avatars even if there are have been no collisions. | ||
549 | // The event updates avatar animations and stuff. | ||
550 | // If you fix avatar animation updates, remove this overhead and let normal collision processing happen. | ||
551 | foreach (BSPhysObject bsp in m_avatars) | ||
552 | if (!ObjectsWithCollisions.Contains(bsp)) // don't call avatars twice | ||
553 | bsp.SendCollisions(); | ||
554 | |||
555 | // Objects that are done colliding are removed from the ObjectsWithCollisions list. | 555 | // Objects that are done colliding are removed from the ObjectsWithCollisions list. |
556 | // Not done above because it is inside an iteration of ObjectWithCollisions. | 556 | // Not done above because it is inside an iteration of ObjectWithCollisions. |
557 | if (ObjectsWithNoMoreCollisions.Count > 0) | 557 | if (ObjectsWithNoMoreCollisions.Count > 0) |
@@ -575,6 +575,10 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
575 | } | 575 | } |
576 | } | 576 | } |
577 | 577 | ||
578 | // This causes the unmanaged code to output ALL the values found in ALL the objects in the world. | ||
579 | // Only enable this in a limited test world with few objects. | ||
580 | // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG | ||
581 | |||
578 | // The physics engine returns the number of milliseconds it simulated this call. | 582 | // The physics engine returns the number of milliseconds it simulated this call. |
579 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | 583 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. |
580 | // We multiply by 55 to give a recognizable running rate (55 or less). | 584 | // We multiply by 55 to give a recognizable running rate (55 or less). |