Update WeldJoint for new soft constraint options

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-09-23 16:17:29 -04:00
parent 3c7310e76d
commit a956f9b0c1
4 changed files with 82 additions and 0 deletions
@@ -31,7 +31,41 @@ namespace box2d
return luax_checktype<WeldJoint>(L, idx, "WeldJoint", PHYSICS_WELD_JOINT_T);
}
int w_WeldJoint_setFrequency(lua_State * L)
{
WeldJoint * t = luax_checkweldjoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
t->setFrequency(arg1);
return 0;
}
int w_WeldJoint_getFrequency(lua_State * L)
{
WeldJoint * t = luax_checkweldjoint(L, 1);
lua_pushnumber(L, t->getFrequency());
return 1;
}
int w_WeldJoint_setDampingRatio(lua_State * L)
{
WeldJoint * t = luax_checkweldjoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
t->setDampingRatio(arg1);
return 0;
}
int w_WeldJoint_getDampingRatio(lua_State * L)
{
WeldJoint * t = luax_checkweldjoint(L, 1);
lua_pushnumber(L, t->getDampingRatio());
return 1;
}
static const luaL_Reg functions[] = {
{ "setFrequency", w_WeldJoint_setFrequency },
{ "getFrequency", w_WeldJoint_getFrequency },
{ "setDampingRatio", w_WeldJoint_setDampingRatio },
{ "getDampingRatio", w_WeldJoint_getDampingRatio },
// From Joint.
{ "getType", w_Joint_getType },
{ "getAnchors", w_Joint_getAnchors },