setSolidCollision
Sets whether every particle of body is kept out of the solids, the SolidGrid and its moving solids. It is SolidCollision.COLLIDE by default; a SolidCollision.PASS body falls through the level.
Samples
val world = PhysicsWorld()
// A floor of 16-unit tiles along row 9, its top at y = 144.
val grid = SolidGrid(columns = 20, rows = 10, tileSize = 16f)
for (column in 0 until 20) grid.fill(column, 9)
world.solids = grid
val slime = world.softBody(SoftBodyShape.semiDisc(13f, 14, 8, coreMass = 34f), centerX = 160f, baseY = 100f)
world.softBodies.setSolidCollision(slime, SolidCollision.PASS)
assertPrints(world.softBodies.solidCollisionOf(slime), "PASS")
repeat(60) { world.step(1.seconds / 60) }
// All of it fell through the floor.
assertTrue(world.softBodies.minYOf(slime) > 160f)Content copied to clipboard