Box2D Forums

It is currently Sun Dec 21, 2014 1:50 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: 1024 limit of bodies
PostPosted: Thu Jul 16, 2009 4:37 am 
Offline

Joined: Mon Feb 25, 2008 6:33 am
Posts: 11
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.


Top
 Profile  
 
 Post subject: Re: 1024 limit of bodies
PostPosted: Thu Jul 16, 2009 7:41 am 
Offline

Joined: Mon Feb 18, 2008 12:30 am
Posts: 88
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:
Quote:
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.


Top
 Profile  
 
 Post subject: Re: 1024 limit of bodies
PostPosted: Thu Jul 16, 2009 2:40 pm 
Offline

Joined: Mon Feb 25, 2008 6:33 am
Posts: 11
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 :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group