aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2012-10-19 10:48:45 -0700
committerRobert Adams2012-10-19 10:52:31 -0700
commitf422b9b388fe67c61e610c79efabd5e07512884b (patch)
tree7ad1c226e8541742164e83cf18e8baf595061367 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentBulletSim: change nonimal physics frame rate to 55 to give same numbers as ODE. (diff)
downloadopensim-SC_OLD-f422b9b388fe67c61e610c79efabd5e07512884b.zip
opensim-SC_OLD-f422b9b388fe67c61e610c79efabd5e07512884b.tar.gz
opensim-SC_OLD-f422b9b388fe67c61e610c79efabd5e07512884b.tar.bz2
opensim-SC_OLD-f422b9b388fe67c61e610c79efabd5e07512884b.tar.xz
BulletSim: reorder avatar collision checking to eliminate double collision_end.
Various tweekings to avatar shape/mass/inertia/etc. Remove change from avatar radius to diameter. But still the avatar sinks. Collision_end now happens immediately rather than at the next subscription time.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs30
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).