From 995314f91f72eef0048a58f30e8dd8051f6bf14e Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 20 Aug 2013 09:20:48 -0700 Subject: BulletSim: add ID parameter to TaintedObject calls so logging will include LocalID of object which created the taint. --- OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 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 9dc52d5..2efb1a5 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs @@ -121,7 +121,7 @@ public abstract class BSPhysObject : PhysicsActor public virtual void Destroy() { PhysicalActors.Enable(false); - PhysScene.TaintedObject("BSPhysObject.Destroy", delegate() + PhysScene.TaintedObject(LocalID, "BSPhysObject.Destroy", delegate() { PhysicalActors.Dispose(); }); @@ -509,7 +509,7 @@ public abstract class BSPhysObject : PhysicsActor // make sure first collision happens NextCollisionOkTime = Util.EnvironmentTickCountSubtract(SubscribedEventsMs); - PhysScene.TaintedObject(TypeName+".SubscribeEvents", delegate() + PhysScene.TaintedObject(LocalID, TypeName+".SubscribeEvents", delegate() { if (PhysBody.HasPhysicalBody) CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); @@ -524,7 +524,7 @@ public abstract class BSPhysObject : PhysicsActor public override void UnSubscribeEvents() { // DetailLog("{0},{1}.UnSubscribeEvents,unsubscribing", LocalID, TypeName); SubscribedEventsMs = 0; - PhysScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() + PhysScene.TaintedObject(LocalID, TypeName+".UnSubscribeEvents", delegate() { // Make sure there is a body there because sometimes destruction happens in an un-ideal order. if (PhysBody.HasPhysicalBody) -- cgit v1.1 From 6e39cc316f502855a89c51775e7394b73135ab86 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 10 Sep 2013 17:32:01 -0700 Subject: BulletSim: add ClearCollisionProxyCache function to API. Add proxy cache clearing when some properties are changed. This fixes a problem where objects would stop colliding of they were moved with setPosition mulitple times. --- OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 12 ++++++++++-- 1 file changed, 10 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 2efb1a5..47df611 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs @@ -300,8 +300,16 @@ public abstract class BSPhysObject : PhysicsActor // Called in taint-time!! public void ActivateIfPhysical(bool forceIt) { - if (IsPhysical && PhysBody.HasPhysicalBody) - PhysScene.PE.Activate(PhysBody, forceIt); + if (PhysBody.HasPhysicalBody) + { + // Clear the collision cache since we've changed some properties. + PhysScene.PE.ClearCollisionProxyCache(PhysScene.World, PhysBody); + if (IsPhysical) + { + // Physical objects might need activating + PhysScene.PE.Activate(PhysBody, forceIt); + } + } } // 'actors' act on the physical object to change or constrain its motion. These can range from -- cgit v1.1 From dacc20ee48883efe3702c284edff5ee3fa0e96b0 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 11 Sep 2013 16:48:15 -0700 Subject: BulletSim: remove collision cache clearing logic for physical objects. This fixes constraints from getting messed up when properties change. --- OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 7 +++++-- 1 file changed, 5 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 47df611..f89b376 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs @@ -302,13 +302,16 @@ public abstract class BSPhysObject : PhysicsActor { if (PhysBody.HasPhysicalBody) { - // Clear the collision cache since we've changed some properties. - PhysScene.PE.ClearCollisionProxyCache(PhysScene.World, PhysBody); if (IsPhysical) { // Physical objects might need activating PhysScene.PE.Activate(PhysBody, forceIt); } + else + { + // Clear the collision cache since we've changed some properties. + PhysScene.PE.ClearCollisionProxyCache(PhysScene.World, PhysBody); + } } } -- cgit v1.1