Examples of calcTimeOfImpact()


Examples of com.bulletphysics.collision.narrowphase.ConvexCast.calcTimeOfImpact()

      GjkConvexCast convexCaster2 = new GjkConvexCast(castShape, convexShape, simplexSolver);
      //btSubsimplexConvexCast convexCaster3(castShape,convexShape,&simplexSolver);

      ConvexCast castPtr = convexCaster2;

      if (castPtr.calcTimeOfImpact(convexFromTrans, convexToTrans, colObjWorldTransform, colObjWorldTransform, castResult)) {
        // add hit
        if (castResult.normal.lengthSquared() > 0.0001f) {
          if (castResult.fraction < resultCallback.closestHitFraction) {
            castResult.normal.normalize();
            LocalConvexResult localConvexResult = new LocalConvexResult(collisionObject, null, castResult.normal, castResult.hitPoint, castResult.fraction);
View Full Code Here

Examples of com.bulletphysics.collision.narrowphase.GjkConvexCast.calcTimeOfImpact()

      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);
View Full Code Here

Examples of com.bulletphysics.collision.narrowphase.GjkConvexCast.calcTimeOfImpact()

      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),
          col1.getWorldTransform(tmpTrans3), col1.getInterpolationWorldTransform(tmpTrans4), result)) {
        //store result.m_fraction in both bodies

        if (col0.getHitFraction() > result.fraction) {
          col0.setHitFraction(result.fraction);
View Full Code Here

Examples of com.bulletphysics.collision.narrowphase.SubsimplexConvexCast.calcTimeOfImpact()

      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

Examples of com.bulletphysics.collision.narrowphase.SubsimplexConvexCast.calcTimeOfImpact()

      //#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
Copyright © 2018 www.massapi.com. 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.