private void joinReelToAxis() { RevoluteJointDef jointDef = new RevoluteJointDef(); jointDef.bodyA = axis; jointDef.bodyB = reel; world.createJoint(jointDef); }
@Override public org.jbox2d.dynamics.joints.JointDef toJBox2d () { org.jbox2d.dynamics.joints.RevoluteJointDef jd = new org.jbox2d.dynamics.joints.RevoluteJointDef(); jd.bodyA = bodyA.body; jd.bodyB = bodyB.body; jd.collideConnected = collideConnected; jd.enableLimit = enableLimit; jd.enableMotor = enableMotor; jd.localAnchorA.set(localAnchorA.x, localAnchorA.y); jd.localAnchorB.set(localAnchorB.x, localAnchorB.y); jd.lowerAngle = lowerAngle; jd.maxMotorTorque = maxMotorTorque; jd.motorSpeed = motorSpeed; jd.referenceAngle = referenceAngle; jd.type = org.jbox2d.dynamics.joints.JointType.REVOLUTE; jd.upperAngle = upperAngle; return jd; } }
RevoluteJointDef jointDef = new RevoluteJointDef(); Vector2 anchor = (new Vector2(-width,-height/2)).add(chassis.getWorldCenter()); jointDef.initialize(chassis, wheel, anchor); jointDef.collideConnected = true; world.createJoint(jointDef);
RevoluteJointDef jointDef = new RevoluteJointDef();
@Override public void initTest(boolean deserialized) { { BodyDef bd = new BodyDef(); bd.type = BodyType.DYNAMIC; bd.allowSleep = false; bd.position.set(0.0f, 10.0f); Body body = m_world.createBody(bd); PolygonShape shape = new PolygonShape(); shape.setAsBox(0.5f, 10.0f, new Vec2(10.0f, 0.0f), 0.0f); body.createFixture(shape, 5.0f); shape.setAsBox(0.5f, 10.0f, new Vec2(-10.0f, 0.0f), 0.0f); body.createFixture(shape, 5.0f); shape.setAsBox(10.0f, 0.5f, new Vec2(0.0f, 10.0f), 0.0f); body.createFixture(shape, 5.0f); shape.setAsBox(10.0f, 0.5f, new Vec2(0.0f, -10.0f), 0.0f); body.createFixture(shape, 5.0f); RevoluteJointDef jd = new RevoluteJointDef(); jd.bodyA = getGroundBody(); jd.bodyB = body; jd.localAnchorA.set(0.0f, 10.0f); jd.localAnchorB.set(0.0f, 0.0f); jd.referenceAngle = 0.0f; jd.motorSpeed = 0.05f * MathUtils.PI; jd.maxMotorTorque = 1e8f; jd.enableMotor = true; m_joint = (RevoluteJoint) m_world.createJoint(jd); } m_count = 0; }
body3.createFixture(circle2, 5.0f); RevoluteJointDef jd1 = new RevoluteJointDef(); jd1.initialize(body2, body1, bd1.position); Joint joint1 = m_world.createJoint(jd1); RevoluteJointDef jd2 = new RevoluteJointDef(); jd2.initialize(body2, body3, bd3.position); Joint joint2 = m_world.createJoint(jd2); body1.createFixture(circle1, 5.0f); RevoluteJointDef jd1 = new RevoluteJointDef(); jd1.bodyA = ground; jd1.bodyB = body1; body2.createFixture(circle2, 5.0f); RevoluteJointDef jd2 = new RevoluteJointDef(); jd2.initialize(ground, body2, bd2.position); m_joint2 = (RevoluteJoint) m_world.createJoint(jd2);
fd.friction = 0.2f; RevoluteJointDef jd = new RevoluteJointDef(); jd.collideConnected = false;
RevoluteJointDef def = new RevoluteJointDef(); jd = def; def.enableLimit = joint.getEnableLimit();
RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(body, ground, body.getPosition()); rjd.motorSpeed = MathUtils.PI; body.createFixture(shape, 2.0f); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 5.0f)); rjd.motorSpeed = 1.0f * MathUtils.PI; body.createFixture(shape, 2.0f); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 9.0f)); rjd.enableMotor = false; body.createFixture(piston); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 17.0f)); world.createJoint(rjd);
body.createFixture(shape, 2.0f); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 5.0f)); rjd.motorSpeed = 1.0f * MathUtils.PI; body.createFixture(shape, 2.0f); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 9.0f)); rjd.enableMotor = false; body.createFixture(shape, 2.0f); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 17.0f)); getWorld().createJoint(rjd);
RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(body, getGroundBody(), body.getPosition()); rjd.motorSpeed = MathUtils.PI; body.createFixture(shape, 2.0f); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 5.0f)); rjd.motorSpeed = 1.0f * MathUtils.PI; body.createFixture(shape, 2.0f); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 9.0f)); rjd.enableMotor = false; body.setBullet(false); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(prevBody, body, new Vec2(0.0f, 17.0f)); getWorld().createJoint(rjd);
RevoluteJointDef jointDef = new RevoluteJointDef();
body.createFixture(shape, 5.0f); RevoluteJointDef jd = new RevoluteJointDef(); jd.bodyA = getGroundBody(); jd.bodyB = body;
bd.type = BodyType.DYNAMIC; RevoluteJointDef rjd = new RevoluteJointDef(); 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;
fd.filter.maskBits = 0xFFFF & ~0x0002; RevoluteJointDef jd = new RevoluteJointDef(); jd.collideConnected = false;
RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(body, getGroundBody(), body.getPosition()); rjd.motorSpeed = MathUtils.PI;
m_platform.createFixture(fd); RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(m_attachment, m_platform, new Vec2(0.0f, 5.0f)); rjd.maxMotorTorque = 50.0f;
getWorld().createJoint(djd); RevoluteJointDef rjd = new RevoluteJointDef();
RevoluteJointDef jd = new RevoluteJointDef();
body.createFixture(box, 1.0f); RevoluteJointDef jd = new RevoluteJointDef(); jd.initialize(ground, body, body.getPosition()); jd.lowerAngle = -8.0f * MathUtils.PI / 180.0f; fd.friction = 0.6f; RevoluteJointDef jd = new RevoluteJointDef();