BulletSim: most of the plumbing for raycast. Needs new BulletSim.dll to

work.
This commit is contained in:
Robert Adams
2017-09-02 13:06:36 -07:00
parent 22c7450363
commit 0afa3a294a
8 changed files with 252 additions and 0 deletions

View File

@@ -1404,6 +1404,19 @@ public override float GetMargin(BulletShape shape)
return BSAPICPP.GetMargin2(shapeu.ptr);
}
// =====================================================================================
// Raycast
public override SweepHit ConvexSweepTest2(BulletWorld world, BulletBody sweepObject, Vector3 from, Vector3 to, float margin) {
BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu = sweepObject as BulletBodyUnman;
return BSAPICPP.ConvexSweepTest2(worldu.ptr, bodyu.ptr, from, to, margin);
}
public override RaycastHit RayTest2(BulletWorld world, Vector3 from, Vector3 to, uint filterGroup, uint filterMask) {
BulletWorldUnman worldu = world as BulletWorldUnman;
return BSAPICPP.RayTest2(worldu.ptr, from, to, filterGroup, filterMask);
}
// =====================================================================================
// Debugging
public override void DumpRigidBody(BulletWorld world, BulletBody collisionObject)
@@ -2084,6 +2097,15 @@ public static extern void SetMargin2(IntPtr shape, float val);
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern float GetMargin2(IntPtr shape);
// =====================================================================================
// Raycast
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern SweepHit ConvexSweepTest2(IntPtr sim, IntPtr obj, Vector3 from, Vector3 to, float margin);
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern RaycastHit RayTest2(IntPtr sim, Vector3 from, Vector3 to, uint filterGroup, uint filterMask);
// =====================================================================================
// Debugging
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]