Created
February 8, 2025 20:30
-
-
Save 8Observer8/fc07fd01c3de0cd2e2bd2b45a96f98a7 to your computer and use it in GitHub Desktop.
Print gravity with Box2D 2.4.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <box2d/box2d.h> | |
#include <iostream> | |
int main() | |
{ | |
b2Vec2 gravity(0.f, -9.8f); | |
b2World* world = new b2World(gravity); | |
float gx = world->GetGravity().x; | |
float gy = world->GetGravity().y; | |
std::cout << "gravity = (" << gx << ", " << gy << ")" << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment