setLayers
Puts body on layers and has it collide with what is on a layer of mask and holds a layer of body's in its own mask; see PhysicsLayers. The layers say nothing about the solids: see setSolidCollision. It wakes, as what it rested on may no longer hold it.
Samples
val world = PhysicsWorld()
val ghosts = CollisionLayers.of(3)
val ghost = world.rigidBody(Shape.circle(8f), x = 0f, y = 0f)
// On its own layer, and colliding with no other body. The level still holds it up.
world.rigidBodies.setLayers(ghost, layers = ghosts, mask = CollisionLayers.NONE)
assertPrints(world.rigidBodies.layersOf(ghost) == ghosts, "true")Content copied to clipboard