erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
7.44k stars 1.47k forks source link

b2World class does not have default constructor #759

Open nahiim opened 7 months ago

nahiim commented 7 months ago

There might be a very important reason for this (which I would like to know please, if there is)but sometimes I like to declare all my variable first(in the header file) before initialising them in the implementation file in an init() method of sort. I can't do that with b2World because it does not have a default constructor.

I can't do something like:

b2World world;
world.setGravity(b2Vec2 gravity(0.0f, -10.0f));