I am currently using chipmunk physics in my project. I wanted to know if there was a way to determine if a dynamic physics body is in the air and not walking or resting on a static physics body. Currently in my project I have a platform that is a physics static body. The dynamic body always moves on top of a static body. However there are cases when the dynamic body might fall of the static body. At that point i would like to know when the dynamic physics body is falling down and is not touching any static body. Since one body is dynamic while the other is static hence collision detection is not possible.I have a value of 120 set as gravity in my project.
Use Debug Draw. This will show a boundary around your physics body.
I am using that. How will that help m in code to determine if the body is free falling in the air ?
if you are using those callbacks which i listed lately in other post, then you could use
onContactSeperate =CC_CALLBACK_1(StateMachine::onContactSeperate,this);
and find out which two bodies have just separated, if they are (walls and player && surface and player) then player is either jumping or falling.