1. rude
  2. love

Commits

Alex Szpakowski  committed 76dc365

Added Body:getWorld (resolves issue #895)

  • Participants
  • Parent commits a806121
  • Branches default

Comments (0)

Files changed (2)

File src/modules/physics/box2d/wrap_Body.cpp

View file
  • Ignore whitespace
 	return 1;
 }
 
+int w_Body_getWorld(lua_State *L)
+{
+	Body *t = luax_checkbody(L, 1);
+	World *world = t->getWorld();
+	world->retain();
+	luax_pushtype(L, "World", PHYSICS_WORLD_T, world);
+	return 1;
+}
+
 int w_Body_getFixtureList(lua_State *L)
 {
 	Body *t = luax_checkbody(L, 1);
 	{ "setAwake", w_Body_setAwake },
 	{ "setFixedRotation", w_Body_setFixedRotation },
 	{ "isFixedRotation", w_Body_isFixedRotation },
+	{ "getWorld", w_Body_getWorld },
 	{ "getFixtureList", w_Body_getFixtureList },
 	{ "destroy", w_Body_destroy },
 	{ "setUserData", w_Body_setUserData },

File src/modules/physics/box2d/wrap_Body.h

View file
  • Ignore whitespace
 int w_Body_setAwake(lua_State *L);
 int w_Body_setFixedRotation(lua_State *L);
 int w_Body_isFixedRotation(lua_State *L);
+int w_Body_getWorld(lua_State *L);
 int w_Body_getFixtureList(lua_State *L);
 int w_Body_destroy(lua_State *L);
 int w_Body_setUserData(lua_State *L);