From 6f1f299619d0ca60e06dc03d499259efcd4eeb80 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 14 Aug 2012 16:22:21 -0700 Subject: BulletSim: Add the class BSCharacter to the DetailLog output --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index f164afe..d288ab7 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -137,7 +137,7 @@ public class BSCharacter : PhysicsActor // called when this character is being destroyed and the resources should be released public void Destroy() { - // DetailLog("{0},Destroy", LocalID); + // DetailLog("{0},BSCharacter.Destroy", LocalID); _scene.TaintedObject("BSCharacter.destroy", delegate() { BulletSimAPI.DestroyObject(_scene.WorldID, _localID); @@ -209,7 +209,7 @@ public class BSCharacter : PhysicsActor _scene.TaintedObject("BSCharacter.setPosition", delegate() { - DetailLog("{0},SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation); + DetailLog("{0},BSCharacter.SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation); BulletSimAPI.SetObjectTranslation(_scene.WorldID, _localID, _position, _orientation); }); } @@ -226,7 +226,7 @@ public class BSCharacter : PhysicsActor float terrainHeight = Scene.GetTerrainHeightAtXYZ(_position); if (_position.Z < terrainHeight) { - DetailLog("{0},PositionAdjustUnderGround,call,pos={1},orient={2}", LocalID, _position, _orientation); + DetailLog("{0},BSCharacter.PositionAdjustUnderGround,call,pos={1},orient={2}", LocalID, _position, _orientation); _position.Z = terrainHeight + 2.0f; ret = true; } @@ -368,7 +368,7 @@ public class BSCharacter : PhysicsActor set { _buoyancy = value; _scene.TaintedObject("BSCharacter.setBuoyancy", delegate() { - DetailLog("{0},setBuoyancy,taint,buoy={1}", LocalID, _buoyancy); + DetailLog("{0},BSCharacter.setBuoyancy,taint,buoy={1}", LocalID, _buoyancy); BulletSimAPI.SetObjectBuoyancy(_scene.WorldID, LocalID, _buoyancy); }); } @@ -415,7 +415,7 @@ public class BSCharacter : PhysicsActor // m_log.DebugFormat("{0}: AddForce. adding={1}, newForce={2}", LogHeader, force, _force); _scene.TaintedObject("BSCharacter.AddForce", delegate() { - DetailLog("{0},setAddForce,taint,addedForce={1}", LocalID, _force); + DetailLog("{0},BSCharacter.setAddForce,taint,addedForce={1}", LocalID, _force); BulletSimAPI.AddObjectForce2(Body.Ptr, _force); }); } @@ -507,6 +507,7 @@ public class BSCharacter : PhysicsActor { _collidingGroundStep = _scene.SimulationStep; } + // DetailLog("{0},BSCharacter.Collison,call,with={1}", LocalID, collidingWith); // throttle collisions to the rate specified in the subscription if (_subscribedEventsMs != 0) { @@ -535,7 +536,10 @@ public class BSCharacter : PhysicsActor if (collisionCollection == null) collisionCollection = new CollisionEventUpdate(); base.SendCollisionUpdate(collisionCollection); - collisionCollection.Clear(); + // If there were any collisions in the collection, make sure we don't use the + // same instance next time. + if (collisionCollection.Count > 0) + collisionCollection = null; // End kludge } -- cgit v1.1