Ejemplo n.º 1
0
		internal override void getClosestPoints( ClosestPointInput input, Result output, btIDebugDraw debugDraw, bool swapResults = false )
		{

			//(void)debugDraw;
			//btTransform transformA = input.m_transformA;
			//btTransform transformB = input.m_transformB;

			btVector3 point, normal;
			double timeOfImpact = btScalar.BT_ONE;
			double depth = btScalar.BT_ZERO;
			//	output.m_distance = (double)(BT_LARGE_FLOAT);
			//move sphere into triangle space
			btTransform sphereInTr; input.m_transformB.inverseTimes( ref input.m_transformA, out sphereInTr );

			if( collide( ref sphereInTr.m_origin, out point, out normal, out depth, timeOfImpact, m_contactBreakingThreshold ) )
			{
				if( swapResults )
				{

					btVector3 normalOnB; input.m_transformB.m_basis.Apply( ref normal, out normalOnB );
					btVector3 normalOnA; normalOnB.Invert( out normalOnA ); 
					btVector3 tmp;
					input.m_transformB.Apply( ref point, out tmp );

					btVector3 pointOnA; tmp.AddScale( ref normalOnB, depth, out pointOnA );
					output.addContactPoint( ref normalOnA, ref pointOnA, depth );
				}
				else
				{
					btVector3 tmp, tmp2;
					input.m_transformB.m_basis.Apply( ref normal, out tmp );
					input.m_transformB.Apply( ref point, out tmp2 );
					output.addContactPoint( ref tmp, ref tmp2, depth );
				}
			}

		}
Ejemplo n.º 2
0
 public void GetClosestPointsNonVirtual(ClosestPointInput input, Result output,
                                        IDebugDraw debugDraw)
 {
     btGjkPairDetector_getClosestPointsNonVirtual(_native, input._native,
                                                  output._native, DebugDraw.GetUnmanaged(debugDraw));
 }
		public void GetClosestPoints(ClosestPointInput input, Result output, IDebugDraw debugDraw, bool swapResults)
		{
			btDiscreteCollisionDetectorInterface_getClosestPoints2(_native, input._native, output._native, DebugDraw.GetUnmanaged(debugDraw), swapResults);
		}
		public void GetClosestPointsNonVirtual(ClosestPointInput input, Result output, IDebugDraw debugDraw)
		{
			btGjkPairDetector_getClosestPointsNonVirtual(_native, input._native, output._native, DebugDraw.GetUnmanaged(debugDraw));
		}
 public void GetClosestPoints(ClosestPointInput input, Result output, IDebugDraw debugDraw, bool swapResults)
 {
     btDiscreteCollisionDetectorInterface_getClosestPoints2(_native, input._native, output._native, DebugDraw.GetUnmanaged(debugDraw), swapResults);
 }
Ejemplo n.º 6
0
 public void GetClosestPointsNonVirtual(ClosestPointInput input, Result output,
                                        DebugDraw debugDraw)
 {
     btGjkPairDetector_getClosestPointsNonVirtual(Native, input.Native,
                                                  output.Native, debugDraw != null ? debugDraw._native : IntPtr.Zero);
 }
Ejemplo n.º 7
0
 public abstract void GetClosestPoints(ClosestPointInput input, Result output, IDebugDraw debugDraw);
		public abstract void GetClosestPoints(ClosestPointInput input, Result output, IDebugDraw debugDraw);
Ejemplo n.º 9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ClosestPointInput obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
		//
		// give either closest points (distance > 0) or penetration (distance)
		// the normal always points from B towards A
		//
		internal abstract void getClosestPoints( ClosestPointInput input, Result output, btIDebugDraw debugDraw
						, bool swapResults = false );