diff options
author | Robert Adams | 2013-09-10 17:32:01 -0700 |
---|---|---|
committer | Robert Adams | 2013-09-11 09:12:24 -0700 |
commit | 6e39cc316f502855a89c51775e7394b73135ab86 (patch) | |
tree | 30ae219ec41952beb10bf2b3dd04839bdd03c157 /OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | |
parent | BulletSim: update DLLs and SOs for spring parameters and constraint (diff) | |
download | opensim-SC-6e39cc316f502855a89c51775e7394b73135ab86.zip opensim-SC-6e39cc316f502855a89c51775e7394b73135ab86.tar.gz opensim-SC-6e39cc316f502855a89c51775e7394b73135ab86.tar.bz2 opensim-SC-6e39cc316f502855a89c51775e7394b73135ab86.tar.xz |
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.
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs index ff2b497..17ebed2 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIXNA.cs | |||
@@ -169,6 +169,19 @@ private sealed class BulletConstraintXNA : BulletConstraint | |||
169 | return true; | 169 | return true; |
170 | } | 170 | } |
171 | 171 | ||
172 | public override bool ClearCollisionProxyCache(BulletWorld pWorld, BulletBody pBody) | ||
173 | { | ||
174 | DiscreteDynamicsWorld world = (pWorld as BulletWorldXNA).world; | ||
175 | RigidBody body = ((BulletBodyXNA)pBody).rigidBody; | ||
176 | CollisionObject collisionObject = ((BulletBodyXNA)pBody).body; | ||
177 | if (body != null && collisionObject != null && collisionObject.GetBroadphaseHandle() != null) | ||
178 | { | ||
179 | world.RemoveCollisionObject(collisionObject); | ||
180 | world.AddCollisionObject(collisionObject); | ||
181 | } | ||
182 | return true; | ||
183 | } | ||
184 | |||
172 | public override bool AddConstraintToWorld(BulletWorld pWorld, BulletConstraint pConstraint, bool pDisableCollisionsBetweenLinkedObjects) | 185 | public override bool AddConstraintToWorld(BulletWorld pWorld, BulletConstraint pConstraint, bool pDisableCollisionsBetweenLinkedObjects) |
173 | { | 186 | { |
174 | DiscreteDynamicsWorld world = (pWorld as BulletWorldXNA).world; | 187 | DiscreteDynamicsWorld world = (pWorld as BulletWorldXNA).world; |