Beispiel #1
0
 public override void processAllTriangles(btTriangleCallback callback, btVector3 aabbMin, btVector3 aabbMax)
 {
     BulletPINVOKE.btScaledBvhTriangleMeshShape_processAllTriangles(swigCPtr, btTriangleCallback.getCPtr(callback), btVector3.getCPtr(aabbMin), btVector3.getCPtr(aabbMax));
     if (BulletPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #2
0
 public virtual void processAllTriangles(btTriangleCallback callback, btVector3 aabbMin, btVector3 aabbMax)
 {
     BulletPINVOKE.btConcaveShape_processAllTriangles(swigCPtr, btTriangleCallback.getCPtr(callback), btVector3.getCPtr(aabbMin), btVector3.getCPtr(aabbMax));
     if (BulletPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #3
0
 public override void processAllTriangles(btTriangleCallback arg0, btVector3 arg1, btVector3 arg2)
 {
     BulletPINVOKE.btEmptyShape_processAllTriangles(swigCPtr, btTriangleCallback.getCPtr(arg0), btVector3.getCPtr(arg1), btVector3.getCPtr(arg2));
     if (BulletPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #4
0
 public void performConvexcast(btTriangleCallback callback, btVector3 boxSource, btVector3 boxTarget, btVector3 boxMin, btVector3 boxMax)
 {
     BulletPINVOKE.btBvhTriangleMeshShape_performConvexcast(swigCPtr, btTriangleCallback.getCPtr(callback), btVector3.getCPtr(boxSource), btVector3.getCPtr(boxTarget), btVector3.getCPtr(boxMin), btVector3.getCPtr(boxMax));
     if (BulletPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #5
0
 public void performRaycast(btTriangleCallback callback, btVector3 raySource, btVector3 rayTarget)
 {
     BulletPINVOKE.btBvhTriangleMeshShape_performRaycast(swigCPtr, btTriangleCallback.getCPtr(callback), btVector3.getCPtr(raySource), btVector3.getCPtr(rayTarget));
     if (BulletPINVOKE.SWIGPendingException.Pending)
     {
         throw BulletPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Beispiel #6
0
		internal abstract void processAllTriangles( btTriangleCallback callback, ref btVector3 aabbMin, ref btVector3 aabbMax );
Beispiel #7
0
		internal virtual void performConvexcast( btTriangleCallback callback, ref btVector3 raySource, ref btVector3 rayTarget, ref btVector3 aabbMin, ref btVector3 aabbMax )
		{
		}
Beispiel #8
0
		internal override void processAllTriangles( btTriangleCallback callback, ref btVector3 aabbMin, ref btVector3 aabbMax )
		{

			btVector3 halfExtents = ( aabbMax - aabbMin ) * (double)( 0.5 );
			double radius = halfExtents.length();
			btVector3 center = ( aabbMax + aabbMin ) * (double)( 0.5 );

			//this is where the triangles are generated, given AABB and plane equation (normal/constant)

			btVector3 tangentDir0, tangentDir1;

			//tangentDir0/tangentDir1 can be precalculated
			btVector3.btPlaneSpace1( ref m_planeNormal, out tangentDir0, out tangentDir1 );

			//btVector3 supVertex0, supVertex1;

			btVector3 projectedCenter;// = center - ( m_planeNormal.dot( center ) - m_planeConstant ) * m_planeNormal;
			center.SubScale( ref m_planeNormal, ( m_planeNormal.dot( center ) - m_planeConstant ), out projectedCenter );

			btVector3[] triangle = new btVector3[3];
			triangle[0] = projectedCenter + tangentDir0 * radius + tangentDir1 * radius;
			triangle[1] = projectedCenter + tangentDir0 * radius - tangentDir1 * radius;
			triangle[2] = projectedCenter - tangentDir0 * radius - tangentDir1 * radius;

			callback.processTriangle( triangle, 0, 0 );

			triangle[0] = projectedCenter - tangentDir0 * radius - tangentDir1 * radius;
			triangle[1] = projectedCenter - tangentDir0 * radius + tangentDir1 * radius;
			triangle[2] = projectedCenter + tangentDir0 * radius + tangentDir1 * radius;

			callback.processTriangle( triangle, 0, 1 );

		}
Beispiel #9
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(btTriangleCallback obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Beispiel #10
0
 virtual void	processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const = 0;
	virtual void	processAllTriangles(btTriangleCallback* callback,ref btVector3 aabbMin,ref btVector3 aabbMax);