Package javara

Source Code of javara.Javara

package javara;

import javara.world.World;
import javara.world.WorldLoader;
import javara.world.physical.Hector;
import com.jme3.app.SimpleApplication;
import com.jme3.bullet.BulletAppState;
import com.jme3.math.ColorRGBA;
import com.jme3.renderer.RenderManager;
import com.jme3.shadow.PssmShadowRenderer;

public class Javara extends SimpleApplication {
  private BulletAppState bulletAppState;
  private World world;
  private Player player;
  PssmShadowRenderer pssmRenderer;

  public static void main(String[] args) {
    Javara app = new Javara();
    app.start();
  }

  @Override
  public void simpleInitApp() {
    bulletAppState = new BulletAppState();
    bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
    stateManager.attach(bulletAppState);

    // pssmRenderer = new PssmShadowRenderer(assetManager, 2048, 12);
    // pssmRenderer.setShadowIntensity(0.5f);
    // pssmRenderer.setFilterMode(PssmShadowRenderer.FilterMode.PCF4);
    // pssmRenderer.setDirection(new Vector3f(-1, -1, -1).normalizeLocal());
    // viewPort.addProcessor(pssmRenderer);
    // rootNode.setShadowMode(ShadowMode.Off);

    try {
      world = WorldLoader.load("Maps/phosphorus.xml", rootNode, bulletAppState.getPhysicsSpace(), assetManager);

    }
    catch (Exception ex) {
      ex.printStackTrace();
    }

    Hector hector = new Hector(world, ColorRGBA.DarkGray, new ColorRGBA(0.9f, 0.6f, 0, 1), new ColorRGBA(0.4f, 0, 0, 1));
    player = new Player(world, inputManager, cam, listener, hector);
    world.setAudioRenderer(audioRenderer);
    world.setPlayer(player);
    world.initialize();
  }

  @Override
  public void simpleUpdate(float tpf) {
    world.update(tpf);
    player.update(tpf);
  }

  @Override
  public void simpleRender(RenderManager rm) {
    // TODO: add render code
  }
}
TOP

Related Classes of javara.Javara

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.