From ca15eb1922f9a04443ee76bc94974da1067ad737 Mon Sep 17 00:00:00 2001 From: "tenoch@tenoch-laptop" Date: Sat, 5 Sep 2009 15:31:05 +0300 Subject: [PATCH] Changed default mass and rot. inertia values for new body to Box2D's ones. --- src/modules/physics/box2d/wrap_Physics.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/modules/physics/box2d/wrap_Physics.cpp b/src/modules/physics/box2d/wrap_Physics.cpp index be0d498b2..e8a2b36bd 100644 --- a/src/modules/physics/box2d/wrap_Physics.cpp +++ b/src/modules/physics/box2d/wrap_Physics.cpp @@ -61,8 +61,8 @@ namespace box2d World * world = luax_checktype(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); }