Exemple #1
0
int w_ChainShape_getPoint(lua_State *L)
{
	ChainShape *c = luax_checkchainshape(L, 1);
	int index = (int) luaL_checknumber(L, 2) - 1; // Convert from 1-based index
	b2Vec2 v;
	luax_catchexcept(L, [&](){ v = c->getPoint(index); });
	lua_pushnumber(L, v.x);
	lua_pushnumber(L, v.y);
	return 2;
}
Exemple #2
0
int w_ChainShape_getPoint(lua_State *L)
{
	ChainShape *c = luax_checkchainshape(L, 1);
	int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index
	b2Vec2 v;
	ASSERT_GUARD(v = c->getPoint(index);)