Package org.jbox2d.dynamics

Examples of org.jbox2d.dynamics.World


   */
  public VolcanoWorld(int width,int height){
    super(new Point(0,0),width,height);
    this.background=MEngine.getAssetManager().getSpriteSheet("volcano_background.png");
    this.clouds=MEngine.getAssetManager().getSpriteSheet("clouds.png");
    world=new World(new Vec2(0,-10f),true);
    volcano=new Volcano(this,new Point(250,425));
   
  }
View Full Code Here



    public void run() {


        World w = me.body.getWorld();
        Vec2 menog = w.getGravity().clone();

        menog.x=-menog.x*me.body.getMass();
        menog.y=-menog.y*me.body.getMass();

        me.body.applyForce(menog,me.body.getWorldCenter());
View Full Code Here

  }

  public synchronized boolean setLevel(Level l) {

    l.world = new World(l.g, true);

    Common.info(1, "Game.setLevel() Loading level... of dimension" + l.dim + " and force"
    + l.world.getGravity());
    l.Initialize();
    scale.x = ((float) (screenResolution.x)) / gameResolution.x;
View Full Code Here

    }
    log.debug("Serialed world to " + currTest.getFilename());
  }

  private void _load() {
    World w;
    try {
      FileInputStream fis = new FileInputStream(currTest.getFilename());
      w = currTest.getDeserializer().deserializeWorld(fis);
      fis.close();
    } catch (FileNotFoundException e) {
View Full Code Here

public class DefaultWorldCreator implements WorldCreator {

  @Override
  public World createWorld(Vec2 gravity) {
    return new World(gravity);
  }
View Full Code Here

  @Override
  public void runBenchmarkWorld() {
    BroadPhaseStrategy strategy = new DynamicTree();

    world = new World(new Vec2(0.0f, -10.0f), new DefaultWorldPool(100, 10), strategy);
    Body ground = null;
    {
      BodyDef bd = new BodyDef();
      ground = world.createBody(bd);
View Full Code Here

//    setWarmStarting(warmStarting);
//    setContinuousPhysics(continous);
//  }
 
  public void createWorld(Vec2 gravity, boolean warmStarting, boolean continous) {
    world = new World(gravity);
    setWarmStarting(warmStarting);
    setContinuousPhysics(continous);
   
      BodyDef bodyDef = new BodyDef();
      groundBody = world.createBody(bodyDef);
View Full Code Here

    BroadphasePerformanceTest benchmark = new BroadphasePerformanceTest(10, new PistonWorld());
    benchmark.go();
  }

  public void setupTest(int testNum) {
    World w;
    IWorldPool pool = new DefaultWorldPool(50, 50);
    if (testNum == 0) {
      w = new World(new Vec2(0.0f, -10.0f), pool);
    } else {
      w = new World(new Vec2(0, -10), pool, new DynamicTreeFlatNodes());
    }
    world.setupWorld(w);
  }
View Full Code Here

    benchmark.go();
  }
 
  @Override
  public void setupTest(int testNum) {
    World w = new World(new Vec2(0, -10));
    world.setupWorld(w);
  }
View Full Code Here

  }
  protected Body topBody = null;

  Bench2d() {
    Vec2 gravity = new Vec2(0, -10f);
    world = new World(gravity);

    {
      BodyDef bd = new BodyDef();
      Body ground = world.createBody(bd);
View Full Code Here

TOP

Related Classes of org.jbox2d.dynamics.World

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.