1024 limit of bodies

Discuss issues specific the Python port of Box2D
Kingdom Of Fish
Posts: 11
Joined: Mon Feb 25, 2008 6:33 am

1024 limit of bodies

Postby Kingdom Of Fish » Thu Jul 16, 2009 4:37 am

Hi, I've been trying out pyBox2D and noticed some odd limits (that causes seg. faults). These are the two I found:
* Max 128 bodies created between steps
* Max 1024 bodies in a simulation.

Whats that about? Is it something in the C/C++ source or is it the python implementation only? Or is it something in my implementation that messes it up? I'm using SFML for the visualisation.

kne
Posts: 88
Joined: Mon Feb 18, 2008 12:30 am

Re: 1024 limit of bodies

Postby kne » Thu Jul 16, 2009 7:41 am

There is a hard limit on the number of pairs and proxies. This is from the C++ library, and not something pybox2d introduced.
If you want > 1024 proxies, you will have to modify b2_maxProxies in Box2D\Common\b2Settings.h and recompile (instructions here).

From this post:
proxies - represents an AABB in the broad-phase collision algorithm. Each b2Shape has a proxy.
pair - a record created when two proxies overlap.
manifold - the set of contact points for two convex shapes.


I haven't heard about adding 128 bodies per step, but perhaps your bodies had 8 shapes each (128*8=1024)? If you do modify the settings, be sure to use a power of two, by the way.

Kingdom Of Fish
Posts: 11
Joined: Mon Feb 25, 2008 6:33 am

Re: 1024 limit of bodies

Postby Kingdom Of Fish » Thu Jul 16, 2009 2:40 pm

kne wrote:There is a hard limit on the number of pairs and proxies. This is from the C++ library, and not something pybox2d introduced.
If you want > 1024 proxies, you will have to modify b2_maxProxies in Box2D\Common\b2Settings.h and recompile (instructions here).


Ah thanks, that explains that part anyway.

kne wrote:I haven't heard about adding 128 bodies per step, but perhaps your bodies had 8 shapes each (128*8=1024)? If you do modify the settings, be sure to use a power of two, by the way.

No, the bodies have 1 shape each, and if I add the same bodies but spread out over alot of steps it works perfectly, until i reach the 1024 limit that is :)


Return to “Python”



Who is online

Users browsing this forum: No registered users and 1 guest