public override void OnUpdate()
        {
            base.OnUpdate();

            rotation += FrameDelta;
            rotBody.CenterOfMassTransform = Matrix.RotationX(rotation) * rotBodyPosition;

            var input = new DiscreteCollisionDetectorInterface.ClosestPointInput
            {
                TransformA = rotBody.CenterOfMassTransform,
                TransformB = body2Position
            };

            var result = new PointCollector();

            using (var detector = new GjkPairDetector(colShape0, colShape1, sGjkSimplexSolver, null))
            {
                detector.CachedSeparatingAxis = new Vector3(0.00000000f, 0.059727669f, 0.29259586f);
                detector.GetClosestPoints(input, result, null);
            }

            if (result.HasResult)
            {
                distanceFrom = result.PointInWorld;
                distanceTo = result.PointInWorld + result.NormalOnBInWorld * result.Distance;
                distance = result.Distance;
                World.DebugDrawer.DrawLine(ref distanceFrom, ref distanceTo, ref red);
            }
            result.Dispose();
        }
 public unsafe static void SetTransformB(this DiscreteCollisionDetectorInterface.ClosestPointInput obj, ref OpenTK.Matrix4 value)
 {
     fixed(OpenTK.Matrix4 *valuePtr = &value)
     {
         obj.TransformB = *(BulletSharp.Math.Matrix *)valuePtr;
     }
 }
 public static void SetTransformB(this DiscreteCollisionDetectorInterface.ClosestPointInput obj, OpenTK.Matrix4 value)
 {
     SetTransformB(obj, ref value);
 }
 public static OpenTK.Matrix4 GetTransformB(this DiscreteCollisionDetectorInterface.ClosestPointInput obj)
 {
     OpenTK.Matrix4 value;
     GetTransformB(obj, out value);
     return(value);
 }