FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

World's aabb Problem

 
Post new topic   Reply to topic     Forum Index -> Blaze
View previous topic :: View next topic  
Author Message
mike



Joined: 28 Dec 2008
Posts: 34

PostPosted: Sat Mar 28, 2009 10:56 pm    Post subject: World's aabb Problem Reply with quote

I noticed that there is a size limit for the worlds aabb. The box doesnt seem to be bigger than bVec2(1000, 1000) for upperbound.

Is it not suppose to be bigger?

If it is, is there a way I could make it bigger or possibly do without the world's aabb?
Back to top
View user's profile Send private message
zzzzrrr



Joined: 17 Feb 2007
Posts: 139
Location: Washington, DC

PostPosted: Mon Mar 30, 2009 4:32 am    Post subject: Re: World's aabb Problem Reply with quote

mike wrote:
I noticed that there is a size limit for the worlds aabb. The box doesnt seem to be bigger than bVec2(1000, 1000) for upperbound.

Is it not suppose to be bigger?


No. There are limits to box2D's broad phase collision detection algorithm.

mike wrote:

If it is, is there a way I could make it bigger or possibly do without the world's aabb?


You could always try using multiple worlds if you need a space that big. Practically though, most of your shapes should all be < 10m. When you get to an upper bound of 1000 and a lower bound of -1000 you're talking about huge scales.... not something you probably really need in a 2D game. For example, the Sears Tower is 442 m.

If you're making a space based type of game or global strategy game or something, just scale everything down appropriately.

Again, you might want to check the box2D wiki:

Quote:

Box2D works with floating point numbers, so some tolerances have to be used to make Box2D perform well. These tolerance have been tuned to work well with meters-kilogram-second (MKS) units. In particular, Box2D has been tuned to work well with moving objects between 0.1 and 10 meters. So this means objects between soup cans and buses in size should work well.

Being a 2D physics engine it is tempting to use pixels as your units. Unfortunately this will lead to a poor simulation and possibly weird behavior. An object of length 200 pixels would be seen by Box2D as the size of a 45 story building. Imagine trying to simulate the movement of a high-rise building with an engine that is tuned to simulate ragdolls and barrels. It isn't pretty.

*** Caution ***

Box2D is tuned for MKS units. Keep the size of moving objects roughly between 0.1 and 10 meters. You'll need to use some scaling system when you render your environment and actors. The Box2D examples do this by using an OpenGL viewport transform.
Back to top
View user's profile Send private message
mike



Joined: 28 Dec 2008
Posts: 34

PostPosted: Mon Mar 30, 2009 12:03 pm    Post subject: Reply with quote

Yeah I did look at box2d wiki but I didn't think anything of the size of the objects. The size change would probably work out for me.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Blaze All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group