Apply some torque to it so it spins.
This commit is contained in:
parent
084a9c59a6
commit
ae93ac52b8
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue