Rename World:queryBoundingBox to World:queryFixturesInArea.

Matches the new World:getFixturesInArea function.
This commit is contained in:
Sasha Szpakowski
2023-10-02 11:06:15 -03:00
parent d24ccde864
commit c3847d5f04
3 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -569,7 +569,7 @@ b2Body *World::getGroundBody() const
return groundBody; return groundBody;
} }
int World::queryBoundingBox(lua_State *L) int World::queryFixturesInArea(lua_State *L)
{ {
b2AABB box; b2AABB box;
float lx = (float)luaL_checknumber(L, 1); float lx = (float)luaL_checknumber(L, 1);
+1 -1
View File
@@ -286,7 +286,7 @@ public:
/** /**
* Calls a callback on all fixtures that overlap a given bounding box. * Calls a callback on all fixtures that overlap a given bounding box.
**/ **/
int queryBoundingBox(lua_State *L); int queryFixturesInArea(lua_State *L);
/** /**
* Gets all fixtures that overlap a given bounding box. * Gets all fixtures that overlap a given bounding box.
+12 -3
View File
@@ -178,11 +178,17 @@ int w_World_getContacts(lua_State *L)
return ret; return ret;
} }
int w_World_queryBoundingBox(lua_State *L) int w_World_queryFixturesInArea(lua_State *L)
{ {
World *t = luax_checkworld(L, 1); World *t = luax_checkworld(L, 1);
lua_remove(L, 1); lua_remove(L, 1);
return t->queryBoundingBox(L); return t->queryFixturesInArea(L);
}
int w_World_queryBoundingBox(lua_State* L)
{
luax_markdeprecated(L, 1, "World:queryBoundingBox", API_METHOD, DEPRECATED_RENAMED, "World:queryFixturesInArea");
return w_World_queryFixturesInArea(L);
} }
int w_World_getFixturesInArea(lua_State *L) int w_World_getFixturesInArea(lua_State *L)
@@ -236,12 +242,15 @@ static const luaL_Reg w_World_functions[] =
{ "getBodies", w_World_getBodies }, { "getBodies", w_World_getBodies },
{ "getJoints", w_World_getJoints }, { "getJoints", w_World_getJoints },
{ "getContacts", w_World_getContacts }, { "getContacts", w_World_getContacts },
{ "queryBoundingBox", w_World_queryBoundingBox }, { "queryFixturesInArea", w_World_queryFixturesInArea },
{ "getFixturesInArea", w_World_getFixturesInArea }, { "getFixturesInArea", w_World_getFixturesInArea },
{ "rayCast", w_World_rayCast }, { "rayCast", w_World_rayCast },
{ "destroy", w_World_destroy }, { "destroy", w_World_destroy },
{ "isDestroyed", w_World_isDestroyed }, { "isDestroyed", w_World_isDestroyed },
// Deprecated
{ "queryBoundingBox", w_World_queryBoundingBox },
{ 0, 0 } { 0, 0 }
}; };