diff options
author | Robert Adams | 2012-12-21 23:03:27 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-21 23:03:27 -0800 |
commit | 37fb691ba56a72b95eeeacc13fb16c1f03af6006 (patch) | |
tree | 130cd3fbf9fddc7b26e6c1e53a330849d4622dbc /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |
parent | BulletSim: add BSPhysObject code to manage registrations of preStep events. U... (diff) | |
download | opensim-SC-37fb691ba56a72b95eeeacc13fb16c1f03af6006.zip opensim-SC-37fb691ba56a72b95eeeacc13fb16c1f03af6006.tar.gz opensim-SC-37fb691ba56a72b95eeeacc13fb16c1f03af6006.tar.bz2 opensim-SC-37fb691ba56a72b95eeeacc13fb16c1f03af6006.tar.xz |
BulletSim: Fix llApplyImpulse so it works after the first impulse. The problem was Bullet deactivating the object between the pushes (when, as far as the physics engine is concerned, it isn't moving).
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 9525a11..19de1e5 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -304,17 +304,21 @@ public abstract class BSPhysObject : PhysicsActor | |||
304 | string identifier = op + "-" + id.ToString(); | 304 | string identifier = op + "-" + id.ToString(); |
305 | RegisteredActions[identifier] = actn; | 305 | RegisteredActions[identifier] = actn; |
306 | PhysicsScene.BeforeStep += actn; | 306 | PhysicsScene.BeforeStep += actn; |
307 | DetailLog("{0},BSPhysObject.RegisterPreStepAction,id={1}", LocalID, identifier); | ||
307 | } | 308 | } |
308 | 309 | ||
309 | // Unregister a pre step action. Safe to call if the action has not been registered. | 310 | // Unregister a pre step action. Safe to call if the action has not been registered. |
310 | protected void UnRegisterPreStepAction(string op, uint id) | 311 | protected void UnRegisterPreStepAction(string op, uint id) |
311 | { | 312 | { |
312 | string identifier = op + "-" + id.ToString(); | 313 | string identifier = op + "-" + id.ToString(); |
314 | bool removed = false; | ||
313 | if (RegisteredActions.ContainsKey(identifier)) | 315 | if (RegisteredActions.ContainsKey(identifier)) |
314 | { | 316 | { |
315 | PhysicsScene.BeforeStep -= RegisteredActions[identifier]; | 317 | PhysicsScene.BeforeStep -= RegisteredActions[identifier]; |
316 | RegisteredActions.Remove(identifier); | 318 | RegisteredActions.Remove(identifier); |
319 | removed = true; | ||
317 | } | 320 | } |
321 | DetailLog("{0},BSPhysObject.UnRegisterPreStepAction,id={1},removed={2}", LocalID, identifier, removed); | ||
318 | } | 322 | } |
319 | 323 | ||
320 | protected void UnRegisterAllPreStepActions() | 324 | protected void UnRegisterAllPreStepActions() |
@@ -324,6 +328,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
324 | PhysicsScene.BeforeStep -= kvp.Value; | 328 | PhysicsScene.BeforeStep -= kvp.Value; |
325 | } | 329 | } |
326 | RegisteredActions.Clear(); | 330 | RegisteredActions.Clear(); |
331 | DetailLog("{0},BSPhysObject.UnRegisterAllPreStepActions,", LocalID); | ||
327 | } | 332 | } |
328 | 333 | ||
329 | 334 | ||