Apply some torque to it so it spins.

This commit is contained in:
Zed A. Shaw 2024-04-27 00:07:14 -04:00
parent 084a9c59a6
commit ae93ac52b8

View file

@ -137,9 +137,11 @@ int main() {
if(sf::Mouse::isButtonPressed(sf::Mouse::Left)) {
b2Vec2 force(-200, 1000);
box.body->ApplyForceToCenter(force, true);
box.body->ApplyTorque(100.0f, true);
} else if (sf::Mouse::isButtonPressed(sf::Mouse::Right)) {
b2Vec2 force(200, 1000);
box.body->ApplyForceToCenter(force, true);
box.body->ApplyTorque(-100.0f, true);
}
break;
}