queryPoint
fun queryPoint(x: Float, y: Float, found: Overlaps, targets: QueryTargets = QueryTargets.EVERYTHING): Int(source)
Finds everything of targets that the point (x, y) is inside, writes it into found and returns how many. A point on a surface is outside it. Allocates nothing once found is big enough.
Samples
val world = PhysicsWorld()
val crate = world.rigidBody(Shape.box(20f, 20f), x = 0f, y = 0f)
val found = Overlaps()
assertPrints(world.queryPoint(5f, 5f, found), "1")
assertPrints(found.rigidBodyAt(0) == crate, "true")Content copied to clipboard