Package com.bulletphysics.dynamics

Examples of com.bulletphysics.dynamics.DiscreteDynamicsWorld$InplaceSolverIslandCallback


    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));
        CollisionShape groundShape = new StaticPlaneShape(new Vector3f(0, 1, 0), 0.25f /* m */);
        CollisionShape ballShape = new SphereShape(3.0f);
        MotionState groundMotionState = new DefaultMotionState(new Transform(new Matrix4f(
                new Quat4f(0, 0, 0, 1),
View Full Code Here


        /**
         * The object that will determine what to do after collision.
         */
        ConstraintSolver solver = new SequentialImpulseConstraintSolver();
        // Initialise the JBullet world.
        dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
        // Set the gravity to 10 metres per second squared (m/s^2). Gravity affects all bodies with a mass larger than
        // zero.
        dynamicsWorld.setGravity(new Vector3f(0, -10, 0));
        // Initialise 'groundShape' to a static plane shape on the origin facing upwards ([0, 1, 0] is the normal).
        // 0.25 metres is an added buffer between the ground and potential colliding bodies, used to prevent the bodies
View Full Code Here

    // TODO: needed for SimpleDynamicsWorld
    // sol.setSolverMode(sol.getSolverMode() &
    // ~SolverMode.SOLVER_CACHE_FRIENDLY.getMask());

    myWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache,
        solver, collisionConfiguration);
    // dynamicsWorld = new SimpleDynamicsWorld(dispatcher,
    // overlappingPairCache, solver, collisionConfiguration);

    myWorld.setGravity(new Vector3f(0f, 3, 0f));
View Full Code Here

   
    this.collisionConfiguration = new DefaultCollisionConfiguration();
    this.dispatcher = new CollisionDispatcher(collisionConfiguration);
    this.broadphase = new DbvtBroadphase();
    this.solver = new SequentialImpulseConstraintSolver();
    this.dynamicsWorld = new DiscreteDynamicsWorld(dispatcher,
        broadphase, solver, collisionConfiguration)
   
    collisionShapes = new ObjectArrayList<CollisionShape>();
       
    // Define clock.
View Full Code Here

  public void resetEnvironment() {
    this.collisionConfiguration = new DefaultCollisionConfiguration();
    this.dispatcher = new CollisionDispatcher(collisionConfiguration);
    this.broadphase = new DbvtBroadphase();
    this.solver = new SequentialImpulseConstraintSolver();
    this.dynamicsWorld = new DiscreteDynamicsWorld(dispatcher,
        broadphase, solver, collisionConfiguration)
   
    collisionShapes = new ObjectArrayList<CollisionShape>();
       
    // Define clock.
View Full Code Here

        DefaultCollisionConfiguration collisionConfiguration = new DefaultCollisionConfiguration();
        CollisionDispatcher dispatcher = new CollisionDispatcher(collisionConfiguration);
        AxisSweep3 overlappingPairCache = new AxisSweep3(worldAabbMin, worldAabbMax);
        SequentialImpulseConstraintSolver solver = new SequentialImpulseConstraintSolver();
        world = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache,
                solver, collisionConfiguration);
        world.setGravity(gravity);
        world.getDispatchInfo().allowedCcdPenetration = 0f;
    }
View Full Code Here

    //BroadphaseInterface overlappingPairCache = new SimpleBroadphase();
    BroadphaseInterface overlappingPairCache = new DbvtBroadphase();

    ConstraintSolver constraintSolver = new SequentialImpulseConstraintSolver();

    dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache, constraintSolver, collision_config);

    // Setup a big ground box
    {
      CollisionShape groundShape = new BoxShape(new Vector3f(200f, 10f, 200f));
      // TODO
View Full Code Here

    Vector3f worldMax = new Vector3f(1000f, 1000f, 1000f);
    //broadphase = new AxisSweep3(worldMin, worldMax);
    broadphase = new DbvtBroadphase();
    //broadphase = new SimpleBroadphase();
    solver = new SequentialImpulseConstraintSolver();
    dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration);
    //#ifdef USE_PARALLEL_DISPATCHER
    //m_dynamicsWorld->getDispatchInfo().m_enableSPU=true;
    //#endif //USE_PARALLEL_DISPATCHER

    // JAVA NOTE: added
View Full Code Here

    solver = sol;
   
    // TODO: needed for SimpleDynamicsWorld
    //sol.setSolverMode(sol.getSolverMode() & ~SolverMode.SOLVER_CACHE_FRIENDLY.getMask());
   
    dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache, solver, collisionConfiguration);
    //dynamicsWorld = new SimpleDynamicsWorld(dispatcher, overlappingPairCache, solver, collisionConfiguration);

    dynamicsWorld.setGravity(new Vector3f(0f, -10f, 0f));
   
    initGImpactCollision();
View Full Code Here

    Vector3f worldMax = new Vector3f(1000, 1000, 1000);
    //overlappingPairCache = new AxisSweep3(worldMin, worldMax);
    //overlappingPairCache = new SimpleBroadphase();
    overlappingPairCache = new DbvtBroadphase();
    constraintSolver = new SequentialImpulseConstraintSolver();
    dynamicsWorld = new DiscreteDynamicsWorld(dispatcher, overlappingPairCache, constraintSolver, collisionConfiguration);
    //#ifdef FORCE_ZAXIS_UP
    //dynamicsWorld.setGravity(new Vector3f(0, 0, -10));
    //#endif

    //m_dynamicsWorld->setGravity(btVector3(0,0,0));
View Full Code Here

TOP

Related Classes of com.bulletphysics.dynamics.DiscreteDynamicsWorld$InplaceSolverIslandCallback

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.