Examples of BulletAppState


Examples of com.jme3.bullet.BulletAppState

    }

    @Override
    public void simpleInitApp() {

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

        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry g = new Geometry("b", b);
        BoxCollisionShape boxCollisionShape = new BoxCollisionShape(new Vector3f(1, 1, 1));
View Full Code Here

Examples of com.jme3.bullet.BulletAppState

    }

    @Override
    public void simpleInitApp() {

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

        // Load Island
        Node island = (Node) assetManager.loadModel("Scenes/island2_1.j3o");
        rootNode.attachChild(island);

        bulletAppState.getPhysicsSpace().addAll(island);

        island.getChild("SpawningPoints").setCullHint(Spatial.CullHint.Always);

        Node mainScene = new Node("Main Scene");
        rootNode.attachChild(mainScene);

        Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false);
        sky.setLocalScale(350);

        mainScene.attachChild(sky);

        water = new WaterFilter(rootNode, lightDir);

        FilterPostProcessor fpp = new FilterPostProcessor(assetManager);

        fpp.addFilter(water);
        BloomFilter bloom = new BloomFilter();

        bloom.setExposurePower(55);
        bloom.setBloomIntensity(1.0f);

        fpp.addFilter(bloom);
        LightScatteringFilter lsf = new LightScatteringFilter(lightDir.mult(-300));
        lsf.setLightDensity(1.0f);
        fpp.addFilter(lsf);

        DepthOfFieldFilter dof = new DepthOfFieldFilter();
        dof.setFocusDistance(0);
        dof.setFocusRange(100);
        fpp.addFilter(dof);

        fade = new FadeFilter();
        fpp.addFilter(fade);

        water.setWaveScale(0.003f);
        water.setMaxAmplitude(1f);
        water.setFoamExistence(new Vector3f(1f, 4, 0.5f));
        water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));

        water.setRefractionStrength(0.2f);

        water.setWaterHeight(initialWaterHeight);
        uw = cam.getLocation().y < waterHeight;

        waves = new AudioNode(assetManager, "Sounds/Environment/Ocean Waves.ogg", false);
        waves.setLooping(true);
        waves.setReverbEnabled(true);
        if (uw) {
            waves.setDryFilter(new LowPassFilter(0.5f, 0.1f));
        } else {
            waves.setDryFilter(aboveWaterAudioFilter);
        }

        getAudioRenderer().playSource(waves);
        getViewPort().addProcessor(fpp);

        flyCam.setMoveSpeed(100);

        cam.setLocation(new Vector3f(-186.47707f, 19.662216f, -72.307915f));
        cam.lookAt(new Vector3f(0f, 0f, 0f), Vector3f.UNIT_Y);

       // cc = new GameStartCinematic(this, fade);
        cc.attach();
        fade.setValue(0f);

        bulletAppState.getPhysicsSpace().enableDebug(assetManager);

    }
View Full Code Here

Examples of com.jme3.bullet.BulletAppState

        thisApp = this;

        fpp = new FilterPostProcessor(assetManager);

        // == Move a lot of these into the "initialise once" level === //
        bulletAppState = new BulletAppState();
        stateManager.attach(bulletAppState);

        // load needed managers now
        uiManager = new UIManager();
View Full Code Here

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

Examples of com.jme3.bullet.BulletAppState

  @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

Examples of com.jme3.bullet.BulletAppState

  @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

Examples of com.jme3.bullet.BulletAppState

   */
  @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

Examples of com.jme3.bullet.BulletAppState

    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

Examples of com.jme3.bullet.BulletAppState

  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

Examples of com.jme3.bullet.BulletAppState

  }

  @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
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.