Hello, I started to deal with box2d, my version is new, 2.2.1. I found nothing on the net, except for b2World world(gravity, doSleep) , etc. Here the world accepts the vector of gravity and the permission to "sleep objects". And I do not have these parameters. The studio writes that the second parameter in b2World world() is const b2World & . What is it? Do we pass on to him? Explain, please...

  • one
    This is a link to a constant object (instance) of type (class) b2World. Apparently b2World is a very cumbersome class; in order to somehow quickly pass it inside the method, you can use links or pointers. In this case, links are used. - igumnov pm
  • Not that I understood the link, but what was it done for? Create peace in the world ???? Why should something like the world pass into the world ??? - Alerr
  • Made for convenience only? - Alerr pm
  • one
    For example, to make a copy, get a second world. - igumnov
  • Well, thank you, I did not know that you can create several worlds - Alerr