I'm trying to code the solar system, but pymunk doesn't code for adding gravitational forces between bodies, whilst chipmunk does. One method I can use is trying to manually add it in. I attempted to follow what it said here: http://www.pymunk.org/en/latest/advanced.html, and create a python method. However, it hasn't been working. I also tried to just copy cpDamnpedSpring and translate it to python personally, but that failed, the main problem being my lack of knowledge on C. Specifically, I'm confused what to replace in this:
First we need to check if its included in the cdef definition in pymunk_extension_build.py. If its not just add it.
cpBool cpBodyIsSleeping(const cpBody *body);
Then to make it easy to use we want to create a python method that looks nice:
def is_sleeping(body):
return cp.cpBodyIsSleeping(body._body)
What should I put inside the brackets, e.g., if I wanted cpDampedSpring?