From ae5db637f29dbc3fda49580f5a0f869d1b0b4958 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 15 Aug 2012 15:14:58 -0700 Subject: BulletSim: update DLLs and SOs to fix the problem with avatars jumping around at altitudes less than 25m. --- bin/lib32/BulletSim.dll | Bin 550400 -> 553472 bytes bin/lib32/libBulletSim.so | Bin 2387345 -> 2387051 bytes bin/lib64/BulletSim.dll | Bin 706048 -> 709632 bytes bin/lib64/libBulletSim.so | Bin 2599320 -> 2599546 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/lib32/BulletSim.dll b/bin/lib32/BulletSim.dll index 0f2d522..cc55f00 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 783c9a2..26ad52b 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 c2a2bda..94dae95 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 74d4f98..52e9960 100755 Binary files a/bin/lib64/libBulletSim.so and b/bin/lib64/libBulletSim.so differ -- cgit v1.1 From 376441e5507052b36279279f64896542d44ec12a Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 15 Aug 2012 16:27:30 -0700 Subject: BulletSim: make it so objects in a linkset do not generate collisions with each other. --- OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 7 +++++++ OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 10 ++++++++++ OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 12 ++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index 087b9bb..1b3ba3f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs @@ -42,6 +42,9 @@ public class BSLinkset private BSScene m_physicsScene; public BSScene PhysicsScene { get { return m_physicsScene; } } + static int m_nextLinksetID = 1; + public int LinksetID { get; private set; } + // The children under the root in this linkset private List m_children; @@ -74,6 +77,10 @@ public class BSLinkset public BSLinkset(BSScene scene, BSPrim parent) { // A simple linkset of one (no children) + LinksetID = m_nextLinksetID++; + // We create LOTS of linksets. + if (m_nextLinksetID < 0) + m_nextLinksetID = 1; m_physicsScene = scene; m_linksetRoot = parent; m_children = new List(); diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 9c20004..c157669 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -1353,6 +1353,7 @@ public sealed class BSPrim : PhysicsActor } // I've collided with something + // Called at taint time from within the Step() function CollisionEventUpdate collisionCollection; public void Collide(uint collidingWith, ActorTypes type, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) { @@ -1366,6 +1367,15 @@ public sealed class BSPrim : PhysicsActor } // DetailLog("{0},BSPrim.Collison,call,with={1}", LocalID, collidingWith); + BSPrim collidingWithPrim; + if (_scene.Prims.TryGetValue(collidingWith, out collidingWithPrim)) + { + // prims in the same linkset cannot collide with each other + if (this.Linkset.LinksetID == collidingWithPrim.Linkset.LinksetID) + { + return; + } + } // if someone is subscribed to collision events.... if (_subscribedEventsMs != 0) { diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index a31c578..0a0e27e 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -78,10 +78,16 @@ public class BSScene : PhysicsScene, IPhysicsParameters public string BulletSimVersion = "?"; private Dictionary m_avatars = new Dictionary(); + public Dictionary Characters { get { return m_avatars; } } + private Dictionary m_prims = new Dictionary(); + public Dictionary Prims { get { return m_prims; } } + 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; private uint m_worldID; @@ -429,13 +435,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters { numSubSteps = BulletSimAPI.PhysicsStep(m_worldID, timeStep, m_maxSubSteps, m_fixedTimeStep, out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr); - // DetailLog("{0},Simulate,call, substeps={1}, updates={2}, colliders={3}", DetailLogZero, numSubSteps, updatedEntityCount, collidersCount); + DetailLog("{0},Simulate,call, substeps={1}, updates={2}, colliders={3}", DetailLogZero, numSubSteps, updatedEntityCount, collidersCount); } catch (Exception e) { m_log.WarnFormat("{0},PhysicsStep Exception: substeps={1}, updates={2}, colliders={3}, e={4}", LogHeader, numSubSteps, updatedEntityCount, collidersCount, e); // DetailLog("{0},PhysicsStepException,call, substeps={1}, updates={2}, colliders={3}", DetailLogZero, numSubSteps, updatedEntityCount, collidersCount); - // updatedEntityCount = 0; + updatedEntityCount = 0; collidersCount = 0; } @@ -534,6 +540,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters else if (m_avatars.ContainsKey(collidingWith)) type = ActorTypes.Agent; + DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); + BSPrim prim; if (m_prims.TryGetValue(localID, out prim)) { prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration); -- cgit v1.1 From 57a98796693cdd34efefbc9235b5d0aa765db095 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 15 Aug 2012 16:39:00 -0700 Subject: Correct an exception report in SceneObjectPart so it outputs the stack. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index cd75224..bd6369c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -733,7 +733,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); + m_log.ErrorFormat("[SCENEOBJECTPART]: GROUP POSITION. {0}", e); } } -- cgit v1.1