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