more joint updates to better match the API

--HG--
branch : box2d-update
This commit is contained in:
Bill Meltsner
2011-07-02 11:46:42 -05:00
parent b4fae893fd
commit b3434997bf
15 changed files with 122 additions and 40 deletions
@@ -61,12 +61,46 @@ namespace box2d
lua_pushnumber(L, t->getMaxForce());
return 1;
}
int w_MouseJoint_setFrequency(lua_State * L)
{
MouseJoint * t = luax_checkmousejoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
t->setFrequency(arg1);
return 0;
}
int w_MouseJoint_getFrequency(lua_State * L)
{
MouseJoint * t = luax_checkmousejoint(L, 1);
lua_pushnumber(L, t->getFrequency());
return 1;
}
int w_MouseJoint_setDampingRatio(lua_State * L)
{
MouseJoint * t = luax_checkmousejoint(L, 1);
float arg1 = (float)luaL_checknumber(L, 2);
t->setDampingRatio(arg1);
return 0;
}
int w_MouseJoint_getDampingRatio(lua_State * L)
{
MouseJoint * t = luax_checkmousejoint(L, 1);
lua_pushnumber(L, t->getDampingRatio());
return 1;
}
static const luaL_Reg functions[] = {
{ "setTarget", w_MouseJoint_setTarget },
{ "getTarget", w_MouseJoint_getTarget },
{ "setMaxForce", w_MouseJoint_setMaxForce },
{ "getMaxForce", w_MouseJoint_getMaxForce },
{ "setFrequency", w_MouseJoint_setFrequency },
{ "getFrequency", w_MouseJoint_getFrequency },
{ "setDampingRatio", w_MouseJoint_setDampingRatio },
{ "getDampingRatio", w_MouseJoint_getDampingRatio },
// From Joint.
{ "getType", w_Joint_getType },
{ "getAnchors", w_Joint_getAnchors },