isSolidAt

fun isSolidAt(x: Float, y: Float, margin: Float = 0.0f): Boolean(source)

Returns true if the point (x, y) is inside any solid by more than margin units; see Solid.contains.

Samples

// A level 40 tiles across and 20 down, each 16 units: a floor, and a slope up to a ledge.
val grid = SolidGrid(columns = 40, rows = 20, tileSize = 16f)
for (column in 0 until 40) grid.fill(column, 19)
grid.fill(10, 18, shape = SolidShape.RISING)
grid.fill(11, 18)
val world = PhysicsWorld()
world.solids = grid
assertPrints(grid.isSolidAt(8f, 310f), "true")
assertPrints(grid.atOrNull(11, 18)?.shape, "BOX")
assertPrints(grid.atOrNull(12, 18), "null")