I have a question that perhaps is very simple. How do I detect that a body is falling?
Scenario: a character is falling from a platform and the body language needs to be adapted during the fall and restored as soon as the floor is hit.
Detect falling body
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: Detect falling body
The easiest thing to do is just to check if you body is touching the ground or not. cpBodyEachArbiter() is the easiest way to do that. The "Contact Graph" demo does something pretty close:
https://github.com/slembcke/Chipmunk2D/ ... aph.c#L104
https://github.com/slembcke/Chipmunk2D/ ... aph.c#L104
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Who is online
Users browsing this forum: No registered users and 9 guests