@Override public org.jbox2d.dynamics.joints.JointDef toJBox2d () { org.jbox2d.dynamics.joints.PrismaticJointDef jd = new org.jbox2d.dynamics.joints.PrismaticJointDef(); 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.localAxisA.set(localAxisA.x, localAxisA.y); jd.lowerTranslation = lowerTranslation; jd.maxMotorForce = maxMotorForce; jd.motorSpeed = motorSpeed; jd.referenceAngle = referenceAngle; jd.type = org.jbox2d.dynamics.joints.JointType.PRISMATIC; jd.upperTranslation = upperTranslation; return jd; } }
body.createFixture(shape, 5.0f); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 0.0f), axis);
//prismatic joint final Sprite springFrameT = new Sprite(pX, pY, mSpringFrameTRegion, getVertexBufferObjectManager()); final Sprite springBarT = new Sprite(pX, pY + mSpringFrameTRegion.getHeight()-mSpringBarTRegion.getHeight(), mSpringBarTRegion, getVertexBufferObjectManager()); mMainScene.attachChild(springFrameT); mMainScene.attachChild(springBarT); mMapSprites.add(springFrameT); mMapSprites.add(springBarT); final Body springFrameBody = PhysicsFactory.createBoxBody(mPhysicsWorld, springFrameT, BodyType.StaticBody, FIXTURE_DEF); final Body springBarBody = PhysicsFactory.createBoxBody(mPhysicsWorld, springBarT, BodyType.DynamicBody, SPRING_FIXTURE_DEF); mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(springFrameT, springFrameBody, false, false)); mPhysicsWorld.registerPhysicsConnector(new PhysicsConnector(springBarT, springBarBody, true, true)); final PrismaticJointDef prismaticJointDef = new PrismaticJointDef(); prismaticJointDef.initialize(springFrameBody, springBarBody, springFrameBody.getWorldCenter(), // new Vector2(springFrameT.getWidth(), springFrameT.getHeight()/2), new Vector2(0, 1.0f)); prismaticJointDef.lowerTranslation = -0.5f; prismaticJointDef.upperTranslation = 0.5f; prismaticJointDef.enableLimit = true; prismaticJointDef.enableMotor = true; prismaticJointDef.maxMotorForce = 100.0f; prismaticJointDef.motorSpeed = 100000f; prismaticJointDef.collideConnected = false; this.mPhysicsWorld.createJoint(prismaticJointDef);
getWorld().createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, m_platform, new Vec2(0.0f, 5.0f), new Vec2(1.0f, 0.0f));
PrismaticJointDef def = new PrismaticJointDef(); jd = def; def.enableLimit = joint.getEnableLimit();
getWorld().createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 17.0f), new Vec2(0.0f, 1.0f));
body.createFixture(p, 1.0f); PrismaticJointDef jd = new PrismaticJointDef(); jd.bodyA = body2; jd.bodyB = body;
world.createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 17.0f), new Vec2(0.0f, 1.0f));
body.createFixture(p, 1.0f); PrismaticJointDef jd = new PrismaticJointDef(); jd.bodyA = body2; jd.bodyB = body;
body3.createFixture(box, 5.0f); PrismaticJointDef jd3 = new PrismaticJointDef(); jd3.initialize(ground, body3, bd3.position, new Vec2(0.0f, 1.0f)); jd3.lowerTranslation = -5.0f; jd3.upperTranslation = 5.0f;
getWorld().createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 17.0f), new Vec2(0.0f, 1.0f));
body.createFixture(shape, 5.0f); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 0.0f), axis);
getWorld().createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, m_platform, new Vec2(0.0f, 5.0f), new Vec2(1.0f, 0.0f));
getWorld().createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 17.0f), new Vec2(0.0f, 1.0f));
world.createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 17.0f), new Vec2(0.0f, 1.0f));
body3.createFixture(box, 5.0f); PrismaticJointDef jd3 = new PrismaticJointDef(); jd3.initialize(ground, body3, bd3.position, new Vec2(0.0f, 1.0f)); jd3.lowerTranslation = -5.0f; jd3.upperTranslation = 5.0f;
getWorld().createJoint(rjd); PrismaticJointDef pjd = new PrismaticJointDef(); pjd.initialize(ground, body, new Vec2(0.0f, 17.0f), new Vec2(0.0f, 1.0f));