Fix a lot of scaling issues

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-09-29 11:09:08 -04:00
parent d4703960a4
commit c5cd6d709b
7 changed files with 27 additions and 25 deletions
+6 -4
View File
@@ -176,22 +176,24 @@ namespace box2d
void Body::applyAngularImpulse(float impulse)
{
body->ApplyAngularImpulse(Physics::scaleDown(impulse));
// Angular impulse is in kg*m^2/s, meaning it needs to be scaled twice
body->ApplyAngularImpulse(Physics::scaleDown(Physics::scaleDown(impulse)));
}
void Body::applyTorque(float t)
{
body->ApplyTorque(t);
// Torque is in N*m, or kg*m^2/s^2, meaning it also needs to be scaled twice
body->ApplyTorque(Physics::scaleDown(Physics::scaleDown(t)));
}
void Body::applyForce(float fx, float fy, float rx, float ry)
{
body->ApplyForce(b2Vec2(fx, fy), Physics::scaleDown(b2Vec2(rx, ry)));
body->ApplyForce(Physics::scaleDown(b2Vec2(fx, fy)), Physics::scaleDown(b2Vec2(rx, ry)));
}
void Body::applyForce(float fx, float fy)
{
body->ApplyForce(b2Vec2(fx, fy), body->GetWorldCenter());
body->ApplyForce(Physics::scaleDown(b2Vec2(fx, fy)), body->GetWorldCenter());
}
void Body::setX(float x)