Package net.phys2d.raw

Examples of net.phys2d.raw.StaticBody


    this.world = world;
   
    Body body;
    BasicJoint j;
   
    Body base= new StaticBody("Ground1",new Box(500.0f, 20.0f));
    base.setPosition(250.0f, 400);
    world.add(base);
   
    body = new StaticBody("Ground2",new Box(250.0f, 20.0f));
    body.setPosition(225.0f, 200);
    body.setFriction(3.0f);
    world.add(body);
   
    // pendulum
    body = new StaticBody("Pen1",new Box(20.0f, 20.0f));
    body.setPosition(70.0f, 100);
    world.add(body);
    ball = new Body("Ball",new Box(10.0f, 10.0f), 1000);
    ball.setPosition(70.0f, 170);
    world.add(ball);
   
    j = new BasicJoint(body,ball,new Vector2f(70,110));
    world.add(j);
   
    // dominos
    for (int i=0;i<8;i++) {
      body = new Body("Domino "+i, new Box(10.0f, 40.0f), 10-i);
      body.setPosition(120.0f+(i*30), 170);
      world.add(body);
    }
   
    // ramp
    body = new StaticBody("Ground2",new Box(200.0f, 10.0f));
    body.setPosition(345.0f, 270);
    body.setRotation(-0.6f);
    body.setFriction(0);
    world.add(body);
   
View Full Code Here


   */
  protected void init(World world) {
    this.world = world;
    float relax = 0.8f;
   
    Body body1 = new StaticBody("Ground1", new Box(500.0f, 20.0f));
    body1.setPosition(250.0f, 400);
    world.add(body1);
   
    Body body2 = new Body("First", new Box(40.0f, 10.0f), 500);
    body2.setFriction(0.2f);
    body2.setPosition(80.0f, 300);
View Full Code Here

  /**
   * @see net.phys2d.raw.test.AbstractDemo#init(net.phys2d.raw.World)
   */
  protected void init(World world) {
    Body land = new StaticBody("Line1", new Line(130,30));
    land.setPosition(-30,200);
    world.add(land);
    Body land2 = new StaticBody("Line2", new Line(50,50));
    land2.setPosition(100,230);
    world.add(land2);
    Body land3 = new StaticBody("Line3", new Line(100,20));
    land3.setPosition(150,280);
    world.add(land3);
    Body land4 = new StaticBody("Line4", new Line(100,80));
    land4.setPosition(250,300);
    world.add(land4);
    Body land5 = new StaticBody("Line5", new Line(100,0));
    land5.setPosition(350,380);
    world.add(land5);
    Body land6 = new StaticBody("Line6", new Line(10,-200));
    land6.setPosition(450,380);
    world.add(land6);
    Body land7 = new StaticBody("Line7", new Line(80,-10));
    land7.setPosition(460,180);
    world.add(land7);
   
    box = new Body("Faller", new Box(50,50), 1);
    box.setPosition(50,50);
    box.setRotation(-0.5f);
View Full Code Here

////    ground2.setBitmask(0l);

   
   
    Line line1 = new Line(300, 0);
    Body ground1 = new StaticBody("line", line1);
    ground1.setPosition(100, 400);
    world.add(ground1);
   
    Line line2 = new Line(-100, -100);
    Body ground2 = new StaticBody("line", line2);
    ground2.setPosition(140, 420);
    world.add(ground2);
   
    Line line3 = new Line(100, -100);
    Body ground3 = new StaticBody("line", line3);
    ground3.setPosition(360, 420);
    world.add(ground3);
   
   
   
//    Vector2f[] boxVerts = {new Vector2f(-10, -10), new Vector2f(10,-10), new Vector2f(10,10), new Vector2f(-10,10)};
View Full Code Here

        body1.setFriction(0);
        world.add(body1);
      }
    }

    Body body5 = new StaticBody("Ground1", new Box(20.0f, 500.0f));
    body5.setPosition(20.0f, 250);
    body5.setRestitution(1.0f);
    world.add(body5);
    Body body6 = new StaticBody("Ground2", new Box(20.0f, 500.0f));
    body6.setPosition(480.0f, 250);
    body6.setRestitution(1.0f);
    world.add(body6);
    Body body1 = new StaticBody("Ground3", new Box(500.0f, 20.0f));
    body1.setPosition(250.0f, 480);
    body1.setRestitution(1.0f);
    world.add(body1);
   
    Body body2 = new Body("Cue", new Circle(20.0f),1);
    //Body body2 = new Body("Cue", new Box(40.0f,40.0f),1);
    body2.setPosition(250,0);
View Full Code Here

      }
    }

    System.out.println(bodies[3].getExcludedList());
   
    Body body5 = new StaticBody("Ground1", new Box(20.0f, 500.0f));
    body5.setPosition(20.0f, 250);
    body5.setRestitution(1.0f);
    world.add(body5);
    Body body6 = new StaticBody("Ground2", new Box(20.0f, 500.0f));
    body6.setPosition(480.0f, 250);
    body6.setRestitution(1.0f);
    world.add(body6);
    Body body1 = new StaticBody("Ground3", new Box(500.0f, 20.0f));
    body1.setPosition(250.0f, 480);
    body1.setRestitution(1.0f);
    world.add(body1);
  }
View Full Code Here

    body.setPosition(this.position.getX(), this.position.getY());
    return init(entity, body);
  }
 
  public Body addAxisAlignedWall(Entity entity, float startX, float startY, float x, float y) {
    Body body = new StaticBody(new Box(x, y));
    body.setPosition(startX + x / 2.0f, startY + y / 2.0f);
    return init(entity, body);
  }
View Full Code Here

    body.setPosition(startX + x / 2.0f, startY + y / 2.0f);
    return init(entity, body);
  }
 
  public Body addAxisAlignedWall(Entity entity, float width, float height) {
    StaticBody body = new StaticBody(new Box(width, height));
    body.setPosition(this.position.getX(), this.position.getY());
    return init(entity, body);
  }
View Full Code Here

      throw new IllegalArgumentException("Can't create new body with specific ID.");
    paramb = new com.a.b.b(paramb);
    Object localObject;
    if (paramb.p())
    {
      localObject = new StaticBody(paramb.b(), a(paramb.o()));
      paramb.i(((Body)localObject).getMass());
    }
    else
    {
      localObject = new Body(paramb.b(), a(paramb.o()), (float)paramb.n());
View Full Code Here

TOP

Related Classes of net.phys2d.raw.StaticBody

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.