From dac757b688c907d6a56b7bee4fa94b6498b22320 Mon Sep 17 00:00:00 2001 From: Bill Meltsner Date: Sat, 4 Feb 2012 18:26:43 -0500 Subject: [PATCH] remove scaling for density. while technically density is (according to the Box2D docs) in kg/m^2, it seems like a number that can be safely left un-scaled, for simplicity's sake; the concept of a shape/fixture's density seems sufficiently divorced from the MKS system as to render this a non-issue. if this proves to be a problem in use, scaling can be re-added. --- src/modules/physics/box2d/Shape.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/physics/box2d/Shape.cpp b/src/modules/physics/box2d/Shape.cpp index 3ef868f81..9643d3390 100644 --- a/src/modules/physics/box2d/Shape.cpp +++ b/src/modules/physics/box2d/Shape.cpp @@ -134,14 +134,14 @@ namespace box2d int Shape::computeMass(lua_State * L) const { - float density = Physics::scaleDown((float)luaL_checknumber(L, 1)); + float density = (float)luaL_checknumber(L, 1); b2MassData data; shape->ComputeMass(&data, density); b2Vec2 center = Physics::scaleUp(data.center); lua_pushnumber(L, center.x); lua_pushnumber(L, center.y); lua_pushnumber(L, data.mass); - lua_pushnumber(L, data.I); + lua_pushnumber(L, Physics::scaleUp(Physics::scaleUp(data.I))); return 4; }