Package com.jme3.bullet

Examples of com.jme3.bullet.BulletAppState


    @Override
    public void simpleInitApp() {


        BulletAppState bulletAppState = new BulletAppState();
        bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
        stateManager.attach(bulletAppState);
//        bulletAppState.getPhysicsSpace().setAccuracy(1f/30f);
        bulletAppState.getPhysicsSpace().enableDebug(assetManager);

        // Load Island
        Node island = (Node) assetManager.loadModel("Models/Islands/ogre/island_01.j3o");
        rootNode.attachChild(island);

        // Load Island CollisionMesh
        Node islandCollision = (Node) assetManager.loadModel("Models/Islands/ogre/island_01_collision.j3o");
        Geometry geoCollision = (Geometry) islandCollision.getChild(0);
        CollisionShape colShape = new MeshCollisionShape(geoCollision.getMesh());
        colShape.setMargin(0.005f);
        RigidBodyControl rigControl = new RigidBodyControl(colShape, 0);
        island.addControl(rigControl);
        bulletAppState.getPhysicsSpace().add(rigControl);


        // Load trees
        Node trees = (Node) assetManager.loadModel("Models/Islands/ogre/trees_01.j3o");
        rootNode.attachChild(trees);
View Full Code Here


  @Override
  public void simpleInitApp() {

    /** Set up Physics Game */
    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);
    // bulletAppState.getPhysicsSpace().enableDebug(assetManager);

    /** Configure cam to look at scene */
    cam.setLocation(new Vector3f(0, 4f, 6f));
View Full Code Here

  @Override
  public void simpleInitApp() {

    // 1. Activate Physics
    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);

    // bulletAppState.getPhysicsSpace().enableDebug(assetManager);

    // We re-use the flyby camera for rotation, while positioning is handled by physics
View Full Code Here

   */
  @Override
  public void simpleInitApp() {

    // Physics
    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);

    rootNode.attachChild(SkyBoxFactory.createSimpleSkyBox(assetManager));

    CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);
View Full Code Here

    getContext().getKeyInput().destroy();
    getContext().getKeyInput().initialize();

    /** Set up Physics */

    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);
    // bulletAppState.getPhysicsSpace().enableDebug(assetManager);

    viewPort.setBackgroundColor(new ColorRGBA(0.7f, 0.8f, 1f, 1f));
    flyCam.setMoveSpeed(100);
View Full Code Here

  public void initialize(AppStateManager stateManager, Application app) {
    gameApp = (GameApplication) app;
    gameApp.addGameDestroyCallback(createDestroyCallback());
    gameApp.getInputManager().setCursorVisible(false);

    BulletAppState state = new BulletAppState();
    gameApp.getStateManager().attach(state);
    state.getPhysicsSpace().setGravity(Vector3f.ZERO);

    // The glorious one and only Object store
    GlobalObjectStore.setAccessLog(false);
    GlobalObjectStore.registerObject(gameApp.getAssetManager(), AssetManager.class);
View Full Code Here

  }

  @Override
  protected boolean internalAddToScene(IGameApplication simpleApp) {
    sceneNode.attachChild(sceneObject);
    BulletAppState bulletAppState = simpleApp.getStateManager().getState(BulletAppState.class);
    bulletAppState.getPhysicsSpace().add(rbc);
   
    return true;
  };
View Full Code Here

    return true;
  };

  @Override
  protected boolean internalRemoveFromScene(IGameApplication simpleApp) {
    BulletAppState bulletAppState = simpleApp.getStateManager().getState(BulletAppState.class);
    bulletAppState.getPhysicsSpace().remove(rbc);
   
    return sceneObject.removeFromParent();
  }
View Full Code Here

  @Override
  public void simpleInitApp() {

    // 1. Activate Physics
    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);
    bulletAppState.getPhysicsSpace().enableDebug(assetManager);
    numBluePills = 0;

    // 2. make game environment and levels
View Full Code Here

  }

  @Override
  public void simpleInitApp() {

    bulletAppState = new BulletAppState();
    stateManager.attach(bulletAppState);
    bulletAppState.getPhysicsSpace().enableDebug(assetManager);
    setupKeys();
    setupJoint();
  }
View Full Code Here

TOP

Related Classes of com.jme3.bullet.BulletAppState

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.