hinge
Holds a and b together at the world point (x, y), free to turn about it, and returns the joint's handle.
Throws
Samples
val world = PhysicsWorld()
val door = world.rigidBody(Shape.box(40f, 4f), x = 20f, y = 0f)
// Hinged to the world at its left end: it swings down about that point.
val hinge = world.joints.hinge(door, JointEnd.WORLD, x = 0f, y = 0f)
repeat(60) { world.step(1.seconds / 60) }
assertTrue(world.rigidBodies.angleOf(door) > 0.5f)
assertPrints(world.joints.kindOf(hinge), "HINGE")Content copied to clipboard