Box2D Forums

It is currently Sat May 25, 2013 6:37 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Apr 18, 2008 6:59 pm 
Offline

Joined: Sat Mar 29, 2008 2:36 pm
Posts: 6
// You are creating a shape outside the world box.
b2Assert(inRange);

I'm hitting this assert trying to create a circle shape (in place of a previous, slightly larger circle) and dying. How can I test for and avoid this situation myself?


Top
 Profile  
 
PostPosted: Sat Apr 19, 2008 6:59 am 
Offline

Joined: Sun Sep 23, 2007 2:35 pm
Posts: 803
Store the b2AABB you created your b2World with, and test the shapes you want to create to make sure they are inside it.

Or better, create the AABB with a healthy margin of error, and have it surround every bit of space that you could possibly want to use. You don't gain much if anything by keeping the world AABB tight, the main thing is just that it shouldn't be too massive. I think Erin said anything up to a few km should be fine, and even if you go beyond that, the broadphase might just go a little slower.


Top
 Profile  
 
PostPosted: Sat Apr 19, 2008 12:11 pm 
Offline

Joined: Sat Mar 29, 2008 2:36 pm
Posts: 6
I tried to have the world AABB be about 2 to 3 times as big as the space I'm actually using. I have a floor on the bottom of the screen with two tall walls on the left and right edges of the screen. Everything should stay inside this "cup" but some stuff is apparently slipping through or falling over the top.

Anyway, I fixed it by destroying bodies that fall below a certain point (that point being a good 500 units below the bottom of the screen).

On a related note, I had been trying to use the boundary contact listener to destroy bodies that would cause me to hit this assert, but that wasn't working. Is that a proper use of the boundary contact listener?


Top
 Profile  
 
PostPosted: Sat Apr 19, 2008 12:29 pm 
Offline

Joined: Tue Feb 12, 2008 4:54 pm
Posts: 130
If you can reproduce it, a test-case showing this behaviour would likely help out.

Bill


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 3 guests


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