Package com.bulletphysics.collision.narrowphase

Examples of com.bulletphysics.collision.narrowphase.VoronoiSimplexSolver


    {
      ConvexShape convex0 = (ConvexShape) col0.getCollisionShape();

      SphereShape sphere1 = new SphereShape(col1.getCcdSweptSphereRadius()); // todo: allow non-zero sphere sizes, for better approximation
      ConvexCast.CastResult result = new ConvexCast.CastResult();
      VoronoiSimplexSolver voronoiSimplex = new VoronoiSimplexSolver();
      //SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
      ///Simplification, one object is simplified as a sphere
      GjkConvexCast ccd1 = new GjkConvexCast(convex0, sphere1, voronoiSimplex);
      //ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
      if (ccd1.calcTimeOfImpact(col0.getWorldTransform(tmpTrans1), col0.getInterpolationWorldTransform(tmpTrans2),
          col1.getWorldTransform(tmpTrans3), col1.getInterpolationWorldTransform(tmpTrans4), result)) {
        // store result.m_fraction in both bodies

        if (col0.getHitFraction() > result.fraction) {
          col0.setHitFraction(result.fraction);
        }

        if (col1.getHitFraction() > result.fraction) {
          col1.setHitFraction(result.fraction);
        }

        if (resultFraction > result.fraction) {
          resultFraction = result.fraction;
        }
      }
    }

    // Sphere (for convex0) against Convex1
    {
      ConvexShape convex1 = (ConvexShape) col1.getCollisionShape();

      SphereShape sphere0 = new SphereShape(col0.getCcdSweptSphereRadius()); // todo: allow non-zero sphere sizes, for better approximation
      ConvexCast.CastResult result = new ConvexCast.CastResult();
      VoronoiSimplexSolver voronoiSimplex = new VoronoiSimplexSolver();
      //SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
      ///Simplification, one object is simplified as a sphere
      GjkConvexCast ccd1 = new GjkConvexCast(sphere0, convex1, voronoiSimplex);
      //ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
      if (ccd1.calcTimeOfImpact(col0.getWorldTransform(tmpTrans1), col0.getInterpolationWorldTransform(tmpTrans2),
View Full Code Here


  protected CollisionAlgorithmCreateFunc triangleSphereCF;
  protected CollisionAlgorithmCreateFunc planeConvexCF;
  protected CollisionAlgorithmCreateFunc convexPlaneCF;
 
  public DefaultCollisionConfiguration() {
    simplexSolver = new VoronoiSimplexSolver();
 
    //#define USE_EPA 1
    //#ifdef USE_EPA
    pdSolver = new GjkEpaPenetrationDepthSolver();
    //#else
View Full Code Here

     
      CastResult castResult = new CastResult();
      castResult.fraction = hitFraction;
      SphereShape pointShape = new SphereShape(ccdSphereRadius);
      TriangleShape triShape = new TriangleShape(triangle[0], triangle[1], triangle[2]);
      VoronoiSimplexSolver simplexSolver = new VoronoiSimplexSolver();
      SubsimplexConvexCast convexCaster = new SubsimplexConvexCast(pointShape, triShape, simplexSolver);
      //GjkConvexCast  convexCaster(&pointShape,convexShape,&simplexSolver);
      //ContinuousConvexCollision convexCaster(&pointShape,convexShape,&simplexSolver,0);
      //local space?
View Full Code Here

    if (collisionShape.isConvex()) {
      CastResult castResult = new CastResult();
      castResult.fraction = resultCallback.closestHitFraction;

      ConvexShape convexShape = (ConvexShape) collisionShape;
      VoronoiSimplexSolver simplexSolver = new VoronoiSimplexSolver();

      //#define USE_SUBSIMPLEX_CONVEX_CAST 1
      //#ifdef USE_SUBSIMPLEX_CONVEX_CAST
      SubsimplexConvexCast convexCaster = new SubsimplexConvexCast(castShape, convexShape, simplexSolver);
      //#else
View Full Code Here

      CastResult castResult = new CastResult();
      castResult.allowedPenetration = allowedPenetration;
      castResult.fraction = 1f; // ??

      ConvexShape convexShape = (ConvexShape) collisionShape;
      VoronoiSimplexSolver simplexSolver = new VoronoiSimplexSolver();
      GjkEpaPenetrationDepthSolver gjkEpaPenetrationSolver = new GjkEpaPenetrationDepthSolver();

      // JAVA TODO: should be convexCaster1
      //ContinuousConvexCollision convexCaster1(castShape,convexShape,&simplexSolver,&gjkEpaPenetrationSolver);
      GjkConvexCast convexCaster2 = new GjkConvexCast(castShape, convexShape, simplexSolver);
View Full Code Here

TOP

Related Classes of com.bulletphysics.collision.narrowphase.VoronoiSimplexSolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.