Turning on the physics engine is no different than turning on the screen display. If you write code to display something on the screen, it will. If you write code to use the physics engine, it will. There is no on or off, it’s always there ready to use or not use.
@fly.ing.fox It’s not that the physics engine is running and waiting for you to use it. It’s not doing anything until you actually write code to use it. That would be like saying a car sitting in the garage is waiting for you to get in and drive it. It’s there, but it’s not doing anything until you start it and drive it.
@fly.ing.fox In Codea, you don’t create a physics world, you create physics objects. Once a physics object is created, that object then runs under the control of the physics engine. That means you can have physics objects and normal objects next to each other on the screen and they won’t interact with each other. Only objects created as physics objects will react under the control of the physics engine.
EDIT: A physics object, even after it no longer shows on the screen, is still under the control of the physics engine. If you create a physics object and let it fall under the control of the engine, even after it leaves the screen it will still be falling at the speed of gravity until you stop the program.
@fly.ing.fox - I believe you are incorrect. The physics engine has nothing to calculate unless physics objects exist, so it is inactive if there are none. It only operates on physics objects, and nothing else.
The bottom line is that there is no overhead from Box2D if you have no physics objects.
I don’t know which scenario happens exactly. If some small amount of physics engine code scans for physics bodies and processes them, or the physics bodies calls the physics engine code. So in the first scenario, a small part of the physics engine is always running, in the second none of it is running until an object is created.