|
@@ -61,8 +61,8 @@ namespace box2d
|
|
World * world = luax_checktype<World>(L, 1, "World", PHYSICS_WORLD_T);
|
|
World * world = luax_checktype<World>(L, 1, "World", PHYSICS_WORLD_T);
|
|
float x = (float)luaL_optnumber(L, 2, 0.0);
|
|
float x = (float)luaL_optnumber(L, 2, 0.0);
|
|
float y = (float)luaL_optnumber(L, 3, 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);
|
|
Body * body = instance->newBody(world, x, y, m, i);
|
|
luax_newtype(L, "Body", PHYSICS_BODY_T, (void*)body);
|
|
luax_newtype(L, "Body", PHYSICS_BODY_T, (void*)body);
|
|
return 1;
|
|
return 1;
|
|
@@ -238,14 +238,14 @@ namespace box2d
|
|
|
|
|
|
// List of constants.
|
|
// List of constants.
|
|
static const Constant 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 },
|
|
{ "joint_gear", Joint::JOINT_GEAR },
|
|
{ 0, 0 }
|
|
{ 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);
|
|
return luax_register_module(L, w);
|
|
}
|
|
}
|
|
|
|
|