mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
more joint updates to better match the API
--HG-- branch : box2d-update
This commit is contained in:
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user