movePin

fun movePin(pin: Pin, x: Float, y: Float)(source)

Moves the point pin holds its particle at to (x, y).

Samples

val world = PhysicsWorld()
val p = world.particles.add(x = 10f, y = 10f)
// Held where it is now; move the pin and it follows.
val pin = world.constraints.pin(p)
world.constraints.movePin(pin, 30f, 10f)
repeat(10) { world.step(1.seconds / 60) }
assertTrue(world.particles.xOf(p) in 29f..31f)
assertPrints(world.constraints.particleOf(pin) == p, "true")