diff options
author | Robert Adams | 2012-12-16 21:18:32 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-16 21:19:13 -0800 |
commit | 2b8efa24dd816fda23fe3aed5822af1d50febf5d (patch) | |
tree | 287352bc66cf34ce25ee86a59099af43d2d23cb4 /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |
parent | BulletSim: add even more to the TODO list. (diff) | |
download | opensim-SC-2b8efa24dd816fda23fe3aed5822af1d50febf5d.zip opensim-SC-2b8efa24dd816fda23fe3aed5822af1d50febf5d.tar.gz opensim-SC-2b8efa24dd816fda23fe3aed5822af1d50febf5d.tar.bz2 opensim-SC-2b8efa24dd816fda23fe3aed5822af1d50febf5d.tar.xz |
BulletSim: add parameter to UpdateProperties call into the linkset so changes from the physics engine can be differentiated from changes made by the user. This eliminates a linkset rebuild loop. Also add logic to not rebuild or freak out when the object/linkset crosses a terrain boundry.
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 6539b43..92a5f2f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -214,7 +214,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
214 | { | 214 | { |
215 | bool ret = true; | 215 | bool ret = true; |
216 | // If the 'no collision' call, force it to happen right now so quick collision_end | 216 | // If the 'no collision' call, force it to happen right now so quick collision_end |
217 | bool force = CollisionCollection.Count == 0; | 217 | bool force = (CollisionCollection.Count == 0); |
218 | 218 | ||
219 | // throttle the collisions to the number of milliseconds specified in the subscription | 219 | // throttle the collisions to the number of milliseconds specified in the subscription |
220 | if (force || (PhysicsScene.SimulationNowTime >= NextCollisionOkTime)) | 220 | if (force || (PhysicsScene.SimulationNowTime >= NextCollisionOkTime)) |
@@ -232,8 +232,10 @@ public abstract class BSPhysObject : PhysicsActor | |||
232 | // DetailLog("{0},{1}.SendCollisionUpdate,call,numCollisions={2}", LocalID, TypeName, CollisionCollection.Count); | 232 | // DetailLog("{0},{1}.SendCollisionUpdate,call,numCollisions={2}", LocalID, TypeName, CollisionCollection.Count); |
233 | base.SendCollisionUpdate(CollisionCollection); | 233 | base.SendCollisionUpdate(CollisionCollection); |
234 | 234 | ||
235 | // The collisionCollection structure is passed around in the simulator. | 235 | // The CollisionCollection instance is passed around in the simulator. |
236 | // Make sure we don't have a handle to that one and that a new one is used for next time. | 236 | // Make sure we don't have a handle to that one and that a new one is used for next time. |
237 | // This fixes an interesting 'gotcha'. If we call CollisionCollection.Clear() here, | ||
238 | // a race condition is created for the other users of this instance. | ||
237 | CollisionCollection = new CollisionEventUpdate(); | 239 | CollisionCollection = new CollisionEventUpdate(); |
238 | } | 240 | } |
239 | return ret; | 241 | return ret; |
@@ -251,7 +253,8 @@ public abstract class BSPhysObject : PhysicsActor | |||
251 | 253 | ||
252 | PhysicsScene.TaintedObject(TypeName+".SubscribeEvents", delegate() | 254 | PhysicsScene.TaintedObject(TypeName+".SubscribeEvents", delegate() |
253 | { | 255 | { |
254 | CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(PhysBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 256 | if (PhysBody.HasPhysicalBody) |
257 | CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(PhysBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | ||
255 | }); | 258 | }); |
256 | } | 259 | } |
257 | else | 260 | else |