Package org.jbox2d.dynamics

Examples of org.jbox2d.dynamics.Body.createFixture()


      ground.createFixture(shape, 0);



      shape.setAsBox(0.5f, 3.0f, new Vec2(-8.0f, 0.0f), 0.0f);
      ground.createFixture(shape, 0);

      shape.setAsBox(2.0f, 0.1f, new Vec2(-6.0f, -2.8f), 0.1f);
      ground.createFixture(shape, 0);

      CircleShape cd = new CircleShape();
View Full Code Here


      shape.setAsBox(0.5f, 3.0f, new Vec2(-8.0f, 0.0f), 0.0f);
      ground.createFixture(shape, 0);

      shape.setAsBox(2.0f, 0.1f, new Vec2(-6.0f, -2.8f), 0.1f);
      ground.createFixture(shape, 0);

      CircleShape cd = new CircleShape();
      cd.m_radius = 0.5f;
      cd.m_p.set(-0.5f, -4.0f);
      ground.createFixture(cd, 0);
View Full Code Here

      ground.createFixture(shape, 0);

      CircleShape cd = new CircleShape();
      cd.m_radius = 0.5f;
      cd.m_p.set(-0.5f, -4.0f);
      ground.createFixture(cd, 0);

    }

    liquid = new Body[nParticles];
    float massPerParticle = totalMass / nParticles;
View Full Code Here

              MathUtils.randomFloat(cy - boxHeight * .5f, cy + boxHeight * .5f));
      bd.fixedRotation = true;
      bd.type = BodyType.DYNAMIC;
      Body b = getWorld().createBody(bd);

      b.createFixture(fd).setUserData(LIQUID_INT);

      MassData md = new MassData();
      md.mass = massPerParticle;
      md.I = 1.0f;
      b.setMassData(md);
View Full Code Here

        BodyDef bd = new BodyDef();
        bd.position = new Vec2(cx, cy);
        bd.fixedRotation = true;
        bd.type = BodyType.DYNAMIC;
        Body b = getWorld().createBody(bd);
        b.createFixture(fd).setUserData(LIQUID_INT);
        MassData md = new MassData();
        md.mass = massPerParticle;
        md.I = 1.0f;
        b.setMassData(md);
        b.setSleepingAllowed(false);
View Full Code Here

      sd.density = 0.0f;
      sd.restitution = k_restitution;

      // Left vertical
      shape.set(new Vec2(-20.0f, -20.0f), new Vec2(-20.0f, 20.0f));
      ground.createFixture(sd);

      // Right vertical
      shape.set(new Vec2(20.0f, -20.0f), new Vec2(20.0f, 20.0f));
      ground.createFixture(sd);
View Full Code Here

      shape.set(new Vec2(-20.0f, -20.0f), new Vec2(-20.0f, 20.0f));
      ground.createFixture(sd);

      // Right vertical
      shape.set(new Vec2(20.0f, -20.0f), new Vec2(20.0f, 20.0f));
      ground.createFixture(sd);

      // Top horizontal
      shape.set(new Vec2(-20.0f, 20.0f), new Vec2(20.0f, 20.0f));
      ground.createFixture(sd);
View Full Code Here

      shape.set(new Vec2(20.0f, -20.0f), new Vec2(20.0f, 20.0f));
      ground.createFixture(sd);

      // Top horizontal
      shape.set(new Vec2(-20.0f, 20.0f), new Vec2(20.0f, 20.0f));
      ground.createFixture(sd);

      // Bottom horizontal
      shape.set(new Vec2(-20.0f, -20.0f), new Vec2(20.0f, -20.0f));
      ground.createFixture(sd);
    }
View Full Code Here

      shape.set(new Vec2(-20.0f, 20.0f), new Vec2(20.0f, 20.0f));
      ground.createFixture(sd);

      // Bottom horizontal
      shape.set(new Vec2(-20.0f, -20.0f), new Vec2(20.0f, -20.0f));
      ground.createFixture(sd);
    }

    {
      Transform xf1 = new Transform();
      xf1.q.set(0.3524f * MathUtils.PI);
 
View Full Code Here

        bd.type = BodyType.DYNAMIC;

        bd.position.set(0.0f, 5.0f + 1.54f * i);
        Body body = getWorld().createBody(bd);

        body.createFixture(fd);

        float gravity = 10.0f;
        float I = body.getInertia();
        float mass = body.getMass();

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.