0

When I trace to _chipmunk_cffi.py, it is from pymunk._chipmunk_cffi_abi import ffi, lib, lib_path.

So I trace to _chipmunk_cffi_abi.py and it's only lib, lib_path = load_library(ffi, "chipmunk", debug_lib=_lib_debug) but I can't find ffi anymore. So what is that?

I want to see what is doing in space.step(), where can I find this?

Antti29
  • 2,953
  • 12
  • 34
  • 36
sasalicat
  • 11
  • 1

1 Answers1

0

Pymunk is not doing the actual simulation itself, but is using a separate c library called Chipmunk for that part. Chipmunk is written in C, and called from the Python code in Pymunk with the CFFI foreign function interface library. I dont think you can trace it directly from the Python side into C-code. Instead if you want to see what it is looking like you can check the c-source directly, for example the step function is here: https://github.com/viblo/pymunk/blob/0d79176cf2fd642bd2ce4005478cb8d6e37c1e9c/chipmunk_src/src/cpSpaceStep.c#L336

viblo
  • 4,159
  • 4
  • 20
  • 28