Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I intended to use jbox2d for my project. But as I went deeper into it's manual I'd found out that it supports dynamic objects between 0.1 and 10 meters (if use scaling and assume that 0.1 is smallest unit we would have 100 units). I want to create pretty complex and big shapes about 1000 units width.

  • So will box2d will handle it?
  • Or I should simplify them more to achieve 100 units width max?
  • Or my calculations about 100 units width max are wrong? ( But if 0.1 meter is box2d minimum I don't think than I can get smaller unit as measure.)

I had also read about kollider2d, but can't find any info about stress testing it.

As in comment below:

I understand that it doesn't matter if 32 pixels of my system represents 0.1 meter of box2d system nor if it is 50 pixels. With good scale I can manage any value as minimum. I wan't to create objects 1000 times larger than smallest one. And I don't know if box2d will crash or try to handle it but will be very slow or inaccurate.

share|improve this question
add comment

1 Answer

The fact that Box2D can only handle objects between .1 and 10 meters only places the restriction on you that your largest object can only be 100 times larger than your smallest object. Box.2Ds coordinate system can be completely separate from your own, its will just take some multiplication to go back and forth between pixels and meters.

So if "I want to create pretty complex and big shapes about 1000 units width." means you want dynamic objects 1000 pixels wide that is fine with the caveat that your smallest body has to be at least 10 pixels wide.

For example in my game 32 pixels = 1 meter. So the smallest object I could have is 4 pixels across and the largest is 320 pixels. In your case a 100 pixels per meter might be better so that the min size of a body is 10 pixels and the max size is 1000 pixels.

share|improve this answer
1  
I understand that it doesn't matter if 32 pixels of my system represents 0.1 meter of box2d nor if it is 50 pixels. I wan't to create objects 1000 times larger than smallest ones. And I don't know if box2d will crash or try to handle it but will be very slow or inaccurate. –  23kulpamens Feb 3 '12 at 18:37
2  
As far as I know, box2D allows you to have objects as big as you want and still perform well in speed. I think the inacuracies of the simulation will increase as much as you distance from the "safe zone". –  Grimshaw Feb 4 '12 at 0:10
    
@DevilWithin that is correct –  ClassicThunder Feb 4 '12 at 0:33
    
Do you know any alternative for jBox2D for case of big objects. I can use jbox2D for small objects and other library for big ones. –  23kulpamens Feb 8 '12 at 14:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.