Package com.bulletphysics.collision.broadphase

Examples of com.bulletphysics.collision.broadphase.CollisionAlgorithm


    GLOBAL.jBullet.myWorld.performDiscreteCollisionDetection();
    //performDiscreteCollisionDetection
    for (int i = 0; i < BodyPart.BODYPART_COUNT.ordinal(); ++i) {
      if (bodies[i] != null && rigidBody != null) {

        CollisionAlgorithm Algorithm = GLOBAL.jBullet.myWorld
            .getDispatcher().findAlgorithm(rigidBody, bodies[i]);//getDispatcher()->findAlgorithm( pBulletObj1, pBulletObj2 );
        ManifoldResult manifoldResult = new ManifoldResult(rigidBody,
            bodies[i]);
        Algorithm.processCollision(rigidBody, bodies[i],
            GLOBAL.jBullet.myWorld.getDispatchInfo(),
            manifoldResult);
        PersistentManifold pManifold = manifoldResult
            .getPersistentManifold();
        if (pManifold != null){
View Full Code Here


   * Call before process collision.
   */
  protected CollisionAlgorithm newAlgorithm(CollisionObject body0, CollisionObject body1) {
    checkManifold(body0, body1);

    CollisionAlgorithm convex_algorithm = dispatcher.findAlgorithm(body0, body1, getLastManifold());
    return convex_algorithm;
  }
View Full Code Here

    body0.internalSetTemporaryCollisionShape(shape0);
    body1.internalSetTemporaryCollisionShape(shape1);

    {
      CollisionAlgorithm algor = newAlgorithm(body0, body1);
      // post :  checkManifold is called

      resultOut.setShapeIdentifiers(part0, triface0, part1, triface1);

      algor.processCollision(body0, body1, dispatchInfo, resultOut);

      //algor.destroy();
      dispatcher.freeCollisionAlgorithm(algor);
    }
View Full Code Here

  public CollisionAlgorithm findAlgorithm(CollisionObject body0, CollisionObject body1, PersistentManifold sharedManifold) {
    CollisionAlgorithmConstructionInfo ci = tmpCI;
    ci.dispatcher1 = this;
    ci.manifold = sharedManifold;
    CollisionAlgorithmCreateFunc createFunc = doubleDispatch[body0.getCollisionShape().getShapeType().ordinal()][body1.getCollisionShape().getShapeType().ordinal()];
    CollisionAlgorithm algo = createFunc.createCollisionAlgorithm(ci, body0, body1);
    algo.internalSetCreateFunc(createFunc);

    return algo;
  }
View Full Code Here

      tm.setMargin(collisionMarginTriangle);

      CollisionShape tmpShape = ob.getCollisionShape();
      ob.internalSetTemporaryCollisionShape(tm);

      CollisionAlgorithm colAlgo = ci.dispatcher1.findAlgorithm(convexBody, triBody, manifoldPtr);
      // this should use the btDispatcher, so the actual registered algorithm is used
      //    btConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_convexBody,m_triBody);

      resultOut.setShapeIdentifiers(-1, -1, partId, triangleIndex);
      //cvxcvxalgo.setShapeIdentifiers(-1,-1,partId,triangleIndex);
      //cvxcvxalgo.processCollision(m_convexBody,m_triBody,*m_dispatchInfoPtr,m_resultOut);
      colAlgo.processCollision(convexBody, triBody, dispatchInfoPtr, resultOut);
      //colAlgo.destroy();
      ci.dispatcher1.freeCollisionAlgorithm(colAlgo);
      ob.internalSetTemporaryCollisionShape(tmpShape);
    }
  }
View Full Code Here

TOP

Related Classes of com.bulletphysics.collision.broadphase.CollisionAlgorithm

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.