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.
This commit is contained in:
Robert Adams
2013-09-10 17:32:01 -07:00
parent e34385634b
commit 6e39cc316f
4 changed files with 35 additions and 2 deletions

View File

@@ -725,6 +725,13 @@ public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj)
return BSAPICPP.RemoveObjectFromWorld2(worldu.ptr, bodyu.ptr);
}
public override bool ClearCollisionProxyCache(BulletWorld world, BulletBody obj)
{
BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu = obj as BulletBodyUnman;
return BSAPICPP.ClearCollisionProxyCache2(worldu.ptr, bodyu.ptr);
}
public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects)
{
BulletWorldUnman worldu = world as BulletWorldUnman;
@@ -1712,6 +1719,9 @@ public static extern bool AddObjectToWorld2(IntPtr world, IntPtr obj);
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern bool RemoveObjectFromWorld2(IntPtr world, IntPtr obj);
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern bool ClearCollisionProxyCache2(IntPtr world, IntPtr obj);
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern bool AddConstraintToWorld2(IntPtr world, IntPtr constrain, bool disableCollisionsBetweenLinkedObjects);