You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just wanted to show & tell that Ive implemented reproducible state & serialization of the contact graph of the Space to Pymunk (Python library using Chipmunk) in case others are interested in adding this.
Pymunk has long had serialization of the public things (space, body, shapes etc) fully made from the Python side, but not of the contact graph which meant that loading a saved space meant that any collisions did not behave consistently. So, what I did was adding a couple of functions to get and set a couple of properties (shape.hashid space.shapeidcounter, space.stamp) and the cached arbiters form the space. Im not 100% sure I have all of it, but at least in my (tiny) test case it seemed to work. I you have any suggestions on my implementation please let me know, Im sure it can be made better!
ps. I wrote it here since the forums are quite unstable and dead.. hope its ok! Now, even if closed it will be easier to find I think.
The text was updated successfully, but these errors were encountered:
I just wanted to show & tell that Ive implemented reproducible state & serialization of the contact graph of the Space to Pymunk (Python library using Chipmunk) in case others are interested in adding this.
The changes (the c bits) are available here: https://github.com/viblo/pymunk/blob/master/pymunk/cffi/extensions.c
Pymunk has long had serialization of the public things (space, body, shapes etc) fully made from the Python side, but not of the contact graph which meant that loading a saved space meant that any collisions did not behave consistently. So, what I did was adding a couple of functions to get and set a couple of properties (shape.hashid space.shapeidcounter, space.stamp) and the cached arbiters form the space. Im not 100% sure I have all of it, but at least in my (tiny) test case it seemed to work. I you have any suggestions on my implementation please let me know, Im sure it can be made better!
ps. I wrote it here since the forums are quite unstable and dead.. hope its ok! Now, even if closed it will be easier to find I think.
The text was updated successfully, but these errors were encountered: