Box2D simulation doesn’t work

I previously used Box2D and it always worked fine until recently I decided to test how it would work in my custom 2D game engine, I just wanted to test the physics updates without any GUI interaction, as you can see in the below code I just try to print the plain position values of the dynamic body and it just doesn’t move. All it does is print the initialisation position I set in the initialiser, afaik all I’m trying to do it print the values in a simple loop that runs more than 60 times per frame, the box2d code doesn’t interact with the rendering in anyway. IDK what’s wrong with box 2d to run fine in a simple loop. I’m really confused why the simulation isn’t happening. Let me know if you need more info about anything.


 #include <fireworks/fireworks.h>  #include <box2d/box2d.h>  using namespace fireworks;  class FreeFall : public Fireworks { private:     Window*         m_Window;     Layer*          defaultLayer;      b2Vec2          m_Gravity;     const double    m_PhysicsTimeStep = 1.0f / 60.0f;     unsigned int    m_VelocityIterations;     unsigned int    m_PositionIterations; public:     b2World* world;      b2BodyDef       groundBodyDef;     b2Body*         groundBody;     b2PolygonShape  groundShape;     b2FixtureDef    groundFixtureDef;      b2BodyDef       dynBoxBodyDef;     b2Body*         dynBoxBody;     b2PolygonShape  dynBoxShape;     b2FixtureDef    dynBoxFixtureDef;      Sprite*         ground;     Sprite*         dynBox; public:     FreeFall()         : m_Gravity(b2Vec2(0.0f, -29.81f)), m_VelocityIterations(6), m_PositionIterations(2)     {         world = new b2World(m_Gravity);         // Static ground body         groundBodyDef.position.Set(0.0f, -10.0f);         groundBody = world->CreateBody(&groundBodyDef);         groundShape.SetAsBox(20.0f, 4.0f);         groundFixtureDef.shape = &groundShape;         groundFixtureDef.density = 1.0f;         groundFixtureDef.friction = 0.3f;         groundBody->CreateFixture(&groundFixtureDef);          // Dynamic simulation box         dynBoxBodyDef.type = b2_dynamicBody;         dynBoxBodyDef.position.Set(-1.0f, 4.0f);         dynBoxBody = world->CreateBody(&dynBoxBodyDef);         dynBoxShape.SetAsBox(2.0f, 2.0f);         dynBoxFixtureDef.shape = &dynBoxShape;         groundFixtureDef.density = 1.5f;         dynBoxFixtureDef.friction = 0.25f;         dynBoxBody->CreateFixture(&dynBoxFixtureDef);     }      ~FreeFall()     {         delete defaultLayer;         delete world;     }      // Runs once per initialisation     void init() override     {         m_Window = createWindow("Freefall physics sim", 800, 600);         glClearColor(0.8, 0.8f, 0.2f, 1.0f);               }     // Runs once per second     void tick() override { }      // Runs 60 times per second     void update() override { }      // Runs as fast as possible     void render() override     {         //Physics Update         world->Step(m_PhysicsTimeStep, m_VelocityIterations, m_PositionIterations);         b2Vec2 dynPos = dynBoxBody->GetPosition();         std::cout << "dynnamic Box2d Box position X : " << dynPos.x << " and Y is : " << dynPos.y << std::endl;     } }; 


#include "physics-sims/Freefall.h"  int main() {     FreeFall game;     game.start();     return 0; } 

This is the output I get : dynnamic Box2d Box position X : -1 and Y is : 4 for as long as the loop runs, this is soo infuriating, IDK what’s breaking what.