Package com.bulletphysics.collision.narrowphase

Examples of com.bulletphysics.collision.narrowphase.SubsimplexConvexCast


      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?

      if (convexCaster.calcTimeOfImpact(ccdSphereFromTrans, ccdSphereToTrans, ident, ident, castResult)) {
        if (hitFraction > castResult.fraction) {
          hitFraction = castResult.fraction;
        }
      }
    }
View Full Code Here


      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
      //btGjkConvexCast  convexCaster(castShape,convexShape,&simplexSolver);
      //btContinuousConvexCollision convexCaster(castShape,convexShape,&simplexSolver,0);
      //#endif //#USE_SUBSIMPLEX_CONVEX_CAST

      if (convexCaster.calcTimeOfImpact(rayFromTrans, rayToTrans, colObjWorldTransform, colObjWorldTransform, castResult)) {
        //add hit
        if (castResult.normal.lengthSquared() > 0.0001f) {
          if (castResult.fraction < resultCallback.closestHitFraction) {
            //#ifdef USE_SUBSIMPLEX_CONVEX_CAST
            //rotate normal into worldspace
View Full Code Here

TOP

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

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.