Package net.phys2d.raw.shapes

Examples of net.phys2d.raw.shapes.StaticBox


  }
 
  protected void makeWorld() {
    world = new GridLimitedOptionsWorld(20, 20, cellwidth, cellheight);
   
    Body wall = new Phys2DBody( new StaticBox(4*cellwidth, cellheight), 10, true );
    wall.setLocation(2*cellwidth, 10*cellheight+0.5*cellheight);
    wall.setType(Body.OBSTACLE);
    world.addFixedBody(wall);
   
    wall = new Phys2DBody( new StaticBox(4*cellwidth, cellheight), 10, true );
    wall.setLocation(7*cellwidth, 10*cellheight+0.5*cellheight);
    wall.setType(Body.OBSTACLE);
    world.addFixedBody(wall);
   
    wall = new Phys2DBody( new StaticBox(cellwidth, 2*cellheight), 10, true );
    wall.setLocation(9*cellwidth+0.5*cellwidth, cellheight);
    wall.setType(Body.OBSTACLE);
    world.addFixedBody(wall);
   
    wall = new Phys2DBody( new StaticBox(cellwidth, 12*cellheight), 10, true );
    wall.setLocation(9*cellwidth+0.5*cellwidth, 9*cellheight);
    wall.setType(Body.OBSTACLE);
    world.addFixedBody(wall);
   
    wall = new Phys2DBody( new StaticBox(cellwidth, 4*cellheight), 10, true );
    wall.setLocation(9*cellwidth+0.5*cellwidth, 18*cellheight);
    wall.setType(Body.OBSTACLE);
    world.addFixedBody(wall);
   
    wall = new Phys2DBody( new StaticBox(6*cellwidth, cellheight), 10, true );
    wall.setLocation(13*cellwidth, 8*cellheight+0.5*cellheight);
    wall.setType(Body.OBSTACLE);
    world.addFixedBody(wall);
   
    wall = new Phys2DBody( new StaticBox(3*cellwidth, cellheight), 10, true );
    wall.setLocation(18.5*cellwidth, 8*cellheight+0.5*cellheight);
    wall.setType(Body.OBSTACLE);
    world.addFixedBody(wall);
   
    rf = new GridRewardFunction();
View Full Code Here


  }
 
  protected void makeWorld() {
    world = new GridLimitedOptionsWorld(15, 18, cellwidth, cellheight);
   
    Body landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(4.5*cellwidth, 14.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(4.5*cellwidth, 8.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(10.5*cellwidth, 8.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    landmark = new Phys2DBody( new StaticBox(cellwidth, cellheight), 10, true );
    landmark.setLocation(10.5*cellwidth, 2.5*cellheight);
    landmark.setType(Body.UNDEFINED);
    world.addFixedBody(landmark);
   
    rf = new GridRewardFunction();
View Full Code Here

    return world;
  }
 
  @Override
  protected Phys2DBody getDefaultBody(int type) {
    return new Phys2DBody( new StaticBox(25f, 25f), 0, true );
  }
View Full Code Here

  protected void createWalls(Phys2DWorld world) {
    float width = (float)world.getWidth(),
        height = (float)world.getHeight(),
        wallwidth = 10;
   
    Phys2DBody wall = new Phys2DBody("Wall1", new StaticBox(width, wallwidth), 0, true);
    wall.setPosition((float)0.5*width, (float)0.5*wallwidth);
    world.addBody(wall);
   
    wall = new Phys2DBody("Wall2", new StaticBox(width, wallwidth), 0, true);
    wall.setPosition((float)0.5*width, height - (float)0.5*wallwidth);
    world.addBody(wall);
   
    wall = new Phys2DBody("Wall3", new StaticBox(wallwidth, height), 0, true);
    wall.setPosition((float)0.5*wallwidth, (float)0.5*height);
    world.addBody(wall);
   
    wall = new Phys2DBody("Wall4", new StaticBox(wallwidth, height), 0, true);
    wall.setPosition(width - (float)0.5*wallwidth, (float)0.5*height);
    world.addBody(wall);
  }
 
View Full Code Here

TOP

Related Classes of net.phys2d.raw.shapes.StaticBox

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.