From 1d769e5d716c62f80d0bad368f03d258207a4f71 Mon Sep 17 00:00:00 2001 From: Sai Surisetti Date: Tue, 16 Sep 2025 23:48:20 +0100 Subject: [PATCH] Minor Modifications for Clarity. Added Labels for poistion x and y so its clearer for Box2D Hello World. --- liquidfun/Box2D/HelloWorld/HelloWorld.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/liquidfun/Box2D/HelloWorld/HelloWorld.cpp b/liquidfun/Box2D/HelloWorld/HelloWorld.cpp index 4c606bf2d..28a38010c 100644 --- a/liquidfun/Box2D/HelloWorld/HelloWorld.cpp +++ b/liquidfun/Box2D/HelloWorld/HelloWorld.cpp @@ -74,7 +74,7 @@ int main(int argc, char** argv) fixtureDef.density = 1.0f; // Override the default friction. - fixtureDef.friction = 0.3f; + fixtureDef.friction = 0.4f; // Add the shape to the body. body->CreateFixture(&fixtureDef); @@ -87,7 +87,7 @@ int main(int argc, char** argv) int32 positionIterations = 2; // This is our little game loop. - for (int32 i = 0; i < 60; ++i) + for (int32 i = 0; i < 60; i++) { // Instruct the world to perform a single step of simulation. // It is generally best to keep the time step and iterations fixed. @@ -97,11 +97,11 @@ int main(int argc, char** argv) b2Vec2 position = body->GetPosition(); float32 angle = body->GetAngle(); - printf("%4.2f %4.2f %4.2f\n", position.x, position.y, angle); + printf("Position.x: %4.2f Position.y: %4.2f Angle: %4.2f\n", position.x, position.y, angle); } // When the world destructor is called, all bodies and joints are freed. This can // create orphaned pointers, so be careful about your world management. return 0; -} +} \ No newline at end of file