setMotion
Sets how particle moves. A Motion.BULLET is not held to PhysicsConfig.maxStep a substep: it goes as fast as it is thrown, and every substep it is swept from where it was to where it went and stopped where it first meets a solid, so it cannot pass through a thin one.
Samples
val world = PhysicsWorld()
val bullet = world.particles.add(x = 0f, y = 0f, radius = 1f)
world.particles.setMotion(bullet, Motion.BULLET)
world.setVelocity(bullet, 5_000f, 0f)
assertPrints(world.particles.motionOf(bullet), "BULLET")Content copied to clipboard