mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Implmented a few 'missing methods' in love.physics.
This commit is contained in:
@@ -38,8 +38,30 @@ namespace box2d
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_CircleShape_getLocalCenter(lua_State * L)
|
||||
{
|
||||
CircleShape * c = luax_checkcircleshape(L, 1);
|
||||
float x, y;
|
||||
c->getLocalCenter(x, y);
|
||||
lua_pushnumber(L, x);
|
||||
lua_pushnumber(L, y);
|
||||
return 2;
|
||||
}
|
||||
|
||||
int w_CircleShape_getWorldCenter(lua_State * L)
|
||||
{
|
||||
CircleShape * c = luax_checkcircleshape(L, 1);
|
||||
float x, y;
|
||||
c->getWorldCenter(x, y);
|
||||
lua_pushnumber(L, x);
|
||||
lua_pushnumber(L, y);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static const luaL_Reg functions[] = {
|
||||
{ "getRadius", w_CircleShape_getRadius },
|
||||
{ "getLocalCenter", w_CircleShape_getLocalCenter },
|
||||
{ "getWorldCenter", w_CircleShape_getWorldCenter },
|
||||
// From Shape.
|
||||
{ "getType", w_Shape_getType },
|
||||
{ "setFriction", w_Shape_setFriction },
|
||||
|
||||
Reference in New Issue
Block a user