Package org.jbox2d.dynamics.joints

Examples of org.jbox2d.dynamics.joints.RevoluteJointDef.initialize()


      PolygonShape box = new PolygonShape();
      box.setAsBox(10.0f, 0.25f);
      body.createFixture(box, 1.0f);

      RevoluteJointDef jd = new RevoluteJointDef();
      jd.initialize(ground, body, body.getPosition());
      jd.lowerAngle = -8.0f * MathUtils.PI / 180.0f;
      jd.upperAngle = 8.0f * MathUtils.PI / 180.0f;
      jd.enableLimit = true;
      m_world.createJoint(jd);

View Full Code Here


        bd.position.set(161.0f + 2.0f * i, -0.125f);
        Body body = m_world.createBody(bd);
        body.createFixture(fd);

        Vec2 anchor = new Vec2(160.0f + 2.0f * i, -0.125f);
        jd.initialize(prevBody, body, anchor);
        m_world.createJoint(jd);

        prevBody = body;
      }

View Full Code Here

        prevBody = body;
      }

      Vec2 anchor = new Vec2(160.0f + 2.0f * N, -0.125f);
      jd.initialize(prevBody, ground, anchor);
      m_world.createJoint(jd);
    }

    // Boxes
    {
View Full Code Here

      m_wheel2.createFixture(fd);

      WheelJointDef jd = new WheelJointDef();
      Vec2 axis = new Vec2(0.0f, 1.0f);

      jd.initialize(m_car, m_wheel1, m_wheel1.getPosition(), axis);
      jd.motorSpeed = 0.0f;
      jd.maxMotorTorque = 20.0f;
      jd.enableMotor = true;
      jd.frequencyHz = m_hz;
      jd.dampingRatio = m_zeta;
View Full Code Here

      jd.enableMotor = true;
      jd.frequencyHz = m_hz;
      jd.dampingRatio = m_zeta;
      m_spring1 = (WheelJoint) m_world.createJoint(jd);

      jd.initialize(m_car, m_wheel2, m_wheel2.getPosition(), axis);
      jd.motorSpeed = 0.0f;
      jd.maxMotorTorque = 10.0f;
      jd.enableMotor = false;
      jd.frequencyHz = m_hz;
      jd.dampingRatio = m_zeta;
View Full Code Here

      float w = 100.0f;
      body.setAngularVelocity(w);
      body.setLinearVelocity(new Vec2(-8.0f * w, 0.0f));

      rjd.initialize(ground, body, new Vec2(-10.0f, 12.0f));
      rjd.motorSpeed = -1.0f * MathUtils.PI;
      rjd.maxMotorTorque = 10000.0f;
      rjd.enableMotor = false;
      rjd.lowerAngle = -0.25f * MathUtils.PI;
      rjd.upperAngle = 0.5f * MathUtils.PI;
 
View Full Code Here

      polygon_bd.bullet = true;
      Body polygon_body = m_world.createBody(polygon_bd);
      polygon_body.createFixture(polygon_shape, 2.0f);

      RevoluteJointDef rjd = new RevoluteJointDef();
      rjd.initialize(ground, polygon_body, new Vec2(20.0f, 10.0f));
      rjd.lowerAngle = -0.25f * MathUtils.PI;
      rjd.upperAngle = 0.0f * MathUtils.PI;
      rjd.enableLimit = true;
      m_world.createJoint(rjd);
    }
View Full Code Here

    }

    body.setBullet(false);

    RevoluteJointDef rjd = new RevoluteJointDef();
    rjd.initialize(body, getGroundBody(), body.getPosition());
    rjd.motorSpeed = MathUtils.PI;
    rjd.maxMotorTorque = 1000000.0f;
    rjd.enableMotor = true;
    joint = (RevoluteJoint) getWorld().createJoint(rjd);
View Full Code Here

    }

    RevoluteJointDef jointDef = new RevoluteJointDef();

    if (switchBodiesInJoint)
      jointDef.initialize(pendulum, ground, new Vec2(0, 0));
    else
      jointDef.initialize(ground, pendulum, new Vec2(0, 0));

    pendulum.applyAngularImpulse(10000);
View Full Code Here

    RevoluteJointDef jointDef = new RevoluteJointDef();

    if (switchBodiesInJoint)
      jointDef.initialize(pendulum, ground, new Vec2(0, 0));
    else
      jointDef.initialize(ground, pendulum, new Vec2(0, 0));

    pendulum.applyAngularImpulse(10000);

    getWorld().createJoint(jointDef);
  }
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.