I am starting out using Polycode, and I am trying to expand upon the "2DPhysics_Basic" example to learn more about the framework. Specifically, I want to determine when all entities added to the PhysicsScene2D are asleep. In the example program, this would be when all of the blocks have come to rest. The end goal of all this is to develop a genetic algorithm that evolves the tallest "tower" out of semi-randomly placed blocks, so I need to check the position of the highest block when the simulation has come to a rest.
Is there a flag set in the physics engine for when the entire scene has come to rest? Or would I need to loop through each block to check their sleep status? If so, what function would I use? In the documentation, I saw a function to wake up an entity but not one to check whether or not it was currently asleep.