aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
diff options
context:
space:
mode:
authorRobert Adams2015-08-23 21:15:04 -0700
committerRobert Adams2015-08-23 21:15:04 -0700
commit062ec0efbda0e4ca6df5541039569e023d0d0e79 (patch)
tree0ac986a1df10d6df00681464fd75bca4796cbfe8 /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
parentIn ScenePresence, when removing from the physical scene, unsubscribe (diff)
downloadopensim-SC_OLD-062ec0efbda0e4ca6df5541039569e023d0d0e79.zip
opensim-SC_OLD-062ec0efbda0e4ca6df5541039569e023d0d0e79.tar.gz
opensim-SC_OLD-062ec0efbda0e4ca6df5541039569e023d0d0e79.tar.bz2
opensim-SC_OLD-062ec0efbda0e4ca6df5541039569e023d0d0e79.tar.xz
BulletSim: delay adding a scene presence to the list of presences
until it is fully configured. Another addition to fixing the collisions stopping problem.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index 90da7a6..4669d91 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -72,6 +72,11 @@ public abstract class BSPhysObject : PhysicsActor
72 } 72 }
73 protected BSPhysObject(BSScene parentScene, uint localID, string name, string typeName) 73 protected BSPhysObject(BSScene parentScene, uint localID, string name, string typeName)
74 { 74 {
75 InitializePhysObject(parentScene, localID, name, typeName);
76 }
77
78 protected void InitializePhysObject(BSScene parentScene, uint localID, string name, string typeName)
79 {
75 IsInitialized = false; 80 IsInitialized = false;
76 81
77 PhysScene = parentScene; 82 PhysScene = parentScene;
@@ -119,6 +124,8 @@ public abstract class BSPhysObject : PhysicsActor
119 // Tell the object to clean up. 124 // Tell the object to clean up.
120 public virtual void Destroy() 125 public virtual void Destroy()
121 { 126 {
127 SubscribedEventsMs = 0;
128
122 PhysicalActors.Enable(false); 129 PhysicalActors.Enable(false);
123 PhysScene.TaintedObject(LocalID, "BSPhysObject.Destroy", delegate() 130 PhysScene.TaintedObject(LocalID, "BSPhysObject.Destroy", delegate()
124 { 131 {
@@ -455,6 +462,7 @@ public abstract class BSPhysObject : PhysicsActor
455 // Return 'true' if a collision was processed and should be sent up. 462 // Return 'true' if a collision was processed and should be sent up.
456 // Return 'false' if this object is not enabled/subscribed/appropriate for or has already seen this collision. 463 // Return 'false' if this object is not enabled/subscribed/appropriate for or has already seen this collision.
457 // Called at taint time from within the Step() function 464 // Called at taint time from within the Step() function
465 // Both 'CollisionLock' and 'PhysObjects' are locked when this is called by 'SendCollisions'.
458 public delegate bool CollideCall(uint collidingWith, BSPhysObject collidee, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth); 466 public delegate bool CollideCall(uint collidingWith, BSPhysObject collidee, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth);
459 public virtual bool Collide(uint collidingWith, BSPhysObject collidee, 467 public virtual bool Collide(uint collidingWith, BSPhysObject collidee,
460 OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) 468 OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth)
@@ -512,7 +520,7 @@ public abstract class BSPhysObject : PhysicsActor
512 520
513 // If no collisions this call but there were collisions last call, force the collision 521 // If no collisions this call but there were collisions last call, force the collision
514 // event to be happen right now so quick collision_end. 522 // event to be happen right now so quick collision_end.
515 bool force = (CollisionCollection.Count == 0 && CollisionsLastReported.Count != 0); 523 bool force = (CollisionCollection.Count == 0 && CollisionsLastReported.Count != 0);
516 524
517 // throttle the collisions to the number of milliseconds specified in the subscription 525 // throttle the collisions to the number of milliseconds specified in the subscription
518 if (force || (PhysScene.SimulationNowTime >= NextCollisionOkTime)) 526 if (force || (PhysScene.SimulationNowTime >= NextCollisionOkTime))
@@ -545,7 +553,7 @@ public abstract class BSPhysObject : PhysicsActor
545 // Subscribe for collision events. 553 // Subscribe for collision events.
546 // Parameter is the millisecond rate the caller wishes collision events to occur. 554 // Parameter is the millisecond rate the caller wishes collision events to occur.
547 public override void SubscribeEvents(int ms) { 555 public override void SubscribeEvents(int ms) {
548 // DetailLog("{0},{1}.SubscribeEvents,subscribing,ms={2}", LocalID, TypeName, ms); 556 DetailLog("{0},{1}.SubscribeEvents,subscribing,ms={2}", LocalID, TypeName, ms);
549 SubscribedEventsMs = ms; 557 SubscribedEventsMs = ms;
550 if (ms > 0) 558 if (ms > 0)
551 { 559 {