I'm making a basic platformer engine in AS3, and I'm currently implementing gravity. The gravity currently lets the player sink a few pixels into the ground when it lands (depending on the player's speed), and I don't want that.
I want to be able to test collisions 1 frame ahead of time (sweep testing), and if a collision will happen in the next frame, I want the player to stop 0px into the ground, regardless of the player's speed.
I also want pixel-perfect collisions that take the shape of the terrain, so I've been using Corey O'Neil's Collision Detection Kit (CDK), which works very well for detecting collisions, but I can't work out how to make it predict them. I'm not sure if this is the best library to use.
I'm not sure about Box2D; I feel it's too much for what I want.
Any idea of how can I do pixel-perfect sweep tests in AS3?