Exemple #1
0
int w_ChainShape_getChildEdge(lua_State *L)
{
	ChainShape *c = luax_checkchainshape(L, 1);
	int index = luaL_checkint(L, 2) - 1; // Convert from 1-based index
	EdgeShape *e = c->getChildEdge(index);
	luax_newtype(L, "EdgeShape", PHYSICS_EDGE_SHAPE_T, e);
	return 1;
}
Exemple #2
0
int w_ChainShape_getChildEdge(lua_State *L)
{
	ChainShape *c = luax_checkchainshape(L, 1);
	int index = (int) luaL_checknumber(L, 2) - 1; // Convert from 1-based index
	EdgeShape *e = 0;
	luax_catchexcept(L, [&](){ e = c->getChildEdge(index); });
	luax_pushtype(L, PHYSICS_EDGE_SHAPE_ID, e);
	e->release();
	return 1;
}