Package com.bulletphysics.collision.broadphase

Examples of com.bulletphysics.collision.broadphase.BroadphaseInterface


    private static boolean createNewShape = false;
    private static boolean resetControlBall = false;
    private static Sphere sphere = new Sphere();

    private static void setUpPhysics() {
        BroadphaseInterface broadphase = new DbvtBroadphase();
        CollisionConfiguration collisionConfiguration = new DefaultCollisionConfiguration();
        CollisionDispatcher dispatcher = new CollisionDispatcher(collisionConfiguration);
        ConstraintSolver solver = new SequentialImpulseConstraintSolver();
        dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
        dynamicsWorld.setGravity(new Vector3f(0, -10 /* m/s2 */, 0));
View Full Code Here


    private static void setUpPhysics() {
        /**
         * The object that will roughly find out whether bodies are colliding.
         */
        BroadphaseInterface broadphase = new DbvtBroadphase();
        CollisionConfiguration collisionConfiguration = new DefaultCollisionConfiguration();
        /**
         * The object that will accurately find out whether, when, how, and where bodies are colliding.
         */
        CollisionDispatcher dispatcher = new CollisionDispatcher(collisionConfiguration);
View Full Code Here

    Vector3f worldAabbMin = new Vector3f(-10000,-10000,-10000);
    Vector3f worldAabbMax = new Vector3f(10000,10000,10000);
    //BroadphaseInterface overlappingPairCache = new AxisSweep3(worldAabbMin, worldAabbMax);
    //BroadphaseInterface overlappingPairCache = new SimpleBroadphase();
    BroadphaseInterface overlappingPairCache = new DbvtBroadphase();

    ConstraintSolver constraintSolver = new SequentialImpulseConstraintSolver();

    dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache, constraintSolver, collision_config);
View Full Code Here

    Vector3f worldAabbMin = new Vector3f(-10000, -10000, -10000);
    Vector3f worldAabbMax = new Vector3f(10000, 10000, 10000);
    //BroadphaseInterface overlappingPairCache = new AxisSweep3(worldAabbMin, worldAabbMax);
    //BroadphaseInterface overlappingPairCache = new SimpleBroadphase();
    BroadphaseInterface overlappingPairCache = new DbvtBroadphase();

    //#ifdef USE_ODE_QUICKSTEP
    //btConstraintSolver* constraintSolver = new OdeConstraintSolver();
    //#else
    ConstraintSolver constraintSolver = new SequentialImpulseConstraintSolver();
View Full Code Here

      CollisionObject colObj = collisionObjects.getQuick(i);
      RigidBody body = RigidBody.upcast(colObj);
      if (body != null) {
        if (body.isActive() && (!body.isStaticObject())) {
          colObj.getCollisionShape().getAabb(colObj.getWorldTransform(tmpTrans), minAabb, maxAabb);
          BroadphaseInterface bp = getBroadphase();
          bp.setAabb(body.getBroadphaseHandle(), minAabb, maxAabb, dispatcher1);
        }
      }
    }
  }
View Full Code Here

    Vector3f contactThreshold = Stack.alloc(Vector3f.class);
    contactThreshold.set(BulletGlobals.getContactBreakingThreshold(), BulletGlobals.getContactBreakingThreshold(), BulletGlobals.getContactBreakingThreshold());
    minAabb.sub(contactThreshold);
    maxAabb.add(contactThreshold);

    BroadphaseInterface bp = broadphasePairCache;

    // moving objects should be moderately sized, probably something wrong if not
    tmp.sub(maxAabb, minAabb); // TODO: optimize
    if (colObj.isStaticObject() || (tmp.lengthSquared() < 1e12f)) {
      bp.setAabb(colObj.getBroadphaseHandle(), minAabb, maxAabb, dispatcher1);
    }
    else {
      // something went wrong, investigate
      // this assert is unwanted in 3D modelers (danger of loosing work)
      colObj.setActivationState(CollisionObject.DISABLE_SIMULATION);
View Full Code Here

TOP

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

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.