Changed default mass and rot. inertia values for new body to Box2D's

ones.
This commit is contained in:
tenoch@tenoch-laptop
2009-09-05 15:31:05 +03:00
parent 41a7c11f9f
commit ca15eb1922
+18 -18
View File
@@ -61,8 +61,8 @@ namespace box2d
World * world = luax_checktype<World>(L, 1, "World", PHYSICS_WORLD_T);
float x = (float)luaL_optnumber(L, 2, 0.0);
float y = (float)luaL_optnumber(L, 3, 0.0);
float m = (float)luaL_optnumber(L, 4, 1.0);
float i = (float)luaL_optnumber(L, 5, 1.0);
float m = (float)luaL_optnumber(L, 4, 0.0);
float i = (float)luaL_optnumber(L, 5, 0.0);
Body * body = instance->newBody(world, x, y, m, i);
luax_newtype(L, "Body", PHYSICS_BODY_T, (void*)body);
return 1;
@@ -238,14 +238,14 @@ namespace box2d
// List of constants.
static const Constant constants[] = {
{ "shape_circle", Shape::SHAPE_CIRCLE },
{ "shape_polygon", Shape::SHAPE_POLYGON },
{ "joint_distance", Joint::JOINT_DISTANCE },
{ "joint_revolute", Joint::JOINT_REVOLUTE },
{ "joint_prismatic", Joint::JOINT_PRISMATIC },
{ "joint_mouse", Joint::JOINT_MOUSE },
{ "joint_pulley", Joint::JOINT_PULLEY },
{ "shape_circle", Shape::SHAPE_CIRCLE },
{ "shape_polygon", Shape::SHAPE_POLYGON },
{ "joint_distance", Joint::JOINT_DISTANCE },
{ "joint_revolute", Joint::JOINT_REVOLUTE },
{ "joint_prismatic", Joint::JOINT_PRISMATIC },
{ "joint_mouse", Joint::JOINT_MOUSE },
{ "joint_pulley", Joint::JOINT_PULLEY },
{ "joint_gear", Joint::JOINT_GEAR },
{ 0, 0 }
};
@@ -264,14 +264,14 @@ namespace box2d
}
}
WrappedModule w;
w.module = instance;
w.name = "physics";
w.flags = MODULE_T;
w.functions = functions;
w.types = types;
w.constants = constants;
WrappedModule w;
w.module = instance;
w.name = "physics";
w.flags = MODULE_T;
w.functions = functions;
w.types = types;
w.constants = constants;
return luax_register_module(L, w);
}