Examples of BodyDef


Examples of org.jbox2d.dynamics.BodyDef

    if (deserialized) {
      return;
    }
    // Ground
    {
      BodyDef bd = new BodyDef();
      Body ground = getWorld().createBody(bd);

      EdgeShape shape = new EdgeShape();
      shape.set(new Vec2(-20.0f, 0.0f), new Vec2(20.0f, 0.0f));
      ground.createFixture(shape, 0.0f);
    }

    // Platform
    {
      BodyDef bd = new BodyDef();
      bd.position.set(0.0f, 10.0f);
      Body body = getWorld().createBody(bd);

      PolygonShape shape = new PolygonShape();
      shape.setAsBox(3.0f, 0.5f);
      m_platform = body.createFixture(shape, 0.0f);

      m_bottom = 10.0f - 0.5f;
      m_top = 10.0f + 0.5f;
    }

    // Actor
    {
      BodyDef bd = new BodyDef();
      bd.type = BodyType.DYNAMIC;
      bd.position.set(0.0f, 12.0f);
      Body body = getWorld().createBody(bd);

      m_radius = 0.5f;
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.