From f82b903deeaaf8eaa7ae5c4d4b7e917dd0a6ce7b Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 27 Sep 2012 08:23:29 -0700 Subject: BulletSim: Fix linkset crash. Caused by the different body and shape pointers at runtime and at taint-time. Now passes the body into the taint. Vehicles zero inertia when active to eliminate Bullet's contribution to vehicle motion. --- OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 4f83adc..df95625 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs @@ -135,8 +135,11 @@ public abstract class BSPhysObject : PhysicsActor // collision event to make collision_end work. // Called at taint time from within the Step() function thus no locking problems // with CollisionCollection and ObjectsWithNoMoreCollisions. - public virtual void SendCollisions() + // Return 'true' if there were some actual collisions passed up + public virtual bool SendCollisions() { + bool ret = true; + // throttle the collisions to the number of milliseconds specified in the subscription int nowTime = PhysicsScene.SimulationNowTime; if (nowTime >= NextCollisionOkTime) @@ -148,7 +151,7 @@ public abstract class BSPhysObject : PhysicsActor if (CollisionCollection.Count == 0) { // If I have no collisions this time, remove me from the list of objects with collisions. - PhysicsScene.ObjectsWithNoMoreCollisions.Add(this); + ret = false; } // DetailLog("{0},{1}.SendCollisionUpdate,call,numCollisions={2}", LocalID, TypeName, CollisionCollection.Count); @@ -158,6 +161,7 @@ public abstract class BSPhysObject : PhysicsActor // Make sure we don't have a handle to that one and that a new one is used for next time. CollisionCollection = new CollisionEventUpdate(); } + return ret; } // Subscribe for collision events. -- cgit v1.1