public LineJoint() { Body ground = null; { PolygonDef sd = new PolygonDef(); sd.SetAsBox(50.0f, 10.0f); BodyDef bd = new BodyDef(); bd.Position.Set(0.0f, -10.0f); ground = _world.CreateBody(bd); ground.CreateShape(sd); } { PolygonDef sd = new PolygonDef(); sd.SetAsBox(0.5f, 2.0f); sd.Density = 1.0f; BodyDef bd = new BodyDef(); bd.Position.Set(0.0f, 7.0f); Body body = _world.CreateBody(bd); body.CreateShape(sd); body.SetMassFromShapes(); LineJointDef jd = new LineJointDef(); Vec2 axis = new Vec2(2.0f, 1.0f); axis.Normalize(); jd.Initialize(ground, body, new Vec2(0.0f, 8.5f), axis); jd.motorSpeed = 0.0f; jd.maxMotorForce = 100.0f; jd.enableMotor = true; jd.lowerTranslation = -4.0f; jd.upperTranslation = 4.0f; jd.enableLimit = true; _world.CreateJoint(jd); } }