-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch module #238
Comments
Thanks for the report! I didnt realize that sensors also produced arbiters, but with 0 contacts. I have committed a fix that will be included in next Pymunk that handles this. But I keep this open while I consider your other ideas. That Im more hesitant about adding/removing bodies. (The api is sort of already there I guess, since you can send in as many bodies as you want to space.add(....), but that will just translate to a python for loop so no performance gains). There's a little book-keeping on the python side for each body/shape/constraint added, so the gain would only be reduced python/c overhead. I will think about it :) |
In this case it seems that batched adding/removing bodies might not be worth the effort :)
I think this makes a lot of sense, it's what I had in mind. It should also expose information such as body id or body type to allow for filtering (e.g., one may want to not update sensors or kinematic body position). Thinking about it, having the possibility to update all the body properties (position, orientation...) at once with the appropriate buffer could also make sense. |
Just a FYI: I just released Pymunk 6.7, which includes an addition to batch API that will let you set many properties on the bodies with a similar batch API as getting them. As for the batched position function, Im a bit more hesitant currently, since I want to experiment with some optimizations within Chipmunk, and dont want to limit whats possible with a batched position function before I know if/how such optimizations would work. |
Following-up on #235
The new batch module is amazing and looks very promising. Only with this I can get at least a 50% running time improvement.
There is an error when using the arbiter distance with a space containing a sensor. For instance:
raises
(Does it mean it would be possible to get arbiter information for sensors through this interface? That would also bring significant speed improvements instead of relying on
pre_solve
andseparate
callbacks to monitor sensors.)If you are looking for more batching ideas, it could be nice to have:
position_func
: I enforce a toroïdal space in my application by using simple maths on the body coordinates inside aposition_func
. However, the overhead of this callback is significant (almost 50% of the current running time).The text was updated successfully, but these errors were encountered: