Documentation Index

rabbyt.chipmunkglue

Functions

chipmunk_body_anims

chipmunk_body_anims(body_addr)

Provides fast integration with the chipmunk physics library. Returns three anims for x, y, and rotation.

body_addr Should be the address of a cpBody structure. For example, if you are using the pymonk wrapper, you can do this:

anims = chipmunk_body_anims(ctypes.addressof(body.contents))
sprite.x, sprite.y, sprite.rot = anims

Note that the anims store an internal pointer to the cpBody structure, but not a python reference. This means that if you read the anims value after calling cpBodyDestroy on the body, you will get a segfault.