From 84c9bd52d3c2e01f1b385a6dd0fc4822a652867b Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 26 Mar 2012 13:48:15 -0700 Subject: BulletSim: update BulletSim binaries and configuration fixing a crash which happens when there are more than a few hundred physical objects. --- bin/OpenSimDefaults.ini | 3 ++- bin/lib32/BulletSim.dll | Bin 533504 -> 533504 bytes bin/lib32/libBulletSim.so | Bin 619149 -> 619145 bytes bin/lib64/BulletSim.dll | Bin 685056 -> 686080 bytes bin/lib64/libBulletSim.so | Bin 688874 -> 688866 bytes 5 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 41be415..28c5587 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -864,8 +864,9 @@ CcdMotionThreshold = 0.0 CcdSweptSphereRadius = 0.0 ContactProcessingThreshold = 0.1 + ; If setting a pool size, also disable dynamic allocation (default pool size is 4096 with dynamic alloc) MaxPersistantManifoldPoolSize = 0; - ShouldDisableContactPoolDynamicAllocation = True; + ShouldDisableContactPoolDynamicAllocation = False; ShouldForceUpdateAllAabbs = False; ShouldRandomizeSolverOrder = False; ShouldSplitSimulationIslands = False; diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index 357f26e..5bef6e9 100755 Binary files a/bin/lib32/BulletSim.dll and b/bin/lib32/BulletSim.dll differ diff --git a/bin/lib32/libBulletSim.so b/bin/lib32/libBulletSim.so index 948d8e3..9882f5b 100755 Binary files a/bin/lib32/libBulletSim.so and b/bin/lib32/libBulletSim.so differ diff --git a/bin/lib64/BulletSim.dll b/bin/lib64/BulletSim.dll index db8530c..9f09ef8 100755 Binary files a/bin/lib64/BulletSim.dll and b/bin/lib64/BulletSim.dll differ diff --git a/bin/lib64/libBulletSim.so b/bin/lib64/libBulletSim.so index b2fd9d2..fa47bf1 100755 Binary files a/bin/lib64/libBulletSim.so and b/bin/lib64/libBulletSim.so differ -- cgit v1.1 From 872d513daaa68b94b78f71bd2a2d9a0f117ff727 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 26 Mar 2012 17:36:33 -0700 Subject: 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. --- .../Region/Physics/BulletSPlugin/BSCharacter.cs | 24 ++++++++++++++++++---- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 18 +++++++++++----- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 15 ++++++++++++++ 3 files changed, 48 insertions(+), 9 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 } } + // Called by the scene when a collision with this object is reported + CollisionEventUpdate collisionCollection = null; public void Collide(uint collidingWith, ActorTypes type, Vector3 contactPoint, Vector3 contactNormal, float pentrationDepth) { // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); @@ -443,10 +445,24 @@ public class BSCharacter : PhysicsActor if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; _lastCollisionTime = nowTime; - Dictionary contactPoints = new Dictionary(); - contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); - CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); - base.SendCollisionUpdate(args); + if (collisionCollection == null) + collisionCollection = new CollisionEventUpdate(); + collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); + } + + public void SendCollisions() + { + // if (collisionCollection != null) + // { + // base.SendCollisionUpdate(collisionCollection); + // collisionCollection = null; + // } + // Kludge to make a collision call even if there are no collisions. + // This causes the avatar animation to get updated. + if (collisionCollection == null) + collisionCollection = new CollisionEventUpdate(); + base.SendCollisionUpdate(collisionCollection); + collisionCollection = null; } } 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 } // I've collided with something + CollisionEventUpdate collisionCollection = null; public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) { // m_log.DebugFormat("{0}: Collide: ms={1}, id={2}, with={3}", LogHeader, _subscribedEventsMs, LocalID, collidingWith); @@ -1343,11 +1344,18 @@ public sealed class BSPrim : PhysicsActor if (nowTime < (_lastCollisionTime + _subscribedEventsMs)) return; _lastCollisionTime = nowTime; - // create the event for the collision - Dictionary contactPoints = new Dictionary(); - contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); - CollisionEventUpdate args = new CollisionEventUpdate(contactPoints); - base.SendCollisionUpdate(args); + if (collisionCollection == null) + collisionCollection = new CollisionEventUpdate(); + collisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); + } + + public void SendCollisions() + { + if (collisionCollection != null) + { + base.SendCollisionUpdate(collisionCollection); + collisionCollection = null; + } } } } diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 581d540..94a0ccf 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -78,6 +78,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters private Dictionary m_avatars = new Dictionary(); private Dictionary m_prims = new Dictionary(); + private HashSet m_avatarsWithCollisions = new HashSet(); + private HashSet m_primsWithCollisions = new HashSet(); private List m_vehicles = new List(); private float[] m_heightMap; private float m_waterLevel; @@ -435,6 +437,17 @@ public class BSScene : PhysicsScene, IPhysicsParameters } } + // The SendCollision's batch up the collisions on the objects. Now push the collisions into the simulator. + foreach (BSPrim bsp in m_primsWithCollisions) + bsp.SendCollisions(); + m_primsWithCollisions.Clear(); + // foreach (BSCharacter bsc in m_avatarsWithCollisions) + // bsc.SendCollisions(); + // This is a kludge to get avatar movement updated. ODE sends collisions even if there isn't any + foreach (KeyValuePair kvp in m_avatars) + kvp.Value.SendCollisions(); + m_avatarsWithCollisions.Clear(); + // If any of the objects had updated properties, tell the object it has been changed by the physics engine if (updatedEntityCount > 0) { @@ -485,11 +498,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters BSPrim prim; if (m_prims.TryGetValue(localID, out prim)) { prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration); + m_primsWithCollisions.Add(prim); return; } BSCharacter actor; if (m_avatars.TryGetValue(localID, out actor)) { actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration); + m_avatarsWithCollisions.Add(actor); return; } return; -- cgit v1.1 From 1aa1a9eb3d3f5690c7ff0dff9ff843f2e638bb6d Mon Sep 17 00:00:00 2001 From: Garmin Kawaguichi Date: Sun, 25 Mar 2012 16:25:41 +0200 Subject: In TerrainModule.cs, the command terrain save-tile is modified to remove an unnecessary double argument "minimum Y tile" --- OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 17e9737..b3c2969 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -1197,8 +1197,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain saveToTileCommand.AddArgument("file height", "The height of the file in tiles", "Integer"); saveToTileCommand.AddArgument("minimum X tile", "The X region coordinate of the first section on the file", "Integer"); - saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first section on the file", - "Integer"); saveToTileCommand.AddArgument("minimum Y tile", "The Y region coordinate of the first tile on the file\n" + "= Example =\n" + "To save a PNG file for a set of map tiles 2 regions wide and 3 regions high from map co-ordinate (9910,10234)\n" -- cgit v1.1 From b78224176ef6daaf1b16d67e775f704d00c0d9b4 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 27 Mar 2012 02:10:39 +0100 Subject: Add Garmin Kawaguichi to CONTRIBUTORS.txt --- CONTRIBUTORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index e6956bb..31aeda3 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -89,6 +89,7 @@ what it is today. * Fernando Oliveira * Fly-Man * Flyte Xevious +* Garmin Kawaguichi * Imaze Rhiano * Intimidated * Jeremy Bongio (IBM) -- cgit v1.1